Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Wed, 23 Oct 2013 16:36:09 -0400
changeset 166671 58652b0ac86e0ed7ebe912feb74e913a2f37fdaf
parent 166670 e2540bc9686eefabcbae0435ebad45455510c0af
child 166672 b7c32ea628e2baf668ba863fbee02ca606ce9af1
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone27.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 miscellaneous directories; r=ehsan
browser/metro/shell/commandexecutehandler/CEHHelper.cpp
browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
config/asencode.cpp
ipc/glue/MessageLink.cpp
ipc/keystore/KeyStore.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
layout/build/nsLayoutModule.cpp
mobile/android/components/build/nsAndroidHistory.cpp
mobile/android/components/build/nsBrowserModule.cpp
netwerk/build/nsNetModule.cpp
netwerk/protocol/http/SpdySession31.cpp
storage/src/mozStorageConnection.cpp
toolkit/components/build/nsToolkitCompsModule.cpp
uriloader/exthandler/nsContentHandlerApp.cpp
uriloader/exthandler/nsDBusHandlerApp.cpp
uriloader/exthandler/win/nsMIMEInfoWin.cpp
uriloader/exthandler/win/nsOSHelperAppService.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
webapprt/gtk2/webapprt.cpp
webapprt/win/webapprt.cpp
xpfe/appshell/src/nsAppShellFactory.cpp
xpfe/components/build/nsModule.cpp
xpfe/components/windowds/nsWindowDataSource.cpp
xulrunner/app/nsXULRunnerApp.cpp
xulrunner/examples/simple/components/src/SimpleTest.cpp
xulrunner/stub/nsXULStub.cpp
xulrunner/tools/redit/redit.cpp
--- a/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
+++ b/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
@@ -82,17 +82,17 @@ IsImmersiveProcessDynamic(HANDLE process
 
 bool
 IsImmersiveProcessRunning(const wchar_t *processName)
 {
   bool exists = false;
   PROCESSENTRY32W entry;
   entry.dwSize = sizeof(PROCESSENTRY32W);
 
-  HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
+  HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
 
   if (Process32First(snapshot, &entry)) {
     while (!exists && Process32Next(snapshot, &entry)) {
       if (!_wcsicmp(entry.szExeFile, processName)) {
         HANDLE process = OpenProcess(GENERIC_READ, FALSE, entry.th32ProcessID);
         if (IsImmersiveProcessDynamic(process)) {
           exists = true;
         }
--- a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
+++ b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
@@ -625,17 +625,18 @@ public:
   ~AutoSetRequestMet() { if (mFlag) *mFlag = true; }
 private:
   bool* mFlag;
 };
 
 static HRESULT
 PrepareActivationManager(CComPtr<IApplicationActivationManager> &activateMgr)
 {
-  HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER);
+  HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager,
+                                            nullptr, CLSCTX_LOCAL_SERVER);
   if (FAILED(hr)) {
     Log(L"CoCreateInstance failed, launching on desktop.");
     return E_FAIL;
   }
 
   // Hand off focus rights to the out-of-process activation server. Without
   // this the metro interface won't launch.
   hr = CoAllowSetForegroundWindow(activateMgr, nullptr);
@@ -649,17 +650,17 @@ PrepareActivationManager(CComPtr<IApplic
 
 DWORD WINAPI
 DelayedExecuteThread(LPVOID param)
 {
   Log(L"Starting delayed execute thread...");
   bool &bRequestMet(*(bool*)param);
   AutoSetRequestMet asrm(&bRequestMet);
 
-  CoInitialize(NULL);
+  CoInitialize(nullptr);
 
   CComPtr<IApplicationActivationManager> activateMgr;
   if (FAILED(PrepareActivationManager(activateMgr))) {
       Log(L"Warning: Could not prepare activation manager");
   }
 
   size_t currentWaitTime = 0;
   while(currentWaitTime < RESTART_WAIT_TIMEOUT) {
@@ -693,17 +694,18 @@ IFACEMETHODIMP CExecuteCommandVerb::Exec
 
   if (!mTarget.GetLength()) {
     // We shut down when this flips to true
     mRequestMet = true;
     return E_FAIL;
   }
 
   if (mIsRestartMetroRequest) {
-    HANDLE thread = CreateThread(NULL, 0, DelayedExecuteThread, &mRequestMet, 0, NULL);
+    HANDLE thread = CreateThread(nullptr, 0, DelayedExecuteThread,
+                                 &mRequestMet, 0, nullptr);
     CloseHandle(thread);
     return S_OK;
   }
 
   // We shut down when this flips to true
   AutoSetRequestMet asrm(&mRequestMet);
 
   // Launch on the desktop
--- a/config/asencode.cpp
+++ b/config/asencode.cpp
@@ -35,17 +35,17 @@ typedef struct ASFinderInfo
   } while (0)
 
 // encodes a file with data and resource forks into a single
 // AppleSingle encoded file..
 
 static void append_file(FILE* output, const char* input_name)
 {
   FILE* input = fopen(input_name, "rb");
-  EXIT_IF_FALSE(input != NULL);
+  EXIT_IF_FALSE(input != nullptr);
 
   while (1) {
     char buffer[4096];
     size_t amount = fread(buffer, 1, sizeof(buffer), input);
     if (amount == 0) {
       EXIT_IF_FALSE(feof(input) != 0);
       break;
     }
@@ -82,17 +82,17 @@ int main(int argc, char** argv)
   EXIT_IF_FALSE(stat(rez_name, &rez_st) == 0);
 
   if (rez_st.st_size == 0) {
     printf("%s: no resource fork found on file `%s'\n", argv[0], argv[1]);
     exit(4);
   }
 
   FILE* output = fopen(argv[2], "wb");
-  if (output == NULL) {
+  if (output == nullptr) {
     printf("%s: can't open file `%s'\n", argv[0], argv[2]);
     exit(5);
   }
 
   struct header {
     int magic_number;
     int version_number;
     char filler[16];
@@ -172,17 +172,17 @@ int main(int argc, char** argv)
 
   FSRef fsref;
   EXIT_IF_FALSE(FSPathMakeRef((unsigned char *)abs_input_name, &fsref, 0) == 0);
 
   FSCatalogInfo cat_info;
   memset(&cat_info, 0, sizeof(cat_info));
   EXIT_IF_FALSE(FSGetCatalogInfo(&fsref,
                                  kFSCatInfoGettableInfo,
-                                 &cat_info, NULL, NULL, NULL) == 0);
+                                 &cat_info, nullptr, nullptr, nullptr) == 0);
 
   ASFinderInfo finder_info;
   memcpy(&finder_info.ioFlFndrInfo, &cat_info.finderInfo,
          sizeof(finder_info.ioFlFndrInfo));
   memcpy(&finder_info.ioFlXFndrInfo, &cat_info.extFinderInfo,
          sizeof(finder_info.ioFlXFndrInfo));
 
   EXIT_IF_FALSE(fwrite(&finder_info, 1, sizeof(finder_info), output) ==
--- a/ipc/glue/MessageLink.cpp
+++ b/ipc/glue/MessageLink.cpp
@@ -53,17 +53,17 @@ MessageLink::MessageLink(MessageChannel 
 
 MessageLink::~MessageLink()
 {
     mChan = nullptr;
 }
 
 ProcessLink::ProcessLink(MessageChannel *aChan)
   : MessageLink(aChan),
-    mExistingListener(NULL)
+    mExistingListener(nullptr)
 {
 }
 
 ProcessLink::~ProcessLink()
 {
     mIOLoop = 0;
     if (mTransport) {
         mTransport->set_listener(0);
--- a/ipc/keystore/KeyStore.cpp
+++ b/ipc/keystore/KeyStore.cpp
@@ -117,17 +117,17 @@ KeyStore::Listen()
 }
 
 void
 KeyStore::ResetHandlerInfo()
 {
   mHandlerInfo.state = STATE_IDLE;
   mHandlerInfo.command = 0;
   mHandlerInfo.paramCount = 0;
-  mHandlerInfo.commandPattern = NULL;
+  mHandlerInfo.commandPattern = nullptr;
   for (int i = 0; i < MAX_PARAM; i++) {
     mHandlerInfo.param[i].length = 0;
     memset(mHandlerInfo.param[i].data, 0, VALUE_SIZE);
   }
 }
 
 bool
 KeyStore::CheckSize(UnixSocketRawData *aMessage, size_t aExpectSize)
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -979,17 +979,17 @@ mozJSComponentLoader::ObjectForLocation(
     mThisObjects.Put(tableScript, obj);
     bool ok = false;
 
     {
         AutoSaveContextOptions asco(cx);
         if (aPropagateExceptions)
             ContextOptionsRef(cx).setDontReportUncaught(true);
         if (script) {
-            ok = JS_ExecuteScriptVersion(cx, obj, script, NULL, JSVERSION_LATEST);
+            ok = JS_ExecuteScriptVersion(cx, obj, script, nullptr, JSVERSION_LATEST);
         } else {
             jsval rval;
             ok = JS_CallFunction(cx, obj, function, 0, nullptr, &rval);
         }
      }
 
     if (!ok) {
         if (aPropagateExceptions) {
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -1094,17 +1094,17 @@ static const mozilla::Module::CIDEntry k
   { &kMOBILE_MESSAGE_DATABASE_SERVICE_CID, false, nullptr, nsIMobileMessageDatabaseServiceConstructor },
   { &kNS_POWERMANAGERSERVICE_CID, false, nullptr, nsIPowerManagerServiceConstructor },
   { &kOSFILECONSTANTSSERVICE_CID, true, nullptr, OSFileConstantsServiceConstructor },
   { &kNS_ALARMHALSERVICE_CID, false, nullptr, nsIAlarmHalServiceConstructor },
   { &kTCPSOCKETCHILD_CID, false, nullptr, TCPSocketChildConstructor },
   { &kTCPSOCKETPARENT_CID, false, nullptr, TCPSocketParentConstructor },
   { &kTCPSERVERSOCKETCHILD_CID, false, nullptr, TCPServerSocketChildConstructor },
   { &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor },
-  { &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, NULL, nsIStreamingProtocolControllerServiceConstructor },
+  { &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor },
 #ifdef MOZ_WIDGET_GONK
   { &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor },
 #endif
   { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
 #ifdef MOZ_GAMEPAD
   { &kNS_GAMEPAD_TEST_CID, false, nullptr, GamepadServiceTestConstructor },
 #endif
 #ifdef ACCESSIBILITY
--- a/mobile/android/components/build/nsAndroidHistory.cpp
+++ b/mobile/android/components/build/nsAndroidHistory.cpp
@@ -8,17 +8,17 @@
 #include "Link.h"
 #include "nsIURI.h"
 
 using namespace mozilla;
 using mozilla::dom::Link;
 
 NS_IMPL_ISUPPORTS2(nsAndroidHistory, IHistory, nsIRunnable)
 
-nsAndroidHistory* nsAndroidHistory::sHistory = NULL;
+nsAndroidHistory* nsAndroidHistory::sHistory = nullptr;
 
 /*static*/
 nsAndroidHistory*
 nsAndroidHistory::GetSingleton()
 {
   if (!sHistory) {
     sHistory = new nsAndroidHistory();
     NS_ENSURE_TRUE(sHistory, nullptr);
--- a/mobile/android/components/build/nsBrowserModule.cpp
+++ b/mobile/android/components/build/nsBrowserModule.cpp
@@ -18,29 +18,29 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsShellSe
 NS_DEFINE_NAMED_CID(nsShellService_CID);
 
 #ifdef MOZ_ANDROID_HISTORY
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAndroidHistory, nsAndroidHistory::GetSingleton)
 NS_DEFINE_NAMED_CID(NS_ANDROIDHISTORY_CID);
 #endif
 
 static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
-  { &knsShellService_CID, false, NULL, nsShellServiceConstructor },
+  { &knsShellService_CID, false, nullptr, nsShellServiceConstructor },
 #ifdef MOZ_ANDROID_HISTORY
-  { &kNS_ANDROIDHISTORY_CID, false, NULL, nsAndroidHistoryConstructor },
+  { &kNS_ANDROIDHISTORY_CID, false, nullptr, nsAndroidHistoryConstructor },
 #endif
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
   { nsShellService_ContractID, &knsShellService_CID },
 #ifdef MOZ_ANDROID_HISTORY
   { NS_IHISTORY_CONTRACTID, &kNS_ANDROIDHISTORY_CID },
 #endif
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kBrowserModule = {
   mozilla::Module::kVersion,
   kBrowserCIDs,
   kBrowserContracts
 };
 
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -931,17 +931,17 @@ static const mozilla::Module::CIDEntry k
 #endif
 #ifdef NECKO_PROTOCOL_websocket
     { &kNS_WEBSOCKETPROTOCOLHANDLER_CID, false, nullptr,
       mozilla::net::WebSocketChannelConstructor },
     { &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID, false, nullptr,
       mozilla::net::WebSocketSSLChannelConstructor },
 #endif
 #ifdef MOZ_RTSP
-    { &kNS_RTSPPROTOCOLHANDLER_CID, false, NULL, mozilla::net::RtspHandlerConstructor },
+    { &kNS_RTSPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::RtspHandlerConstructor },
 #endif
 #if defined(XP_WIN)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
 #elif defined(MOZ_WIDGET_COCOA)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNetworkLinkServiceConstructor },
 #elif defined(MOZ_ENABLE_QTNETWORK)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsQtNetworkLinkServiceConstructor },
 #elif defined(MOZ_WIDGET_ANDROID)
--- a/netwerk/protocol/http/SpdySession31.cpp
+++ b/netwerk/protocol/http/SpdySession31.cpp
@@ -2711,17 +2711,17 @@ SpdySession31::Available()
 
 nsHttpRequestHead *
 SpdySession31::RequestHead()
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(false,
              "SpdySession31::RequestHead() "
              "should not be called after SPDY is setup");
-  return NULL;
+  return nullptr;
 }
 
 uint32_t
 SpdySession31::Http1xTransactionCount()
 {
   return 0;
 }
 
--- a/storage/src/mozStorageConnection.cpp
+++ b/storage/src/mozStorageConnection.cpp
@@ -831,17 +831,17 @@ Connection::internalClose()
   // unfinalized client statements, in which case we need to finalize
   // these statements and close again.
 
   int srv = sqlite3_close(mDBConn);
 
   if (srv == SQLITE_BUSY) {
     // We still have non-finalized statements. Finalize them.
 
-    sqlite3_stmt *stmt = NULL;
+    sqlite3_stmt *stmt = nullptr;
     while ((stmt = ::sqlite3_next_stmt(mDBConn, stmt))) {
       PR_LOG(gStorageLog, PR_LOG_NOTICE,
              ("Auto-finalizing SQL statement '%s' (%x)",
               ::sqlite3_sql(stmt),
               stmt));
 
 #ifdef DEBUG
       char *msg = ::PR_smprintf("SQL statement '%s' (%x) should have been finalized before closing the connection",
@@ -861,17 +861,17 @@ Connection::internalClose()
         NS_WARNING(msg);
         ::PR_smprintf_free(msg);
       }
 #endif // DEBUG
 
       // Ensure that the loop continues properly, whether closing has succeeded
       // or not.
       if (srv == SQLITE_OK) {
-        stmt = NULL;
+        stmt = nullptr;
       }
     }
 
     // Now that all statements have been finalized, we
     // shoudl be able to close.
     srv = ::sqlite3_close(mDBConn);
 
   }
--- a/toolkit/components/build/nsToolkitCompsModule.cpp
+++ b/toolkit/components/build/nsToolkitCompsModule.cpp
@@ -132,17 +132,17 @@ static const mozilla::Module::CIDEntry k
   { &kNS_URLCLASSIFIERSTREAMUPDATER_CID, false, nullptr, nsUrlClassifierStreamUpdaterConstructor },
   { &kNS_URLCLASSIFIERUTILS_CID, false, nullptr, nsUrlClassifierUtilsConstructor },
 #endif
   { &kNS_BROWSERSTATUSFILTER_CID, false, nullptr, nsBrowserStatusFilterConstructor },
   { &kNS_CHARSETMENU_CID, false, nullptr, NS_NewCharsetMenu },
 #if defined(USE_MOZ_UPDATER)
   { &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor },
 #endif
-  { &kFINALIZATIONWITNESSSERVICE_CID, false, NULL, FinalizationWitnessServiceConstructor },
+  { &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kToolkitContracts[] = {
   { NS_APPSTARTUP_CONTRACTID, &kNS_TOOLKIT_APPSTARTUP_CID },
   { NS_USERINFO_CONTRACTID, &kNS_USERINFO_CID },
   { NS_ALERTSERVICE_CONTRACTID, &kNS_ALERTSSERVICE_CID },
 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
--- a/uriloader/exthandler/nsContentHandlerApp.cpp
+++ b/uriloader/exthandler/nsContentHandlerApp.cpp
@@ -8,17 +8,17 @@
 #include "nsIURI.h"
 #include "nsIClassInfoImpl.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
 #define NS_CONTENTHANDLER_CID \
 { 0x43ec2c82, 0xb9db, 0x4835, {0x80, 0x3f, 0x64, 0xc9, 0x72, 0x5a, 0x70, 0x28 } }
 
-NS_IMPL_CLASSINFO(nsContentHandlerApp, NULL, 0, NS_CONTENTHANDLER_CID)
+NS_IMPL_CLASSINFO(nsContentHandlerApp, nullptr, 0, NS_CONTENTHANDLER_CID)
 NS_IMPL_ISUPPORTS1_CI(nsContentHandlerApp, nsIHandlerApp)
 
 nsContentHandlerApp::nsContentHandlerApp(nsString aName, nsCString aType,
                                          ContentAction::Action& aAction) :
   mName(aName),
   mType(aType),
   mAction(aAction)
 {
--- a/uriloader/exthandler/nsDBusHandlerApp.cpp
+++ b/uriloader/exthandler/nsDBusHandlerApp.cpp
@@ -8,17 +8,17 @@
 #include "nsDBusHandlerApp.h"
 #include "nsIURI.h"
 #include "nsIClassInfoImpl.h"
 #include "nsCOMPtr.h"
 #include "nsCExternalHandlerService.h"
 
 // XXX why does nsMIMEInfoImpl have a threadsafe nsISupports?  do we need one 
 // here too?
-NS_IMPL_CLASSINFO(nsDBusHandlerApp, NULL, 0, NS_DBUSHANDLERAPP_CID)
+NS_IMPL_CLASSINFO(nsDBusHandlerApp, nullptr, 0, NS_DBUSHANDLERAPP_CID)
 NS_IMPL_ISUPPORTS2_CI(nsDBusHandlerApp, nsIDBusHandlerApp, nsIHandlerApp)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIHandlerApp
 
 NS_IMETHODIMP nsDBusHandlerApp::GetName(nsAString& aName)
 {
   aName.Assign(mName);
@@ -107,22 +107,22 @@ nsDBusHandlerApp::LaunchWithURI(nsIURI *
     return NS_ERROR_FAILURE;
   }
   dbus_message_set_no_reply(msg, true);
   
   DBusMessageIter iter;
   dbus_message_iter_init_append(msg, &iter);
   dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &uri);
   
-  if (dbus_connection_send(connection, msg, NULL)) {
+  if (dbus_connection_send(connection, msg, nullptr)) {
     dbus_connection_flush(connection);
     dbus_message_unref(msg);
   } else {
     dbus_message_unref(msg);
-    return NS_ERROR_FAILURE;		    
+    return NS_ERROR_FAILURE;
   }
   return NS_OK;
   
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIDBusHandlerApp
 
--- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp
+++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp
@@ -92,21 +92,21 @@ nsMIMEInfoWin::LaunchWithFile(nsIFile* a
           return NS_ERROR_FILE_NOT_FOUND;
         }
         lstrcatW(rundll32Path, RUNDLL32_EXE);
 
         SHELLEXECUTEINFOW seinfo;
         memset(&seinfo, 0, sizeof(seinfo));
         seinfo.cbSize = sizeof(SHELLEXECUTEINFOW);
         seinfo.fMask  = 0;
-        seinfo.hwnd   = NULL;
-        seinfo.lpVerb = NULL;
+        seinfo.hwnd   = nullptr;
+        seinfo.lpVerb = nullptr;
         seinfo.lpFile = rundll32Path;
         seinfo.lpParameters =  args.get();
-        seinfo.lpDirectory  = NULL;
+        seinfo.lpDirectory  = nullptr;
         seinfo.nShow  = SW_SHOWNORMAL;
         if (ShellExecuteExW(&seinfo))
           return NS_OK;
 
         switch ((LONG_PTR)seinfo.hInstApp) {
           case 0:
           case SE_ERR_OOM:
             return NS_ERROR_OUT_OF_MEMORY;
@@ -241,25 +241,26 @@ nsMIMEInfoWin::LoadUriInternal(nsIURI * 
     NS_ENSURE_SUCCESS(rv, rv);
 
     static const PRUnichar cmdVerb[] = L"open";
     SHELLEXECUTEINFOW sinfo;
     memset(&sinfo, 0, sizeof(sinfo));
     sinfo.cbSize   = sizeof(sinfo);
     sinfo.fMask    = SEE_MASK_FLAG_DDEWAIT |
       SEE_MASK_FLAG_NO_UI;
-    sinfo.hwnd     = NULL;
+    sinfo.hwnd     = nullptr;
     sinfo.lpVerb   = (LPWSTR)&cmdVerb;
     sinfo.nShow    = SW_SHOWNORMAL;
     
-    LPITEMIDLIST pidl = NULL;
+    LPITEMIDLIST pidl = nullptr;
     SFGAOF sfgao;
     
     // Bug 394974
-    if (SUCCEEDED(SHParseDisplayName(utf16Spec.get(),NULL, &pidl, 0, &sfgao))) {
+    if (SUCCEEDED(SHParseDisplayName(utf16Spec.get(), nullptr,
+                                     &pidl, 0, &sfgao))) {
       sinfo.lpIDList = pidl;
       sinfo.fMask |= SEE_MASK_INVOKEIDLIST;
     } else {
       // SHParseDisplayName failed. Bailing out as work around for
       // Microsoft Security Bulletin MS07-061
       rv = NS_ERROR_FAILURE;
     }
     if (NS_SUCCEEDED(rv)) {
@@ -508,17 +509,17 @@ void nsMIMEInfoWin::ProcessPath(nsCOMPtr
                                 nsTArray<nsString>& trackList,
                                 const nsAString& appFilesystemCommand)
 {
   nsAutoString lower(appFilesystemCommand);
   ToLowerCase(lower);
 
   // Don't include firefox.exe in the list
   WCHAR exe[MAX_PATH+1];
-  uint32_t len = GetModuleFileNameW(NULL, exe, MAX_PATH);
+  uint32_t len = GetModuleFileNameW(nullptr, exe, MAX_PATH);
   if (len < MAX_PATH && len != 0) {
     uint32_t index = lower.Find(exe);
     if (index != -1)
       return;
   }
 
   nsCOMPtr<nsILocalHandlerApp> aApp;
   if (!GetLocalHandlerApp(appFilesystemCommand, aApp))
--- a/uriloader/exthandler/win/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp
@@ -30,19 +30,20 @@ static nsresult GetExtensionFrom4xRegist
                                                nsString& aFileExtension);
 static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
                                                     nsString& aFileExtension);
 
 nsOSHelperAppService::nsOSHelperAppService() : 
   nsExternalHelperAppService()
   , mAppAssoc(nullptr)
 {
-  CoInitialize(NULL);
-  CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC,
-                   IID_IApplicationAssociationRegistration, (void**)&mAppAssoc);
+  CoInitialize(nullptr);
+  CoCreateInstance(CLSID_ApplicationAssociationRegistration, nullptr,
+                   CLSCTX_INPROC, IID_IApplicationAssociationRegistration,
+                   (void**)&mAppAssoc);
 }
 
 nsOSHelperAppService::~nsOSHelperAppService()
 {
   if (mAppAssoc)
     mAppAssoc->Release();
   mAppAssoc = nullptr;
   CoUninitialize();
@@ -136,17 +137,18 @@ nsresult nsOSHelperAppService::OSProtoco
     HKEY hKey;
     LONG err = ::RegOpenKeyExW(HKEY_CLASSES_ROOT,
                                NS_ConvertASCIItoUTF16(aProtocolScheme).get(),
                                0,
                                KEY_QUERY_VALUE,
                                &hKey);
     if (err == ERROR_SUCCESS)
     {
-      err = ::RegQueryValueExW(hKey, L"URL Protocol", NULL, NULL, NULL, NULL);
+      err = ::RegQueryValueExW(hKey, L"URL Protocol",
+                               nullptr, nullptr, nullptr, nullptr);
       *aHandlerExists = (err == ERROR_SUCCESS);
       // close the key
       ::RegCloseKey(hKey);
     }
   }
 
   return NS_OK;
 }
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -1326,17 +1326,17 @@ nsOfflineCacheUpdate::Init(nsIURI *aMani
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = cacheService->CreateApplicationCache(mGroupID,
                                                   getter_AddRefs(mApplicationCache));
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
     rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aDocumentURI,
-                                                             NULL,
+                                                             nullptr,
                                                              &mPinned);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mAppID = aAppID;
     mInBrowser = aInBrowser;
 
     mState = STATE_INITIALIZED;
     return NS_OK;
@@ -1378,17 +1378,17 @@ nsOfflineCacheUpdate::InitForUpdateCheck
     // also to compare the cached content hash value we have to set 'some'
     // app cache to write to on the channel.  Otherwise the cached version will
     // be used and no actual network request will be made.  We use the same
     // app cache here.  OpenChannel prevents caching in this case using
     // INHIBIT_CACHING load flag.
     mApplicationCache = mPreviousApplicationCache;
 
     rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aManifestURI,
-                                                             NULL,
+                                                             nullptr,
                                                              &mPinned);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mUpdateAvailableObserver = aObserver;
     mOnlyCheckUpdate = true;
 
     mState = STATE_INITIALIZED;
     return NS_OK;
@@ -1437,17 +1437,17 @@ nsOfflineCacheUpdate::InitPartial(nsIURI
     rv = mApplicationCache->GetManifestURI(getter_AddRefs(mManifestURI));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoCString groupID;
     rv = mApplicationCache->GetGroupID(groupID);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aDocumentURI,
-                                                             NULL,
+                                                             nullptr,
                                                              &mPinned);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mState = STATE_INITIALIZED;
     return NS_OK;
 }
 
 nsresult
@@ -2186,17 +2186,17 @@ EvictOneOfCacheGroups(nsIApplicationCach
         nsCOMPtr<nsIApplicationCache> cache;
         rv = cacheService->GetActiveCache(group_name, getter_AddRefs(cache));
         // Maybe someone in another thread or process have deleted it.
         if (NS_FAILED(rv) || !cache)
             continue;
 
         bool pinned;
         rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(uri,
-                                                                 NULL,
+                                                                 nullptr,
                                                                  &pinned);
         NS_ENSURE_SUCCESS(rv, rv);
 
         if (!pinned) {
             rv = cache->Discard();
             return NS_OK;
         }
     }
--- a/webapprt/gtk2/webapprt.cpp
+++ b/webapprt/gtk2/webapprt.cpp
@@ -65,17 +65,17 @@ void SetAllocatedString(const char *&str
   }
 }
 
 // Function to open a dialog box displaying the message provided
 void ErrorDialog(const char* message)
 {
   gtk_init(pargc, pargv);
 
-  GtkWidget* dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message);
+  GtkWidget* dialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message);
   gtk_window_set_title(GTK_WINDOW(dialog), "Error launching webapp");
   gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), false);
   gtk_dialog_run(GTK_DIALOG(dialog));
   gtk_widget_destroy(dialog);
 }
 
 // Function to get the parent dir of a file
 void GetDirFromPath(char* parentDir, char* filePath)
@@ -270,17 +270,17 @@ void RemoveApplication(nsINIParser& pars
   }
 
   char uninstallMsg[MAXPATHLEN];
   if (NS_SUCCEEDED(parser.GetString("Webapp", "UninstallMsg", uninstallMsg, MAXPATHLEN))) {
     /**
      * The only difference between libnotify.so.4 and libnotify.so.1 for these symbols
      * is that notify_notification_new takes three arguments in libnotify.so.4 and
      * four in libnotify.so.1.
-     * Passing the fourth argument as NULL is binary compatible.
+     * Passing the fourth argument as nullptr is binary compatible.
      */
     typedef void  (*notify_init_t)(const char*);
     typedef void* (*notify_notification_new_t)(const char*, const char*, const char*, const char*);
     typedef void  (*notify_notification_show_t)(void*, void**);
 
     void *handle = dlopen("libnotify.so.4", RTLD_LAZY);
     if (!handle) {
       handle = dlopen("libnotify.so.1", RTLD_LAZY);
@@ -293,19 +293,19 @@ void RemoveApplication(nsINIParser& pars
     notify_notification_show_t nn_show = (notify_notification_show_t)(uintptr_t)dlsym(handle, "notify_notification_show");
     if (!nn_init || !nn_new || !nn_show) {
       dlclose(handle);
       return;
     }
 
     nn_init(appName);
 
-    void* n = nn_new(uninstallMsg, NULL, "dialog-information", NULL);
+    void* n = nn_new(uninstallMsg, nullptr, "dialog-information", nullptr);
 
-    nn_show(n, NULL);
+    nn_show(n, nullptr);
 
     dlclose(handle);
   }
 }
 
 int main(int argc, char *argv[])
 {
   pargc = &argc;
--- a/webapprt/win/webapprt.cpp
+++ b/webapprt/win/webapprt.cpp
@@ -84,27 +84,27 @@ namespace {
 
   /**
    * A helper class for scope-guarding nsXREAppData.
    */
   class ScopedXREAppData
   {
     public:
       ScopedXREAppData()
-        : mAppData(NULL) { }
+        : mAppData(nullptr) { }
 
       nsresult
       create(nsIFile* aINIFile)
       {
         return XRE_CreateAppData(aINIFile, &mAppData);
       }
 
       ~ScopedXREAppData()
       {
-        if (NULL != mAppData) {
+        if (nullptr != mAppData) {
           XRE_FreeAppData(mAppData);
         }
       }
 
       nsXREAppData* const
       operator->()
       {
         return get();
@@ -130,17 +130,17 @@ namespace {
   Output(const wchar_t *fmt, ... )
   {
     va_list ap;
     va_start(ap, fmt);
 
     wchar_t msg[1024];
     _vsnwprintf_s(msg, _countof(msg), _countof(msg), fmt, ap);
 
-    MessageBoxW(NULL, msg, L"Web Runtime", MB_OK);
+    MessageBoxW(nullptr, msg, L"Web Runtime", MB_OK);
 
     va_end(ap);
   }
 
   void
   Output(const char *fmt, ... )
   {
     va_list ap;
@@ -194,23 +194,23 @@ namespace {
     STARTUPINFOW si;
     PROCESS_INFORMATION pi;
 
     ::ZeroMemory(&si, sizeof(si));
     si.cb = sizeof(si);
     ::ZeroMemory(&pi, sizeof(pi));
 
     if (!CreateProcessW(curExePath, // Module name
-                        NULL,       // Command line
-                        NULL,       // Process handle not inheritable
-                        NULL,       // Thread handle not inheritable
+                        nullptr,    // Command line
+                        nullptr,    // Process handle not inheritable
+                        nullptr,    // Thread handle not inheritable
                         FALSE,      // Set handle inheritance to FALSE
                         0,          // No creation flags
-                        NULL,       // Use parent's environment block
-                        NULL,       // Use parent's starting directory
+                        nullptr,    // Use parent's environment block
+                        nullptr,    // Use parent's starting directory
                         &si,
                         &pi)) {
       return false;
     }
 
     // Close process and thread handles.
     CloseHandle( pi.hProcess );
     CloseHandle( pi.hThread );
@@ -353,18 +353,18 @@ namespace {
       return false;
     }
 
     DWORD length = MAXPATHLEN * sizeof(wchar_t);
     // XXX: When Vista/XP64 become our minimum supported client, we can use
     //      RegGetValue instead
     if (ERROR_SUCCESS != RegQueryValueExW(key,
                                           L"Path",
-                                          NULL,
-                                          NULL,
+                                          nullptr,
+                                          nullptr,
                                           reinterpret_cast<BYTE*>(wideGreDir),
                                           &length)) {
       RegCloseKey(key);
       return false;
     };
     RegCloseKey(key);
 
     // According to this article, we need to write our own null terminator:
@@ -378,18 +378,18 @@ namespace {
     }
 
     if (0 == WideCharToMultiByte(CP_UTF8,
                                  0,
                                  wideGreDir,
                                  -1,
                                  firefoxDir,
                                  MAXPATHLEN,
-                                 NULL,
-                                 NULL)) {
+                                 nullptr,
+                                 nullptr)) {
       return false;
     }
 
     return true;
   }
 };
 
 
@@ -433,18 +433,18 @@ main(int argc, char* argv[])
 
   // Convert current directory to utf8 and stuff it in buffer
   if (0 == WideCharToMultiByte(CP_UTF8,
                                0,
                                wbuffer,
                                -1,
                                buffer,
                                MAXPATHLEN,
-                               NULL,
-                               NULL)) {
+                               nullptr,
+                               nullptr)) {
     Output("Application directory could not be processed.");
     return 255;
   }
 
   // Check if the runtime was executed with the "-profile" argument
   for (int i = 1; i < argc; i++) {
     if (!strcmp(argv[i], "-profile")) {
       isProfileOverridden = true;
--- a/xpfe/appshell/src/nsAppShellFactory.cpp
+++ b/xpfe/appshell/src/nsAppShellFactory.cpp
@@ -15,25 +15,25 @@
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init)
 
 NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID);
 
 static const mozilla::Module::CIDEntry kAppShellCIDs[] = {
-  { &kNS_APPSHELLSERVICE_CID, false, NULL, nsAppShellServiceConstructor },
-  { &kNS_WINDOWMEDIATOR_CID, false, NULL, nsWindowMediatorConstructor },
-  { NULL }
+  { &kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor },
+  { &kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kAppShellContracts[] = {
   { NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID },
   { NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID },
-  { NULL }
+  { nullptr }
 };
 
 static nsresult
 nsAppShellModuleConstructor()
 {
   return nsChromeTreeOwner::InitGlobals();
 }
 
@@ -42,15 +42,15 @@ nsAppShellModuleDestructor()
 {
   nsChromeTreeOwner::FreeGlobals();
 }
 
 static const mozilla::Module kAppShellModule = {
   mozilla::Module::kVersion,
   kAppShellCIDs,
   kAppShellContracts,
-  NULL,
-  NULL,
+  nullptr,
+  nullptr,
   nsAppShellModuleConstructor,
   nsAppShellModuleDestructor
 };
 
 NSMODULE_DEFN(appshell) = &kAppShellModule;
--- a/xpfe/components/build/nsModule.cpp
+++ b/xpfe/components/build/nsModule.cpp
@@ -13,31 +13,31 @@
 // Factory constructors
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHTTPIndex, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirectoryViewerFactory)
 
 NS_DEFINE_NAMED_CID(NS_DIRECTORYVIEWERFACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_HTTPINDEX_SERVICE_CID);
 
 static const mozilla::Module::CIDEntry kXPFECIDs[] = {
-    { &kNS_DIRECTORYVIEWERFACTORY_CID, false, NULL, nsDirectoryViewerFactoryConstructor },
-    { &kNS_HTTPINDEX_SERVICE_CID, false, NULL, nsHTTPIndexConstructor },
-    { NULL }
+    { &kNS_DIRECTORYVIEWERFACTORY_CID, false, nullptr, nsDirectoryViewerFactoryConstructor },
+    { &kNS_HTTPINDEX_SERVICE_CID, false, nullptr, nsHTTPIndexConstructor },
+    { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kXPFEContracts[] = {
     { "@mozilla.org/xpfe/http-index-format-factory-constructor", &kNS_DIRECTORYVIEWERFACTORY_CID },
     { NS_HTTPINDEX_SERVICE_CONTRACTID, &kNS_HTTPINDEX_SERVICE_CID },
     { NS_HTTPINDEX_DATASOURCE_CONTRACTID, &kNS_HTTPINDEX_SERVICE_CID },
-    { NULL }
+    { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kXPFECategories[] = {
     { "Gecko-Content-Viewers", "application/http-index-format", "@mozilla.org/xpfe/http-index-format-factory-constructor" },
-    { NULL }
+    { nullptr }
 };
 
 static const mozilla::Module kXPFEModule = {
     mozilla::Module::kVersion,
     kXPFECIDs,
     kXPFEContracts,
     kXPFECategories
 };
--- a/xpfe/components/windowds/nsWindowDataSource.cpp
+++ b/xpfe/components/windowds/nsWindowDataSource.cpp
@@ -350,17 +350,17 @@ NS_IMETHODIMP nsWindowDataSource::GetURI
     return NS_OK;
 }
 
 /* nsIRDFNode GetTarget (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue); */
 NS_IMETHODIMP nsWindowDataSource::GetTarget(nsIRDFResource *aSource, nsIRDFResource *aProperty, bool aTruthValue, nsIRDFNode **_retval)
 {
     NS_ENSURE_ARG_POINTER(_retval);
 
-    // add extra NULL checking for top-crash bug # 146466
+    // add extra nullptr checking for top-crash bug # 146466
     if (!gRDFService) return NS_RDF_NO_VALUE;
     if (!mInner) return NS_RDF_NO_VALUE;
     if (!mContainer) return NS_RDF_NO_VALUE;
     // special case kNC_KeyIndex before we forward to mInner
     if (aProperty == kNC_KeyIndex) {
 
         int32_t theIndex = 0;
         nsresult rv = mContainer->IndexOf(aSource, &theIndex);
@@ -543,28 +543,28 @@ NS_IMETHODIMP nsWindowDataSource::EndUpd
 
 // The module goop
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
 
 NS_DEFINE_NAMED_CID(NS_WINDOWDATASOURCE_CID);
 
 static const mozilla::Module::CIDEntry kWindowDSCIDs[] = {
-    { &kNS_WINDOWDATASOURCE_CID, false, NULL, nsWindowDataSourceConstructor },
-    { NULL }
+    { &kNS_WINDOWDATASOURCE_CID, false, nullptr, nsWindowDataSourceConstructor },
+    { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kWindowDSContracts[] = {
     { NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator", &kNS_WINDOWDATASOURCE_CID },
-    { NULL }
+    { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kWindowDSCategories[] = {
     { "app-startup", "Window Data Source", "service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator" },
-    { NULL }
+    { nullptr }
 };
         
 static const mozilla::Module kWindowDSModule = {
     mozilla::Module::kVersion,
     kWindowDSCIDs,
     kWindowDSContracts,
     kWindowDSCategories
 };
--- a/xulrunner/app/nsXULRunnerApp.cpp
+++ b/xulrunner/app/nsXULRunnerApp.cpp
@@ -54,17 +54,17 @@ static void Output(bool isError, const c
   _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
 
   UINT flags = MB_OK;
   if (isError)
     flags |= MB_ICONERROR;
   else
     flags |= MB_ICONINFORMATION;
     
-  MessageBoxW(NULL, msg, L"XULRunner", flags);
+  MessageBoxW(nullptr, msg, L"XULRunner", flags);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 /**
--- a/xulrunner/examples/simple/components/src/SimpleTest.cpp
+++ b/xulrunner/examples/simple/components/src/SimpleTest.cpp
@@ -30,23 +30,23 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(SimpleTes
 // 5e14b432-37b6-4377-923b-c987418d8429
 #define SIMPLETEST_CID \
   { 0x5e14b432, 0x37b6, 0x4377, \
     { 0x92, 0x3b, 0xc9, 0x87, 0x41, 0x8d, 0x84, 0x29 } }
 
 NS_DEFINE_NAMED_CID(SIMPLETEST_CID);
 
 static const mozilla::Module::CIDEntry kSimpleCIDs[] = {
-  { &kSIMPLETEST_CID, false, NULL, SimpleTestConstructor },
-  { NULL }
+  { &kSIMPLETEST_CID, false, nullptr, SimpleTestConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kSimpleContracts[] = {
   { "@test.mozilla.org/simple-test;1?impl=c++", &kSIMPLETEST_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kSimpleModule = {
   mozilla::Module::kVersion,
   kSimpleCIDs,
   kSimpleContracts
 };
 
--- a/xulrunner/stub/nsXULStub.cpp
+++ b/xulrunner/stub/nsXULStub.cpp
@@ -66,17 +66,17 @@ static void Output(bool isError, const c
   wchar_t wide_msg[1024];
   MultiByteToWideChar(CP_ACP,
 		      0,
 		      msg,
 		      -1,
 		      wide_msg,
 		      sizeof(wide_msg) / sizeof(wchar_t));
   
-  MessageBoxW(NULL, wide_msg, L"XULRunner", flags);
+  MessageBoxW(nullptr, wide_msg, L"XULRunner", flags);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 /**
@@ -200,21 +200,21 @@ main(int argc, char **argv)
   CFStringGetCString(iniPathStr, iniPath, sizeof(iniPath),
                      kCFStringEncodingUTF8);
   CFRelease(iniPathStr);
 
 #else
 
 #ifdef XP_WIN
   wchar_t wide_path[MAX_PATH];
-  if (!::GetModuleFileNameW(NULL, wide_path, MAX_PATH))
+  if (!::GetModuleFileNameW(nullptr, wide_path, MAX_PATH))
     return 1;
 
   WideCharToMultiByte(CP_UTF8, 0, wide_path,-1,
-		      iniPath, MAX_PATH, NULL, NULL);
+		      iniPath, MAX_PATH, nullptr, nullptr);
 
 #elif defined(XP_OS2)
    PPIB ppib;
    PTIB ptib;
 
    DosGetInfoBlocks(&ptib, &ppib);
    DosQueryModuleName(ppib->pib_hmte, sizeof(iniPath), iniPath);
 
@@ -249,17 +249,17 @@ main(int argc, char **argv)
       sprintf(tmpPath, "%s/%s", token, argv[0]);
       if (stat(tmpPath, &fileStat) == 0) {
         found = true;
         lastSlash = strrchr(tmpPath, '/');
         *lastSlash = 0;
         realpath(tmpPath, iniPath);
         break;
       }
-      token = strtok(NULL, ":");
+      token = strtok(nullptr, ":");
     }
     free (pathdup);
     if (!found)
       return 1;
   }
   lastSlash = iniPath + strlen(iniPath);
   *lastSlash = '/';
 #endif
@@ -355,23 +355,23 @@ main(int argc, char **argv)
     CFURLRef absfwurl = nullptr;
     if (fwurl) {
       absfwurl = CFURLCopyAbsoluteURL(fwurl);
       CFRelease(fwurl);
     }
 
     if (absfwurl) {
       CFURLRef xulurl =
-        CFURLCreateCopyAppendingPathComponent(NULL, absfwurl,
+        CFURLCreateCopyAppendingPathComponent(nullptr, absfwurl,
                                               CFSTR("XUL.framework"),
                                               true);
 
       if (xulurl) {
         CFURLRef xpcomurl =
-          CFURLCreateCopyAppendingPathComponent(NULL, xulurl,
+          CFURLCreateCopyAppendingPathComponent(nullptr, xulurl,
                                                 CFSTR("libxpcom.dylib"),
                                                 false);
 
         if (xpcomurl) {
           char tbuffer[MAXPATHLEN];
 
           if (CFURLGetFileSystemRepresentation(xpcomurl, true,
                                                (UInt8*) tbuffer,
--- a/xulrunner/tools/redit/redit.cpp
+++ b/xulrunner/tools/redit/redit.cpp
@@ -80,19 +80,19 @@ namespace {
    *
    * Instances |EndUpdateResourceW()| their handles when they go out of scope.
    * They pass |TRUE| as the second argument to |EndUpdateResourceW()|, which
    * causes the resource update to be aborted (changes are discarded).
    */
   struct ScopedResourceUpdateTraits
   {
     typedef HANDLE type;
-    static type empty() { return NULL; }
+    static type empty() { return nullptr; }
     static void release(type handle) {
-      if(NULL != handle) {
+      if(nullptr != handle) {
         EndUpdateResourceW(handle, TRUE); // Discard changes
       }
     }
   };
 
   typedef mozilla::Scoped<ScopedResourceUpdateTraits> ScopedResourceUpdate;
 };
 
@@ -126,17 +126,17 @@ wmain(int argc, wchar_t** argv)
     return 1;
   }
   _read(file, data, filesize);
 
   IconHeader* header = reinterpret_cast<IconHeader*>(data.get());
 
   // Open the target library for updating
   ScopedResourceUpdate updateRes(BeginUpdateResourceW(argv[1], FALSE));
-  if (NULL == updateRes) {
+  if (nullptr == updateRes) {
     fprintf(stderr, "Unable to open library for modification.\n");
     return 1;
   }
 
   // Allocate the group resource entry
   long groupSize = sizeof(IconHeader)
                  + header->ImageCount * sizeof(IconResEntry);
   nsAutoArrayPtr<BYTE> group(new BYTE[groupSize]);