зеркало из https://github.com/mozilla/gecko-dev.git
Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan
This commit is contained in:
Родитель
1e45690b3d
Коммит
02a1314689
|
@ -238,7 +238,7 @@ nsresult LoadInfo::UpdateSystemLoad()
|
||||||
nsresult LoadInfo::UpdateProcessLoad() {
|
nsresult LoadInfo::UpdateProcessLoad() {
|
||||||
#if defined(LINUX) || defined(ANDROID)
|
#if defined(LINUX) || defined(ANDROID)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, nullptr);
|
||||||
const uint64_t total_times = tv.tv_sec * PR_USEC_PER_SEC + tv.tv_usec;
|
const uint64_t total_times = tv.tv_sec * PR_USEC_PER_SEC + tv.tv_usec;
|
||||||
|
|
||||||
rusage usage;
|
rusage usage;
|
||||||
|
|
|
@ -498,7 +498,7 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo)
|
||||||
|
|
||||||
tmpJsVal.setString(tmpJsStr);
|
tmpJsVal.setString(tmpJsStr);
|
||||||
if (!JS_DefineProperty(aCx, infoJsObj, "receiver", tmpJsVal,
|
if (!JS_DefineProperty(aCx, infoJsObj, "receiver", tmpJsVal,
|
||||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,14 +510,14 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo)
|
||||||
|
|
||||||
tmpJsVal.setString(tmpJsStr);
|
tmpJsVal.setString(tmpJsStr);
|
||||||
if (!JS_DefineProperty(aCx, infoJsObj, "deliveryStatus", tmpJsVal,
|
if (!JS_DefineProperty(aCx, infoJsObj, "deliveryStatus", tmpJsVal,
|
||||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get |info.deliveryTimestamp|.
|
// Get |info.deliveryTimestamp|.
|
||||||
if (!JS_DefineProperty(aCx, infoJsObj,
|
if (!JS_DefineProperty(aCx, infoJsObj,
|
||||||
"deliveryTimestamp", info.deliveryTimestamp,
|
"deliveryTimestamp", info.deliveryTimestamp,
|
||||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1577,7 +1577,7 @@ TrackPropertiesForSingletonScopes(JSContext *cx, JSScript *script, BaselineFrame
|
||||||
// could access are tracked. These are generally accessed through
|
// could access are tracked. These are generally accessed through
|
||||||
// ALIASEDVAR operations in baseline and will not be tracked even if they
|
// ALIASEDVAR operations in baseline and will not be tracked even if they
|
||||||
// have been accessed in baseline code.
|
// have been accessed in baseline code.
|
||||||
JSObject *environment = script->function() ? script->function()->environment() : NULL;
|
JSObject *environment = script->function() ? script->function()->environment() : nullptr;
|
||||||
|
|
||||||
while (environment && !environment->is<GlobalObject>()) {
|
while (environment && !environment->is<GlobalObject>()) {
|
||||||
if (environment->is<CallObject>() && environment->hasSingletonType())
|
if (environment->is<CallObject>() && environment->hasSingletonType())
|
||||||
|
|
|
@ -8340,8 +8340,8 @@ IonBuilder::getPropTryCommonGetter(bool *emitted, PropertyName *name,
|
||||||
{
|
{
|
||||||
JS_ASSERT(*emitted == false);
|
JS_ASSERT(*emitted == false);
|
||||||
|
|
||||||
Shape *lastProperty = NULL;
|
Shape *lastProperty = nullptr;
|
||||||
JSFunction *commonGetter = NULL;
|
JSFunction *commonGetter = nullptr;
|
||||||
JSObject *foundProto = inspector->commonGetPropFunction(pc, &lastProperty, &commonGetter);
|
JSObject *foundProto = inspector->commonGetPropFunction(pc, &lastProperty, &commonGetter);
|
||||||
if (!foundProto)
|
if (!foundProto)
|
||||||
return true;
|
return true;
|
||||||
|
@ -8619,8 +8619,8 @@ IonBuilder::setPropTryCommonSetter(bool *emitted, MDefinition *obj,
|
||||||
{
|
{
|
||||||
JS_ASSERT(*emitted == false);
|
JS_ASSERT(*emitted == false);
|
||||||
|
|
||||||
Shape *lastProperty = NULL;
|
Shape *lastProperty = nullptr;
|
||||||
JSFunction *commonSetter = NULL;
|
JSFunction *commonSetter = nullptr;
|
||||||
JSObject *foundProto = inspector->commonSetPropFunction(pc, &lastProperty, &commonSetter);
|
JSObject *foundProto = inspector->commonSetPropFunction(pc, &lastProperty, &commonSetter);
|
||||||
if (!foundProto)
|
if (!foundProto)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int
|
||||||
if (i < bindings.length()) {
|
if (i < bindings.length()) {
|
||||||
name = nameBytes.encodeLatin1(cx, bindings[i].name());
|
name = nameBytes.encodeLatin1(cx, bindings[i].name());
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
|
@ -488,7 +488,7 @@ Options(JSContext *cx, unsigned argc, jsval *vp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char *names = NULL;
|
char *names = nullptr;
|
||||||
if (oldOptions.extraWarnings()) {
|
if (oldOptions.extraWarnings()) {
|
||||||
names = JS_sprintf_append(names, "%s", "strict");
|
names = JS_sprintf_append(names, "%s", "strict");
|
||||||
if (!names) {
|
if (!names) {
|
||||||
|
|
|
@ -370,7 +370,7 @@ class MutexBase
|
||||||
public:
|
public:
|
||||||
MutexBase()
|
MutexBase()
|
||||||
{
|
{
|
||||||
pthread_mutex_init(&mMutex, NULL);
|
pthread_mutex_init(&mMutex, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lock()
|
void Lock()
|
||||||
|
@ -1259,7 +1259,7 @@ replace_realloc(void* aOldPtr, size_t aSize)
|
||||||
return InfallibleAllocPolicy::realloc_(aOldPtr, aSize);
|
return InfallibleAllocPolicy::realloc_(aOldPtr, aSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If |aOldPtr| is NULL, the call is equivalent to |malloc(aSize)|.
|
// If |aOldPtr| is nullptr, the call is equivalent to |malloc(aSize)|.
|
||||||
if (!aOldPtr) {
|
if (!aOldPtr) {
|
||||||
return replace_malloc(aSize);
|
return replace_malloc(aSize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -955,7 +955,7 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
|
||||||
{ &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
|
{ &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
|
||||||
{ &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor },
|
{ &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor },
|
||||||
{ &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
|
{ &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
|
||||||
{ &kNS_NETWORKSEER_CID, false, NULL, mozilla::net::Seer::Create },
|
{ &kNS_NETWORKSEER_CID, false, nullptr, mozilla::net::Seer::Create },
|
||||||
{ nullptr }
|
{ nullptr }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -375,7 +375,7 @@ static bool HostIgnoredByProxy(const nsACString& aIgnore,
|
||||||
nsDependentCSubstring ignoreStripped(start, slash);
|
nsDependentCSubstring ignoreStripped(start, slash);
|
||||||
PRIPv6Addr ignoreAddr, hostAddr;
|
PRIPv6Addr ignoreAddr, hostAddr;
|
||||||
if (!ConvertToIPV6Addr(ignoreStripped, &ignoreAddr, &mask) ||
|
if (!ConvertToIPV6Addr(ignoreStripped, &ignoreAddr, &mask) ||
|
||||||
!ConvertToIPV6Addr(aHost, &hostAddr, NULL))
|
!ConvertToIPV6Addr(aHost, &hostAddr, nullptr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
proxy_MaskIPv6Addr(ignoreAddr, mask);
|
proxy_MaskIPv6Addr(ignoreAddr, mask);
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef NSInteger NSWindowAnimationBehavior;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _nsCocoaWindowList {
|
typedef struct _nsCocoaWindowList {
|
||||||
_nsCocoaWindowList() : prev(NULL), window(NULL) {}
|
_nsCocoaWindowList() : prev(nullptr), window(nullptr) {}
|
||||||
struct _nsCocoaWindowList *prev;
|
struct _nsCocoaWindowList *prev;
|
||||||
nsCocoaWindow *window; // Weak
|
nsCocoaWindow *window; // Weak
|
||||||
} nsCocoaWindowList;
|
} nsCocoaWindowList;
|
||||||
|
|
|
@ -162,9 +162,9 @@ Close()
|
||||||
|
|
||||||
munmap(Buffers()[0]->Data(), sMappedSize);
|
munmap(Buffers()[0]->Data(), sMappedSize);
|
||||||
delete sBuffers;
|
delete sBuffers;
|
||||||
sBuffers = NULL;
|
sBuffers = nullptr;
|
||||||
delete sScreenSize;
|
delete sScreenSize;
|
||||||
sScreenSize = NULL;
|
sScreenSize = nullptr;
|
||||||
|
|
||||||
close(sFd);
|
close(sFd);
|
||||||
sFd = -1;
|
sFd = -1;
|
||||||
|
|
|
@ -146,7 +146,7 @@ WinUtils::GetWindowsServicePackVersion(UINT& aOutMajor, UINT& aOutMinor)
|
||||||
void
|
void
|
||||||
WinUtils::LogW(const wchar_t *fmt, ...)
|
WinUtils::LogW(const wchar_t *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args = NULL;
|
va_list args = nullptr;
|
||||||
if(!lstrlenW(fmt)) {
|
if(!lstrlenW(fmt)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,8 @@ WinUtils::LogW(const wchar_t *fmt, ...)
|
||||||
char* utf8 = new char[len+1];
|
char* utf8 = new char[len+1];
|
||||||
memset(utf8, 0, sizeof(utf8));
|
memset(utf8, 0, sizeof(utf8));
|
||||||
if (WideCharToMultiByte(CP_ACP, 0, buffer,
|
if (WideCharToMultiByte(CP_ACP, 0, buffer,
|
||||||
-1, utf8, len+1, NULL,
|
-1, utf8, len+1, nullptr,
|
||||||
NULL) > 0) {
|
nullptr) > 0) {
|
||||||
// desktop console
|
// desktop console
|
||||||
printf("%s\n", utf8);
|
printf("%s\n", utf8);
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
|
@ -188,7 +188,7 @@ WinUtils::LogW(const wchar_t *fmt, ...)
|
||||||
void
|
void
|
||||||
WinUtils::Log(const char *fmt, ...)
|
WinUtils::Log(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args = NULL;
|
va_list args = nullptr;
|
||||||
if(!strlen(fmt)) {
|
if(!strlen(fmt)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,8 +67,8 @@ nsresult GetProfileHDDInfo(nsAutoCString& aModel, nsAutoCString& aRevision)
|
||||||
volumeMountPoint[volumeMountPointLen - 1] = L'\0';
|
volumeMountPoint[volumeMountPointLen - 1] = L'\0';
|
||||||
}
|
}
|
||||||
ScopedHandle handle(::CreateFileW(volumeMountPoint, 0,
|
ScopedHandle handle(::CreateFileW(volumeMountPoint, 0,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
OPEN_EXISTING, 0, NULL));
|
nullptr, OPEN_EXISTING, 0, nullptr));
|
||||||
if (!handle.IsValid()) {
|
if (!handle.IsValid()) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
MozillaUnRegisterDebugFD(fd);
|
MozillaUnRegisterDebugFD(fd);
|
||||||
fclose(mFile);
|
fclose(mFile);
|
||||||
mSHA1.finish(aHash);
|
mSHA1.finish(aHash);
|
||||||
mFile = NULL;
|
mFile = nullptr;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
FILE *mFile;
|
FILE *mFile;
|
||||||
|
@ -137,8 +137,8 @@ void LateWriteObserver::Observe(IOInterposeObserver::Observation& aOb)
|
||||||
do {
|
do {
|
||||||
// mkstemp isn't supported so keep trying until we get a file
|
// mkstemp isn't supported so keep trying until we get a file
|
||||||
int result = _mktemp_s(name, strlen(name) + 1);
|
int result = _mktemp_s(name, strlen(name) + 1);
|
||||||
hFile = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_NEW,
|
hFile = CreateFileA(name, GENERIC_WRITE, 0, nullptr, CREATE_NEW,
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||||
} while (GetLastError() == ERROR_FILE_EXISTS);
|
} while (GetLastError() == ERROR_FILE_EXISTS);
|
||||||
|
|
||||||
if (hFile == INVALID_HANDLE_VALUE) {
|
if (hFile == INVALID_HANDLE_VALUE) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче