diff --git a/content/media/webrtc/LoadMonitor.cpp b/content/media/webrtc/LoadMonitor.cpp index 25136a60717f..4d1c00ec8390 100644 --- a/content/media/webrtc/LoadMonitor.cpp +++ b/content/media/webrtc/LoadMonitor.cpp @@ -238,7 +238,7 @@ nsresult LoadInfo::UpdateSystemLoad() nsresult LoadInfo::UpdateProcessLoad() { #if defined(LINUX) || defined(ANDROID) struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); const uint64_t total_times = tv.tv_sec * PR_USEC_PER_SEC + tv.tv_usec; rusage usage; diff --git a/dom/mobilemessage/src/MmsMessage.cpp b/dom/mobilemessage/src/MmsMessage.cpp index 9650eaccfa68..cbbdf9d057ee 100644 --- a/dom/mobilemessage/src/MmsMessage.cpp +++ b/dom/mobilemessage/src/MmsMessage.cpp @@ -498,7 +498,7 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo) tmpJsVal.setString(tmpJsStr); if (!JS_DefineProperty(aCx, infoJsObj, "receiver", tmpJsVal, - NULL, NULL, JSPROP_ENUMERATE)) { + nullptr, nullptr, JSPROP_ENUMERATE)) { return NS_ERROR_FAILURE; } @@ -510,14 +510,14 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo) tmpJsVal.setString(tmpJsStr); if (!JS_DefineProperty(aCx, infoJsObj, "deliveryStatus", tmpJsVal, - NULL, NULL, JSPROP_ENUMERATE)) { + nullptr, nullptr, JSPROP_ENUMERATE)) { return NS_ERROR_FAILURE; } // Get |info.deliveryTimestamp|. if (!JS_DefineProperty(aCx, infoJsObj, "deliveryTimestamp", info.deliveryTimestamp, - NULL, NULL, JSPROP_ENUMERATE)) { + nullptr, nullptr, JSPROP_ENUMERATE)) { return NS_ERROR_FAILURE; } diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 4425cd05fca2..7a960a84d1c3 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -1577,7 +1577,7 @@ TrackPropertiesForSingletonScopes(JSContext *cx, JSScript *script, BaselineFrame // could access are tracked. These are generally accessed through // ALIASEDVAR operations in baseline and will not be tracked even if they // 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()) { if (environment->is() && environment->hasSingletonType()) diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 18623ab7f978..68cc39cc5432 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -8340,8 +8340,8 @@ IonBuilder::getPropTryCommonGetter(bool *emitted, PropertyName *name, { JS_ASSERT(*emitted == false); - Shape *lastProperty = NULL; - JSFunction *commonGetter = NULL; + Shape *lastProperty = nullptr; + JSFunction *commonGetter = nullptr; JSObject *foundProto = inspector->commonGetPropFunction(pc, &lastProperty, &commonGetter); if (!foundProto) return true; @@ -8619,8 +8619,8 @@ IonBuilder::setPropTryCommonSetter(bool *emitted, MDefinition *obj, { JS_ASSERT(*emitted == false); - Shape *lastProperty = NULL; - JSFunction *commonSetter = NULL; + Shape *lastProperty = nullptr; + JSFunction *commonSetter = nullptr; JSObject *foundProto = inspector->commonSetPropFunction(pc, &lastProperty, &commonSetter); if (!foundProto) return true; diff --git a/js/src/vm/OldDebugAPI.cpp b/js/src/vm/OldDebugAPI.cpp index 66dcc003d298..0e8f0e33cc03 100644 --- a/js/src/vm/OldDebugAPI.cpp +++ b/js/src/vm/OldDebugAPI.cpp @@ -1124,7 +1124,7 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int if (i < bindings.length()) { name = nameBytes.encodeLatin1(cx, bindings[i].name()); if (!buf) - return NULL; + return nullptr; } if (value) { diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index d4599d2f41b5..6362cd5ff803 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -488,7 +488,7 @@ Options(JSContext *cx, unsigned argc, jsval *vp) } } - char *names = NULL; + char *names = nullptr; if (oldOptions.extraWarnings()) { names = JS_sprintf_append(names, "%s", "strict"); if (!names) { diff --git a/memory/replace/dmd/DMD.cpp b/memory/replace/dmd/DMD.cpp index cc46d281cd8b..5dbadd1f61e3 100644 --- a/memory/replace/dmd/DMD.cpp +++ b/memory/replace/dmd/DMD.cpp @@ -370,7 +370,7 @@ class MutexBase public: MutexBase() { - pthread_mutex_init(&mMutex, NULL); + pthread_mutex_init(&mMutex, nullptr); } void Lock() @@ -1259,7 +1259,7 @@ replace_realloc(void* aOldPtr, size_t 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) { return replace_malloc(aSize); } diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index c53cc6f3cc7d..552d1d2107ae 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -955,7 +955,7 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = { { &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor }, { &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor }, { &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 } }; diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp index 88c4350ee444..e2fae9acbace 100644 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp @@ -375,7 +375,7 @@ static bool HostIgnoredByProxy(const nsACString& aIgnore, nsDependentCSubstring ignoreStripped(start, slash); PRIPv6Addr ignoreAddr, hostAddr; if (!ConvertToIPV6Addr(ignoreStripped, &ignoreAddr, &mask) || - !ConvertToIPV6Addr(aHost, &hostAddr, NULL)) + !ConvertToIPV6Addr(aHost, &hostAddr, nullptr)) return false; proxy_MaskIPv6Addr(ignoreAddr, mask); diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index 19597136bcea..7cc310b40e79 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -47,7 +47,7 @@ typedef NSInteger NSWindowAnimationBehavior; #endif typedef struct _nsCocoaWindowList { - _nsCocoaWindowList() : prev(NULL), window(NULL) {} + _nsCocoaWindowList() : prev(nullptr), window(nullptr) {} struct _nsCocoaWindowList *prev; nsCocoaWindow *window; // Weak } nsCocoaWindowList; diff --git a/widget/gonk/Framebuffer.cpp b/widget/gonk/Framebuffer.cpp index b42c3531c01d..6f5656ec01b3 100644 --- a/widget/gonk/Framebuffer.cpp +++ b/widget/gonk/Framebuffer.cpp @@ -162,9 +162,9 @@ Close() munmap(Buffers()[0]->Data(), sMappedSize); delete sBuffers; - sBuffers = NULL; + sBuffers = nullptr; delete sScreenSize; - sScreenSize = NULL; + sScreenSize = nullptr; close(sFd); sFd = -1; diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index 054a297db944..998bbea18bcb 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -146,7 +146,7 @@ WinUtils::GetWindowsServicePackVersion(UINT& aOutMajor, UINT& aOutMinor) void WinUtils::LogW(const wchar_t *fmt, ...) { - va_list args = NULL; + va_list args = nullptr; if(!lstrlenW(fmt)) { return; } @@ -169,8 +169,8 @@ WinUtils::LogW(const wchar_t *fmt, ...) char* utf8 = new char[len+1]; memset(utf8, 0, sizeof(utf8)); if (WideCharToMultiByte(CP_ACP, 0, buffer, - -1, utf8, len+1, NULL, - NULL) > 0) { + -1, utf8, len+1, nullptr, + nullptr) > 0) { // desktop console printf("%s\n", utf8); #ifdef PR_LOGGING @@ -188,7 +188,7 @@ WinUtils::LogW(const wchar_t *fmt, ...) void WinUtils::Log(const char *fmt, ...) { - va_list args = NULL; + va_list args = nullptr; if(!strlen(fmt)) { return; } diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index 461a16616e95..9439092ee94f 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -67,8 +67,8 @@ nsresult GetProfileHDDInfo(nsAutoCString& aModel, nsAutoCString& aRevision) volumeMountPoint[volumeMountPointLen - 1] = L'\0'; } ScopedHandle handle(::CreateFileW(volumeMountPoint, 0, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, 0, NULL)); + FILE_SHARE_READ | FILE_SHARE_WRITE, + nullptr, OPEN_EXISTING, 0, nullptr)); if (!handle.IsValid()) { return NS_ERROR_UNEXPECTED; } diff --git a/xpcom/build/LateWriteChecks.cpp b/xpcom/build/LateWriteChecks.cpp index 9db215ccedba..5d244772dbd7 100644 --- a/xpcom/build/LateWriteChecks.cpp +++ b/xpcom/build/LateWriteChecks.cpp @@ -67,7 +67,7 @@ public: MozillaUnRegisterDebugFD(fd); fclose(mFile); mSHA1.finish(aHash); - mFile = NULL; + mFile = nullptr; } private: FILE *mFile; @@ -137,8 +137,8 @@ void LateWriteObserver::Observe(IOInterposeObserver::Observation& aOb) do { // mkstemp isn't supported so keep trying until we get a file int result = _mktemp_s(name, strlen(name) + 1); - hFile = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_NEW, - FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileA(name, GENERIC_WRITE, 0, nullptr, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, nullptr); } while (GetLastError() == ERROR_FILE_EXISTS); if (hFile == INVALID_HANDLE_VALUE) {