Bug 784739 - Switch from NULL to nullptr in remaining directories; r=ehsan
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Mon, 06 Jan 2014 10:06:04 -0500
changeset 178198 7ebd1e1a81978681ebe38d5af517b568e4b46aee
parent 178197 0beea724bb11f7c3485549cbf8e86bf901fa3fb8
child 178199 5954f2857de4a9d9d39f147279e33b9691da3051
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 784739 - Switch from NULL to nullptr in remaining directories; r=ehsan
content/base/src/nsScriptLoader.cpp
content/media/fmp4/wmf/MFTDecoder.cpp
content/media/fmp4/wmf/WMFVideoDecoder.cpp
dom/bluetooth/bluedroid/BluetoothSocket.cpp
gfx/layers/Effects.h
gfx/layers/composite/ImageHost.h
gfx/layers/d3d9/CompositorD3D9.cpp
gfx/layers/d3d9/CompositorD3D9.h
gfx/layers/d3d9/DeviceManagerD3D9.cpp
gfx/layers/d3d9/TextureD3D9.cpp
gfx/src/nsRegion.h
gfx/thebes/gfxASurface.cpp
js/src/builtin/SIMD.cpp
js/src/builtin/TypeRepresentation.cpp
js/src/jit/AsmJS.cpp
js/src/jsapi.cpp
js/src/jsproxy.cpp
js/src/jsscript.cpp
js/src/jswrapper.cpp
js/src/vm/GlobalObject.cpp
netwerk/dns/nsHostResolver.cpp
widget/android/AndroidBridge.cpp
widget/android/AndroidJNI.cpp
widget/android/AndroidJavaWrappers.h
widget/nsIWidget.h
xpcom/base/nsMemoryReporterManager.cpp
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -719,17 +719,17 @@ class NotifyOffThreadScriptLoadCompleted
 {
   nsRefPtr<nsScriptLoadRequest> mRequest;
   nsRefPtr<nsScriptLoader> mLoader;
   void *mToken;
 
 public:
   NotifyOffThreadScriptLoadCompletedRunnable(nsScriptLoadRequest* aRequest,
                                              nsScriptLoader* aLoader)
-    : mRequest(aRequest), mLoader(aLoader), mToken(NULL)
+    : mRequest(aRequest), mLoader(aLoader), mToken(nullptr)
   {}
 
   void SetToken(void* aToken) {
     MOZ_ASSERT(aToken && !mToken);
     mToken = aToken;
   }
 
   NS_DECL_NSIRUNNABLE
--- a/content/media/fmp4/wmf/MFTDecoder.cpp
+++ b/content/media/fmp4/wmf/MFTDecoder.cpp
@@ -31,17 +31,17 @@ MFTDecoder::~MFTDecoder()
 }
 
 HRESULT
 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<void**>(static_cast<IMFTransform**>(byRef(mDecoder))));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   return S_OK;
 }
 
