From c293ca84b8181dbff28dfb55e31d79b646d88321 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Mon, 6 Jan 2014 10:06:04 -0500 Subject: [PATCH] Bug 784739 - Switch from NULL to nullptr in remaining directories; r=ehsan --HG-- extra : rebase_source : 1ff19b2c8fd0e77fa8e822f5007a9fa3a6b6d474 --- content/base/src/nsScriptLoader.cpp | 2 +- content/media/fmp4/wmf/MFTDecoder.cpp | 2 +- content/media/fmp4/wmf/WMFVideoDecoder.cpp | 2 +- dom/bluetooth/bluedroid/BluetoothSocket.cpp | 2 +- gfx/layers/Effects.h | 2 +- gfx/layers/composite/ImageHost.h | 8 ++++---- gfx/layers/d3d9/CompositorD3D9.cpp | 12 ++++++------ gfx/layers/d3d9/CompositorD3D9.h | 2 +- gfx/layers/d3d9/DeviceManagerD3D9.cpp | 2 +- gfx/layers/d3d9/TextureD3D9.cpp | 5 +++-- gfx/src/nsRegion.h | 2 +- gfx/thebes/gfxASurface.cpp | 2 +- js/src/builtin/SIMD.cpp | 8 ++++---- js/src/builtin/TypeRepresentation.cpp | 2 +- js/src/jit/AsmJS.cpp | 8 ++++---- js/src/jsapi.cpp | 2 +- js/src/jsproxy.cpp | 2 +- js/src/jsscript.cpp | 2 +- js/src/jswrapper.cpp | 2 +- js/src/vm/GlobalObject.cpp | 2 +- netwerk/dns/nsHostResolver.cpp | 4 ++-- widget/android/AndroidBridge.cpp | 14 +++++++------- widget/android/AndroidJNI.cpp | 2 +- widget/android/AndroidJavaWrappers.h | 12 ++++++------ widget/nsIWidget.h | 2 +- xpcom/base/nsMemoryReporterManager.cpp | 6 +++--- 26 files changed, 56 insertions(+), 55 deletions(-) diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 5f342bd11d9..7f8792b08be 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -724,7 +724,7 @@ class NotifyOffThreadScriptLoadCompletedRunnable : public nsRunnable public: NotifyOffThreadScriptLoadCompletedRunnable(nsScriptLoadRequest* aRequest, nsScriptLoader* aLoader) - : mRequest(aRequest), mLoader(aLoader), mToken(NULL) + : mRequest(aRequest), mLoader(aLoader), mToken(nullptr) {} void SetToken(void* aToken) { diff --git a/content/media/fmp4/wmf/MFTDecoder.cpp b/content/media/fmp4/wmf/MFTDecoder.cpp index 65fe6224597..7bdfa05a3f7 100644 --- a/content/media/fmp4/wmf/MFTDecoder.cpp +++ b/content/media/fmp4/wmf/MFTDecoder.cpp @@ -36,7 +36,7 @@ MFTDecoder::Create(const GUID& aMFTClsID) // Create the IMFTransform to do the decoding. HRESULT hr; hr = CoCreateInstance(aMFTClsID, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IMFTransform, reinterpret_cast(static_cast(byRef(mDecoder)))); diff --git a/content/media/fmp4/wmf/WMFVideoDecoder.cpp b/content/media/fmp4/wmf/WMFVideoDecoder.cpp index 74ff896fc61..8fd28450611 100644 --- a/content/media/fmp4/wmf/WMFVideoDecoder.cpp +++ b/content/media/fmp4/wmf/WMFVideoDecoder.cpp @@ -245,7 +245,7 @@ WMFVideoDecoder::CreateBasicVideoFrame(IMFSample* aSample, hr = twoDBuffer->Lock2D(&data, &stride); NS_ENSURE_TRUE(SUCCEEDED(hr), hr); } else { - hr = buffer->Lock(&data, NULL, NULL); + hr = buffer->Lock(&data, nullptr, nullptr); NS_ENSURE_TRUE(SUCCEEDED(hr), hr); stride = mVideoStride; } diff --git a/dom/bluetooth/bluedroid/BluetoothSocket.cpp b/dom/bluetooth/bluedroid/BluetoothSocket.cpp index 8c45c49a94b..6e38176be80 100644 --- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp +++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp @@ -426,7 +426,7 @@ DroidSocketImpl::ReadMsg(int aFd, void *aBuffer, size_t aLength) // Extract client fd from message header for (struct cmsghdr *cmsgptr = CMSG_FIRSTHDR(&msg); - cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { + cmsgptr != nullptr; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { if (cmsgptr->cmsg_level != SOL_SOCKET) { continue; } diff --git a/gfx/layers/Effects.h b/gfx/layers/Effects.h index 5199059f743..7622e9d45b7 100644 --- a/gfx/layers/Effects.h +++ b/gfx/layers/Effects.h @@ -189,7 +189,7 @@ struct EffectSolidColor : public Effect struct EffectChain { - EffectChain() : mLayerRef(NULL) {} + EffectChain() : mLayerRef(nullptr) {} explicit EffectChain(void* aLayerRef) : mLayerRef(aLayerRef) {} RefPtr mPrimaryEffect; diff --git a/gfx/layers/composite/ImageHost.h b/gfx/layers/composite/ImageHost.h index 7855ea7c81d..13f788fd658 100644 --- a/gfx/layers/composite/ImageHost.h +++ b/gfx/layers/composite/ImageHost.h @@ -6,7 +6,7 @@ #ifndef MOZILLA_GFX_IMAGEHOST_H #define MOZILLA_GFX_IMAGEHOST_H -#include // for FILE, NULL +#include // for FILE #include "CompositableHost.h" // for CompositableHost #include "mozilla/Attributes.h" // for MOZ_OVERRIDE #include "mozilla/RefPtr.h" // for RefPtr @@ -70,9 +70,9 @@ public: virtual void PrintInfo(nsACString& aTo, const char* aPrefix); #ifdef MOZ_DUMP_PAINTING - virtual void Dump(FILE* aFile=NULL, - const char* aPrefix="", - bool aDumpHtml=false) MOZ_OVERRIDE; + virtual void Dump(FILE* aFile = nullptr, + const char* aPrefix = "", + bool aDumpHtml = false) MOZ_OVERRIDE; virtual TemporaryRef GetAsSurface() MOZ_OVERRIDE; #endif diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index ff05565f2e7..c287dfa781c 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -98,7 +98,7 @@ CompositorD3D9::CreateRenderTarget(const gfx::IntRect &aRect, HRESULT hr = device()->CreateTexture(aRect.width, aRect.height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, byRef(texture), - NULL); + nullptr); if (FAILED(hr)) { ReportFailure(NS_LITERAL_CSTRING("CompositorD3D9::CreateRenderTarget: Failed to create texture"), hr); @@ -124,7 +124,7 @@ CompositorD3D9::CreateRenderTargetFromSource(const gfx::IntRect &aRect, HRESULT hr = device()->CreateTexture(aRect.width, aRect.height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, byRef(texture), - NULL); + nullptr); if (FAILED(hr)) { ReportFailure(NS_LITERAL_CSTRING("CompositorD3D9::CreateRenderTargetFromSource: Failed to create texture"), hr); @@ -409,7 +409,7 @@ CompositorD3D9::DrawQuad(const gfx::Rect &aRect, // Restore defaults d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - d3d9Device->SetTexture(1, NULL); + d3d9Device->SetTexture(1, nullptr); } return; default: @@ -570,7 +570,7 @@ CompositorD3D9::BeginFrame(const nsIntRegion& aInvalidRegion, EnsureSize(); - device()->Clear(0, NULL, D3DCLEAR_TARGET, 0x00000000, 0, 0); + device()->Clear(0, nullptr, D3DCLEAR_TARGET, 0x00000000, 0, 0); device()->BeginScene(); if (aClipRectOut) { @@ -687,12 +687,12 @@ CompositorD3D9::PaintToTarget() device()->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, - getter_AddRefs(destSurf), NULL); + getter_AddRefs(destSurf), nullptr); device()->GetRenderTargetData(backBuff, destSurf); D3DLOCKED_RECT rect; - destSurf->LockRect(&rect, NULL, D3DLOCK_READONLY); + destSurf->LockRect(&rect, nullptr, D3DLOCK_READONLY); RefPtr sourceSurface = Factory::CreateWrappingDataSourceSurface((uint8_t*)rect.pBits, rect.Pitch, diff --git a/gfx/layers/d3d9/CompositorD3D9.h b/gfx/layers/d3d9/CompositorD3D9.h index 7b96fa561a3..4cccb96edf6 100644 --- a/gfx/layers/d3d9/CompositorD3D9.h +++ b/gfx/layers/d3d9/CompositorD3D9.h @@ -159,7 +159,7 @@ private: nsIWidget *mWidget; /* - * Context target, NULL when drawing directly to our swap chain. + * Context target, nullptr when drawing directly to our swap chain. */ RefPtr mTarget; diff --git a/gfx/layers/d3d9/DeviceManagerD3D9.cpp b/gfx/layers/d3d9/DeviceManagerD3D9.cpp index 46db2fd8591..c482c27bdf5 100644 --- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp +++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp @@ -155,7 +155,7 @@ SwapChainD3D9::Present(const nsIntRect &aRect) void SwapChainD3D9::Present() { - mSwapChain->Present(NULL, NULL, 0, 0, 0); + mSwapChain->Present(nullptr, nullptr, 0, 0, 0); } void diff --git a/gfx/layers/d3d9/TextureD3D9.cpp b/gfx/layers/d3d9/TextureD3D9.cpp index 20398f30b8e..a36982b539a 100644 --- a/gfx/layers/d3d9/TextureD3D9.cpp +++ b/gfx/layers/d3d9/TextureD3D9.cpp @@ -184,7 +184,7 @@ TextureSourceD3D9::InitTextures(DeviceManagerD3D9* aDeviceManager, } tmpTexture->GetSurfaceLevel(0, byRef(aSurface)); - aSurface->LockRect(&aLockedRect, NULL, 0); + aSurface->LockRect(&aLockedRect, nullptr, 0); if (!aLockedRect.pBits) { NS_WARNING("Could not lock surface"); return nullptr; @@ -208,7 +208,8 @@ FinishTextures(DeviceManagerD3D9* aDeviceManager, aSurface->UnlockRect(); nsRefPtr dstSurface; aTexture->GetSurfaceLevel(0, getter_AddRefs(dstSurface)); - aDeviceManager->device()->UpdateSurface(aSurface, NULL, dstSurface, NULL); + aDeviceManager->device()->UpdateSurface(aSurface, nullptr, dstSurface, + nullptr); } TemporaryRef diff --git a/gfx/src/nsRegion.h b/gfx/src/nsRegion.h index 2b81c825a20..ebb82530c05 100644 --- a/gfx/src/nsRegion.h +++ b/gfx/src/nsRegion.h @@ -266,7 +266,7 @@ private: // pixman needs to distinguish between an empty region and a region // with one rect so that it can return a different number of rectangles. // Empty rect: data = empty_box - // 1 rect: data = NULL + // 1 rect: data = null // >1 rect: data = rects if (aRect.IsEmpty()) { pixman_region32_clear(&mImpl); diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index d3a51f41a36..e6b58e1300c 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -876,7 +876,7 @@ gfxASurface::WriteAsPNG_internal(FILE* aFile, bool aBinary) return; } - // base 64, result will be NULL terminated + // base 64, result will be null-terminated nsCString encodedImg; rv = Base64Encode(Substring(imgData, imgSize), encodedImg); moz_free(imgData); diff --git a/js/src/builtin/SIMD.cpp b/js/src/builtin/SIMD.cpp index 3bf7e430928..2c06122c3b2 100644 --- a/js/src/builtin/SIMD.cpp +++ b/js/src/builtin/SIMD.cpp @@ -78,7 +78,7 @@ struct Int32x4 { static const char *laneNames[] = {"lane 0", "lane 1", "lane 2", "lane3"}; \ CallArgs args = CallArgsFromVp(argc, vp); \ if(!args.thisv().isObject() || !IsTypedDatum(args.thisv().toObject())) { \ - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO, \ + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \ X4Type::class_.name, laneNames[lane], \ InformalValueTypeName(args.thisv())); \ return false; \ @@ -86,7 +86,7 @@ struct Int32x4 { TypedDatum &datum = AsTypedDatum(args.thisv().toObject()); \ TypeRepresentation *typeRepr = datum.datumTypeRepresentation(); \ if (typeRepr->kind() != TypeRepresentation::X4 || typeRepr->asX4()->type() != Type32x4::type) { \ - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO, \ + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \ X4Type::class_.name, laneNames[lane], \ InformalValueTypeName(args.thisv())); \ return false; \ @@ -109,7 +109,7 @@ struct Int32x4 { bool Type32x4##SignMask(JSContext *cx, unsigned argc, Value *vp) { \ CallArgs args = CallArgsFromVp(argc, vp); \ if(!args.thisv().isObject() || !IsTypedDatum(args.thisv().toObject())) { \ - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO, \ + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \ X4Type::class_.name, "signMask", \ InformalValueTypeName(args.thisv())); \ return false; \ @@ -117,7 +117,7 @@ struct Int32x4 { TypedDatum &datum = AsTypedDatum(args.thisv().toObject()); \ TypeRepresentation *typeRepr = datum.datumTypeRepresentation(); \ if (typeRepr->kind() != TypeRepresentation::X4 || typeRepr->asX4()->type() != Type32x4::type) { \ - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO, \ + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, \ X4Type::class_.name, "signMask", \ InformalValueTypeName(args.thisv())); \ return false; \ diff --git a/js/src/builtin/TypeRepresentation.cpp b/js/src/builtin/TypeRepresentation.cpp index 3f92f6ef899..024e47cb66a 100644 --- a/js/src/builtin/TypeRepresentation.cpp +++ b/js/src/builtin/TypeRepresentation.cpp @@ -781,7 +781,7 @@ SizedArrayTypeRepresentation::appendStringSizedArray(JSContext *cx, StringBuffer contents.append(".array("); SizedArrayTypeRepresentation *arrayType = this; - while (arrayType != NULL) { + while (arrayType != nullptr) { if (!NumberValueToStringBuffer(cx, NumberValue(length()), contents)) return false; diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index 417ee939e30..18919df8853 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -2078,7 +2078,7 @@ class FunctionCompiler MDefinition *constantFloat(float f) { if (!curBlock_) - return NULL; + return nullptr; MConstant *constant = MConstant::NewAsmJS(alloc(), DoubleValue(double(f)), MIRType_Float32); curBlock_->add(constant); @@ -3042,7 +3042,7 @@ static bool CheckGlobalVariableInitFloat32(ModuleCompiler &m, PropertyName *varName, ParseNode *initNode, bool isConst) { - ParseNode *arg = NULL; + ParseNode *arg = nullptr; if (!CheckFloat32Coercion(m, initNode, &arg, "call must be of the form fround(x)")) return false; @@ -3305,7 +3305,7 @@ CheckVariable(FunctionCompiler &f, ParseNode *var) return f.failName(var, "var '%s' needs explicit type declaration via an initial value", name); if (initNode->isKind(PNK_CALL)) { - ParseNode *coercedVar = NULL; + ParseNode *coercedVar = nullptr; if (!CheckFloat32Coercion(f.m(), initNode, &coercedVar, "caller in var initializer can only be fround")) return false; @@ -3986,7 +3986,7 @@ static bool CheckCall(FunctionCompiler &f, ParseNode *call, RetType retType, MDe static bool CheckFRoundArg(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type, const char* error) { - ParseNode *arg = NULL; + ParseNode *arg = nullptr; if (!CheckFloat32Coercion(f.m(), expr, &arg, error)) return false; diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index aadb0519ce2..38a379fb839 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -2430,7 +2430,7 @@ JS_SetPrototype(JSContext *cx, JS::Handle obj, JS::Handle return false; if (!succeeded) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SETPROTOTYPEOF_FAIL); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL); return false; } diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 502e83315d1..1c5a2924efa 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -354,7 +354,7 @@ BaseProxyHandler::setPrototypeOf(JSContext *cx, HandleObject, HandleObject, bool // Disallow sets of protos on proxies with lazy protos, but no hook. // This keeps us away from the footgun of having the first proto set opt // you out of having dynamic protos altogether. - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SETPROTOTYPEOF_FAIL); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL); return false; } diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 7332e286efa..50700688f42 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -848,7 +848,7 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc /* see BytecodeEmitter::tellDebuggerAboutCompiledScript */ CallNewScriptHook(cx, script, fun); if (!fun) { - RootedGlobalObject global(cx, script->compileAndGo() ? &script->global() : NULL); + RootedGlobalObject global(cx, script->compileAndGo() ? &script->global() : nullptr); Debugger::onNewScript(cx, script, global); } } diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 3a0db52e578..7e7b4fb9ef6 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -665,7 +665,7 @@ bool SecurityWrapper::setPrototypeOf(JSContext *cx, HandleObject wrapper, HandleObject proto, bool *bp) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_UNWRAP_DENIED); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_UNWRAP_DENIED); return false; } diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index ce678939f2f..b62d678e410 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -153,7 +153,7 @@ ProtoSetterImpl(JSContext *cx, CallArgs args) return false; if (!success) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SETPROTOTYPEOF_FAIL); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL); return false; } diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index d5f5f5db9ac..c26f83fe743 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -1013,12 +1013,12 @@ public: dnsUUID.Assign(Substring(nsDependentCString(uuid), 1, NSID_LENGTH - 3)); // Create events for A and SRV resolvers - events[0] = CreateEvent(NULL, TRUE, FALSE, TEXT("FinishedA")); + events[0] = CreateEvent(nullptr, TRUE, FALSE, TEXT("FinishedA")); if (!events[0]) { goto library_cleanup; } - events[1] = CreateEvent(NULL, TRUE, FALSE, TEXT("FinishedSRV")); + events[1] = CreateEvent(nullptr, TRUE, FALSE, TEXT("FinishedSRV")); if (!events[1]) { goto aevent_cleanup; } diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index f202fbb4925..8a32245fb91 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -164,7 +164,7 @@ AndroidBridge::Init(JNIEnv *jEnv) mJNIEnv = nullptr; mThread = -1; - mGLControllerObj = NULL; + mGLControllerObj = nullptr; mOpenedGraphicsLibraries = false; mHasNativeBitmapAccess = false; mHasNativeWindowAccess = false; @@ -269,11 +269,11 @@ extern "C" { __attribute__ ((visibility("default"))) JNIEnv * GetJNIForThread() { - JNIEnv *jEnv = NULL; + JNIEnv *jEnv = nullptr; JavaVM *jVm = mozilla::AndroidBridge::GetVM(); if (!jVm) { __android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Returned a null VM"); - return NULL; + return nullptr; } jEnv = static_cast(PR_GetThreadPrivate(sJavaEnvThreadIndex)); @@ -283,10 +283,10 @@ extern "C" { int status = jVm->GetEnv((void**) &jEnv, JNI_VERSION_1_2); if (status) { - status = jVm->AttachCurrentThread(&jEnv, NULL); + status = jVm->AttachCurrentThread(&jEnv, nullptr); if (status) { __android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Could not attach"); - return NULL; + return nullptr; } PR_SetThreadPrivate(sJavaEnvThreadIndex, jEnv); @@ -304,7 +304,7 @@ void AutoGlobalWrappedJavaObject::Dispose() { } GetJNIForThread()->DeleteGlobalRef(wrapped_obj); - wrapped_obj = NULL; + wrapped_obj = nullptr; } AutoGlobalWrappedJavaObject::~AutoGlobalWrappedJavaObject() { @@ -694,7 +694,7 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj) void AndroidBridge::RegisterCompositor(JNIEnv *env) { - if (mGLControllerObj != NULL && !mGLControllerObj->isNull()) { + if (mGLControllerObj != nullptr && !mGLControllerObj->isNull()) { // we already have this set up, no need to do it again return; } diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp index 77db5c20a7a..cd58217aa93 100644 --- a/widget/android/AndroidJNI.cpp +++ b/widget/android/AndroidJNI.cpp @@ -911,7 +911,7 @@ Java_org_mozilla_gecko_gfx_NativePanZoomController_destroy(JNIEnv* env, jobject return; } - NativePanZoomController* oldRef = AndroidBridge::Bridge()->SetNativePanZoomController(NULL); + NativePanZoomController* oldRef = AndroidBridge::Bridge()->SetNativePanZoomController(nullptr); if (!oldRef || oldRef->isNull()) { MOZ_ASSERT(false, "Clearing a non-existent NPZC"); } else { diff --git a/widget/android/AndroidJavaWrappers.h b/widget/android/AndroidJavaWrappers.h index b07b9549151..9db4ef99122 100644 --- a/widget/android/AndroidJavaWrappers.h +++ b/widget/android/AndroidJavaWrappers.h @@ -67,10 +67,10 @@ private: class WrappedJavaObject { public: WrappedJavaObject() : - wrapped_obj(NULL) + wrapped_obj(nullptr) { } - WrappedJavaObject(jobject jobj) : wrapped_obj(NULL) { + WrappedJavaObject(jobject jobj) : wrapped_obj(nullptr) { Init(jobj); } @@ -79,7 +79,7 @@ public: } bool isNull() const { - return wrapped_obj == NULL; + return wrapped_obj == nullptr; } jobject wrappedObject() const { @@ -93,10 +93,10 @@ protected: class AutoGlobalWrappedJavaObject : protected WrappedJavaObject{ public: AutoGlobalWrappedJavaObject() : - wrapped_obj(NULL) + wrapped_obj(nullptr) { } - AutoGlobalWrappedJavaObject(jobject jobj, JNIEnv* env) : wrapped_obj(NULL) { + AutoGlobalWrappedJavaObject(jobject jobj, JNIEnv* env) : wrapped_obj(nullptr) { Init(jobj, env); } @@ -111,7 +111,7 @@ public: } bool isNull() const { - return wrapped_obj == NULL; + return wrapped_obj == nullptr; } jobject wrappedObject() const { diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 57f782f6b7a..d402e43d369 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -504,7 +504,7 @@ class nsIWidget : public nsISupports { /** * Create and initialize a widget. * - * All the arguments can be NULL in which case a top level window + * All the arguments can be null in which case a top level window * with size 0 is created. The event callback function has to be * provided only if the caller wants to deal with the events this * widget receives. The event callback is basically a preprocess diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 438667d79d4..59d333f9caf 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -212,7 +212,7 @@ GetKinfoVmentrySelf(int64_t* prss, uint64_t* maxreg) { int cnt; struct kinfo_vmentry *vmmap, *kve; - if ((vmmap = kinfo_getvmmap(getpid(), &cnt)) == NULL) + if ((vmmap = kinfo_getvmmap(getpid(), &cnt)) == nullptr) return NS_ERROR_FAILURE; if (prss) @@ -238,7 +238,7 @@ static nsresult PrivateDistinguishedAmount(int64_t* aN) { int64_t priv; - nsresult rv = GetKinfoVmentrySelf(&priv, NULL); + nsresult rv = GetKinfoVmentrySelf(&priv, nullptr); NS_ENSURE_SUCCESS(rv, rv); *aN = priv * getpagesize(); return NS_OK; @@ -249,7 +249,7 @@ static nsresult VsizeMaxContiguousDistinguishedAmount(int64_t* aN) { uint64_t biggestRegion; - nsresult rv = GetKinfoVmentrySelf(NULL, &biggestRegion); + nsresult rv = GetKinfoVmentrySelf(nullptr, &biggestRegion); if (NS_SUCCEEDED(rv)) *aN = biggestRegion;