--- a/content/media/fmp4/wmf/WMFVideoDecoder.cpp
+++ b/content/media/fmp4/wmf/WMFVideoDecoder.cpp
@@ -240,17 +240,17 @@ WMFVideoDecoder::CreateBasicVideoFrame(I
   BYTE* data = nullptr;
   LONG stride = 0;
   RefPtr<IMF2DBuffer> twoDBuffer;
   hr = buffer->QueryInterface(static_cast<IMF2DBuffer**>(byRef(twoDBuffer)));
   if (SUCCEEDED(hr)) {
     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;
   }
 
   // YV12, planar format: [YYYY....][VVVV....][UUUU....]
   // i.e., Y, then V, then U.
   VideoData::YCbCrBuffer b;
 
--- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp
@@ -421,17 +421,17 @@ DroidSocketImpl::ReadMsg(int aFd, void *
     return 0;
   }
 
   NS_ENSURE_FALSE(ret < 0, -1);
   NS_ENSURE_FALSE(msg.msg_flags & (MSG_CTRUNC | MSG_OOB | MSG_ERRQUEUE), -1);
 
   // 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;
     }
     if (cmsgptr->cmsg_type == SCM_RIGHTS) {
       int *pDescriptors = (int *)CMSG_DATA(cmsgptr);
       // Overwrite fd with client fd
       mFd.reset(pDescriptors[0]);
       break;
--- a/gfx/layers/Effects.h
+++ b/gfx/layers/Effects.h
@@ -184,17 +184,17 @@ struct EffectSolidColor : public Effect
 
   virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
 
   gfx::Color mColor;
 };
 
 struct EffectChain
 {
-  EffectChain() : mLayerRef(NULL) {}
+  EffectChain() : mLayerRef(nullptr) {}
   explicit EffectChain(void* aLayerRef) : mLayerRef(aLayerRef) {}
 
   RefPtr<Effect> mPrimaryEffect;
   RefPtr<Effect> mSecondaryEffects[EFFECT_MAX_SECONDARY];
   void* mLayerRef; //!< For LayerScope logging
 };
 
 /**
--- a/gfx/layers/composite/ImageHost.h
+++ b/gfx/layers/composite/ImageHost.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_GFX_IMAGEHOST_H
 #define MOZILLA_GFX_IMAGEHOST_H
 
-#include <stdio.h>                      // for FILE, NULL
+#include <stdio.h>                      // for FILE
 #include "CompositableHost.h"           // for CompositableHost
 #include "mozilla/Attributes.h"         // for MOZ_OVERRIDE
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/gfx/Point.h"          // for Point
 #include "mozilla/gfx/Rect.h"           // for Rect
 #include "mozilla/gfx/Types.h"          // for Filter
 #include "mozilla/layers/CompositorTypes.h"  // for TextureInfo, etc
 #include "mozilla/layers/LayersSurfaces.h"  // for SurfaceDescriptor
@@ -65,19 +65,19 @@ public:
     mHasPictureRect = true;
   }
 
   virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
 
   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<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
 #endif
 
 protected:
 
   RefPtr<TextureHost> mFrontBuffer;
   nsIntRect mPictureRect;
--- a/gfx/layers/d3d9/CompositorD3D9.cpp
+++ b/gfx/layers/d3d9/CompositorD3D9.cpp
@@ -93,17 +93,17 @@ CompositorD3D9::CreateRenderTarget(const
   if (!mDeviceManager) {
     return nullptr;
   }
 
   RefPtr<IDirect3DTexture9> texture;
   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);
     return nullptr;
   }
 
   RefPtr<CompositingRenderTargetD3D9> rt =
     new CompositingRenderTargetD3D9(texture, aInit, aRect);
@@ -119,17 +119,17 @@ CompositorD3D9::CreateRenderTargetFromSo
   if (!mDeviceManager) {
     return nullptr;
   }
 
   RefPtr<IDirect3DTexture9> texture;
   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);
     return nullptr;
   }
 
   if (aSource) {
     nsRefPtr<IDirect3DSurface9> sourceSurface =
@@ -404,17 +404,17 @@ CompositorD3D9::DrawQuad(const gfx::Rect
       maskTexture = mDeviceManager->SetShaderMode(DeviceManagerD3D9::COMPONENTLAYERPASS2, maskType);
       d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
       d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
       d3d9Device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
 
       // Restore defaults
       d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
       d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
-      d3d9Device->SetTexture(1, NULL);
+      d3d9Device->SetTexture(1, nullptr);
     }
     return;
   default:
     NS_WARNING("Unknown shader type");
     return;
   }
 
   SetMask(aEffectChain, maskTexture);
@@ -565,17 +565,17 @@ CompositorD3D9::BeginFrame(const nsIntRe
                            Rect *aRenderBoundsOut)
 {
   MOZ_ASSERT(mDeviceManager && mSwapChain);
 
   mDeviceManager->SetupRenderState();
 
   EnsureSize();
 
-  device()->Clear(0, NULL, D3DCLEAR_TARGET, 0x00000000, 0, 0);
+  device()->Clear(0, nullptr, D3DCLEAR_TARGET, 0x00000000, 0, 0);
   device()->BeginScene();
 
   if (aClipRectOut) {
     *aClipRectOut = Rect(0, 0, mSize.width, mSize.height);
   }
   if (aRenderBoundsOut) {
     *aRenderBoundsOut = Rect(0, 0, mSize.width, mSize.height);
   }
@@ -682,22 +682,22 @@ CompositorD3D9::PaintToTarget()
   nsRefPtr<IDirect3DSurface9> destSurf;
   device()->GetRenderTarget(0, getter_AddRefs(backBuff));
 
   D3DSURFACE_DESC desc;
   backBuff->GetDesc(&desc);
 
   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<DataSourceSurface> sourceSurface =
     Factory::CreateWrappingDataSourceSurface((uint8_t*)rect.pBits,
                                              rect.Pitch,
                                              IntSize(desc.Width, desc.Height),
                                              FORMAT_B8G8R8A8);
   mTarget->CopySurface(sourceSurface,
                        IntRect(0, 0, desc.Width, desc.Height),
                        IntPoint());
--- a/gfx/layers/d3d9/CompositorD3D9.h
+++ b/gfx/layers/d3d9/CompositorD3D9.h
@@ -154,17 +154,17 @@ private:
 
   /* Swap chain associated with this compositor */
   nsRefPtr<SwapChainD3D9> mSwapChain;
 
   /* Widget associated with this layer manager */
   nsIWidget *mWidget;
 
   /*
-   * Context target, NULL when drawing directly to our swap chain.
+   * Context target, nullptr when drawing directly to our swap chain.
    */
   RefPtr<gfx::DrawTarget> mTarget;
 
   RefPtr<CompositingRenderTargetD3D9> mDefaultRT;
   RefPtr<CompositingRenderTargetD3D9> mCurrentRT;
 
   nsIntSize mSize;
 
--- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp
+++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp
@@ -150,17 +150,17 @@ SwapChainD3D9::Present(const nsIntRect &
   r.bottom = aRect.YMost();
 
   mSwapChain->Present(&r, &r, 0, 0, 0);
 }
 
 void
 SwapChainD3D9::Present()
 {
-  mSwapChain->Present(NULL, NULL, 0, 0, 0);
+  mSwapChain->Present(nullptr, nullptr, 0, 0, 0);
 }
 
 void
 SwapChainD3D9::Reset()
 {
   mSwapChain = nullptr;
 }
 
--- a/gfx/layers/d3d9/TextureD3D9.cpp
+++ b/gfx/layers/d3d9/TextureD3D9.cpp
@@ -179,17 +179,17 @@ TextureSourceD3D9::InitTextures(DeviceMa
 
   RefPtr<IDirect3DTexture9> tmpTexture =
     aDeviceManager->CreateTexture(aSize, aFormat, D3DPOOL_SYSTEMMEM, this);
   if (!tmpTexture) {
     return nullptr;
   }
 
   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;
   }
 
   return result;
 }
 
@@ -203,17 +203,18 @@ FinishTextures(DeviceManagerD3D9* aDevic
 {
   if (!aDeviceManager) {
     return;
   }
 
   aSurface->UnlockRect();
   nsRefPtr<IDirect3DSurface9> dstSurface;
   aTexture->GetSurfaceLevel(0, getter_AddRefs(dstSurface));
-  aDeviceManager->device()->UpdateSurface(aSurface, NULL, dstSurface, NULL);
+  aDeviceManager->device()->UpdateSurface(aSurface, nullptr, dstSurface,
+                                          nullptr);
 }
 
 TemporaryRef<IDirect3DTexture9>
 TextureSourceD3D9::DataToTexture(DeviceManagerD3D9* aDeviceManager,
                                  unsigned char *aData,
                                  int aStride,
                                  const IntSize &aSize,
                                  _D3DFORMAT aFormat,
--- a/gfx/src/nsRegion.h
+++ b/gfx/src/nsRegion.h
@@ -261,17 +261,17 @@ private:
     return *this;
   }
 
   nsRegion& Copy (const nsRect& aRect)
   {
     // 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);
     } else {
       pixman_box32_t box = RectToBox(aRect);
       pixman_region32_reset(&mImpl, &box);
     }
     return *this;
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -871,17 +871,17 @@ gfxASurface::WriteAsPNG_internal(FILE* a
     if (aFile) {
       fwrite(imgData, 1, imgSize, aFile);
     } else {
       NS_WARNING("Can't write binary image data without a file!");
     }
     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);
   if (NS_FAILED(rv)) // not sure why this would fail
     return;
 
   nsCString string("data:image/png;base64,");
   string.Append(encodedImg);
--- a/js/src/builtin/SIMD.cpp
+++ b/js/src/builtin/SIMD.cpp
@@ -73,25 +73,25 @@ struct Int32x4 {
 };
 } // namespace js
 
 #define LANE_ACCESSOR(Type32x4, lane) \
     bool Type32x4##Lane##lane(JSContext *cx, unsigned argc, Value *vp) { \
         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; \
         } \
         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; \
         } \
         Type32x4::Elem *data = reinterpret_cast<Type32x4::Elem *>(datum.typedMem()); \
         Type32x4::setReturn(args, data[lane]); \
         return true; \
     }
@@ -104,25 +104,25 @@ struct Int32x4 {
     LANE_ACCESSOR(Int32x4, 2);
     LANE_ACCESSOR(Int32x4, 3);
 #undef LANE_ACCESSOR
 
 #define SIGN_MASK(Type32x4) \
     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; \
         } \
         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; \
         } \
         Type32x4::Elem *data = reinterpret_cast<Type32x4::Elem *>(datum.typedMem()); \
         int32_t mx = data[0] < 0.0 ? 1 : 0; \
         int32_t my = data[1] < 0.0 ? 1 : 0; \
         int32_t mz = data[2] < 0.0 ? 1 : 0; \
--- a/js/src/builtin/TypeRepresentation.cpp
+++ b/js/src/builtin/TypeRepresentation.cpp
@@ -776,17 +776,17 @@ SizedArrayTypeRepresentation::appendStri
     SizedTypeRepresentation *elementType = element();
     while (elementType->isSizedArray())
         elementType = elementType->asSizedArray()->element();
     if (!elementType->appendString(cx, contents))
         return false;
 
     contents.append(".array(");
     SizedArrayTypeRepresentation *arrayType = this;
-    while (arrayType != NULL) {
+    while (arrayType != nullptr) {
         if (!NumberValueToStringBuffer(cx, NumberValue(length()), contents))
             return false;
 
         if (arrayType->element()->isSizedArray()) {
             if (!contents.append(","))
                 return false;
             arrayType = arrayType->element()->asSizedArray();
         } else {
--- a/js/src/jit/AsmJS.cpp
+++ b/js/src/jit/AsmJS.cpp
@@ -2073,17 +2073,17 @@ class FunctionCompiler
         MConstant *constant = MConstant::New(alloc(), v);
         curBlock_->add(constant);
         return constant;
     }
 
     MDefinition *constantFloat(float f)
     {
         if (!curBlock_)
-            return NULL;
+            return nullptr;
 
         MConstant *constant = MConstant::NewAsmJS(alloc(), DoubleValue(double(f)), MIRType_Float32);
         curBlock_->add(constant);
         return constant;
     }
 
     template <class T>
     MDefinition *unary(MDefinition *op)
@@ -3037,17 +3037,17 @@ CheckGlobalVariableInitImport(ModuleComp
         return false;
     return CheckGlobalVariableImportExpr(m, varName, coercion, coercedExpr, isConst);
 }
 
 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;
 
     if (IsNumericLiteral(arg)) {
         double value;
         if (!ExtractFRoundableLiteral(arg, &value))
             return m.fail(arg, "float global initializer needs to be a double literal");
         return m.addGlobalVarInitConstant(varName, VarType::Float, DoubleValue(value), isConst);
@@ -3300,17 +3300,17 @@ CheckVariable(FunctionCompiler &f, Parse
     if (!CheckIdentifier(f.m(), var, name))
         return false;
 
     ParseNode *initNode = MaybeDefinitionInitializer(var);
     if (!initNode)
         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;
 
         double value;
         if (!ExtractFRoundableLiteral(coercedVar, &value))
             return f.failName(coercedVar, "float initializer for '%s' needs to be a double literal", name);
 
         return f.addVariable(var, name, VarType::Float, DoubleValue(value));
@@ -3981,17 +3981,17 @@ CheckFFICall(FunctionCompiler &f, ParseN
     return true;
 }
 
 static bool CheckCall(FunctionCompiler &f, ParseNode *call, RetType retType, MDefinition **def, Type *type);
 
 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;
 
     if (arg->isKind(PNK_CALL))
         return CheckCall(f, arg, RetType::Float, def, type);
 
     if (IsNumericLiteral(arg)) {
         double value;
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2425,17 +2425,17 @@ JS_SetPrototype(JSContext *cx, JS::Handl
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, proto);
 
     bool succeeded;
     if (!JSObject::setProto(cx, obj, proto, &succeeded))
         return false;
 
     if (!succeeded) {
-        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SETPROTOTYPEOF_FAIL);
+        JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL);
         return false;
     }
 
     return true;
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_GetParent(JSObject *obj)
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -349,17 +349,17 @@ BaseProxyHandler::getPrototypeOf(JSConte
 }
 
 bool
 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;
 }
 
 bool
 BaseProxyHandler::watch(JSContext *cx, HandleObject proxy, HandleId id, HandleObject callable)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_WATCH,
                          proxy->getClass()->name);
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -843,17 +843,17 @@ js::XDRScript(XDRState<mode> *xdr, Handl
     }
 
     if (mode == XDR_DECODE) {
         scriptp.set(script);
 
         /* 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);
         }
     }
 
     return true;
 }
 
 template bool
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -660,17 +660,17 @@ SecurityWrapper<Base>::nativeCall(JSCont
     return false;
 }
 
 template <class Base>
 bool
 SecurityWrapper<Base>::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;
 }
 
 // For security wrappers, we run the DefaultValue algorithm on the wrapper
 // itself, which means that the existing security policy on operations like
 // toString() will take effect and do the right thing here.
 template <class Base>
 bool
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -148,17 +148,17 @@ ProtoSetterImpl(JSContext *cx, CallArgs 
     if (!CheckAccess(cx, obj, nid, JSAccessMode(JSACC_PROTO | JSACC_WRITE), &v, &dummy))
         return false;
 
     bool success;
     if (!JSObject::setProto(cx, obj, newProto, &success))
         return false;
 
     if (!success) {
-        JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_SETPROTOTYPEOF_FAIL);
+        JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL);
         return false;
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -1008,22 +1008,22 @@ public:
         }
         rv = uuidgen->GenerateUUIDInPlace(&id);
         NS_ENSURE_SUCCESS(rv, NS_OK);
         id.ToProvidedString(uuid);
         // Strip off the { and } surrounding the UUID string
         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;
         }
 
         // dispatch A resolver
         mResolveAThread->Dispatch(new ExperimentResolver(DNS_TYPE_A,
                                                          dnsUUID,
                                                          &events[0],
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -159,17 +159,17 @@ AndroidBridge::Init(JNIEnv *jEnv)
 {
     ALOG_BRIDGE("AndroidBridge::Init");
     jEnv->GetJavaVM(&mJavaVM);
 
     AutoLocalJNIFrame jniFrame(jEnv);
 
     mJNIEnv = nullptr;
     mThread = -1;
-    mGLControllerObj = NULL;
+    mGLControllerObj = nullptr;
     mOpenedGraphicsLibraries = false;
     mHasNativeBitmapAccess = false;
     mHasNativeWindowAccess = false;
     mHasNativeWindowFallback = false;
 
     initInit();
 
 #ifdef MOZ_WEBSMS_BACKEND
@@ -264,34 +264,34 @@ jstring AndroidBridge::NewJavaString(Aut
 jstring AndroidBridge::NewJavaString(AutoLocalJNIFrame* frame, const nsACString& string) {
     return NewJavaString(frame, NS_ConvertUTF8toUTF16(string));
 }
 
 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<JNIEnv*>(PR_GetThreadPrivate(sJavaEnvThreadIndex));
 
         if (jEnv)
             return jEnv;
 
         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);
         }
         if (!jEnv) {
             __android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "returning NULL");
         }
         return jEnv;
@@ -299,17 +299,17 @@ extern "C" {
 }
 
 void AutoGlobalWrappedJavaObject::Dispose() {
     if (isNull()) {
         return;
     }
 
     GetJNIForThread()->DeleteGlobalRef(wrapped_obj);
-    wrapped_obj = NULL;
+    wrapped_obj = nullptr;
 }
 
 AutoGlobalWrappedJavaObject::~AutoGlobalWrappedJavaObject() {
     Dispose();
 }
 
 static void
 getHandlersFromStringArray(JNIEnv *aJNIEnv, jobjectArray jArr, jsize aLen,
@@ -689,17 +689,17 @@ AndroidBridge::SetLayerClient(JNIEnv* en
         // and we do that by setting the first-paint flag.
         nsWindow::ForceIsFirstPaint();
     }
 }
 
 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;
     }
 
     jobject glController = LayerView::RegisterCompositorWrapper();
     if (!glController) {
         return;
     }
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -906,17 +906,17 @@ Java_org_mozilla_gecko_gfx_NativePanZoom
 
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_destroy(JNIEnv* env, jobject instance)
 {
     if (!AndroidBridge::Bridge()) {
         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 {
         delete oldRef;
     }
 }
 
 NS_EXPORT void JNICALL
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -62,61 +62,61 @@ public:
 private:
     int32_t mRefCnt;
     jobject mObject;
 };
 
 class WrappedJavaObject {
 public:
     WrappedJavaObject() :
-        wrapped_obj(NULL)
+        wrapped_obj(nullptr)
     { }
 
-    WrappedJavaObject(jobject jobj) : wrapped_obj(NULL) {
+    WrappedJavaObject(jobject jobj) : wrapped_obj(nullptr) {
         Init(jobj);
     }
 
     void Init(jobject jobj) {
         wrapped_obj = jobj;
     }
 
     bool isNull() const {
-        return wrapped_obj == NULL;
+        return wrapped_obj == nullptr;
     }
 
     jobject wrappedObject() const {
         return wrapped_obj;
     }
 
 protected:
     jobject wrapped_obj;
 };
 
 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);
     }
 
     virtual ~AutoGlobalWrappedJavaObject();
     void Dispose();
 
     void Init(jobject jobj, JNIEnv* env) {
         if (!isNull()) {
             env->DeleteGlobalRef(wrapped_obj);
         }
         wrapped_obj = env->NewGlobalRef(jobj);
     }
 
     bool isNull() const {
-        return wrapped_obj == NULL;
+        return wrapped_obj == nullptr;
     }
 
     jobject wrappedObject() const {
         return wrapped_obj;
     }
 
 protected:
     jobject wrapped_obj;
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -499,17 +499,17 @@ class nsIWidget : public nsISupports {
     {
       ClearNativeTouchSequence();
     }
 
         
     /**
      * 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
      * hook called synchronously. The return value determines whether
      * the event goes to the default window procedure or it is hidden
      * to the os. The assumption is that if the event handler returns
      * false the widget does not see the event. The widget should not 
      * automatically clear the window to the background color. The 
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -207,17 +207,17 @@ ResidentFastDistinguishedAmount(int64_t*
 #include <libutil.h>
 #include <algorithm>
 
 static nsresult
 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)
         *prss = 0;
     if (maxreg)
         *maxreg = 0;
 
     for (int i = 0; i < cnt; i++) {
@@ -233,28 +233,28 @@ GetKinfoVmentrySelf(int64_t* prss, uint6
     return NS_OK;
 }
 
 #define HAVE_PRIVATE_REPORTER
 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;
 }
 
 #define HAVE_VSIZE_MAX_CONTIGUOUS_REPORTER 1
 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;
 
     return NS_OK;
 }
 #endif // FreeBSD
 
 #elif defined(SOLARIS)