Bug 784739 - Switch from NULL to nullptr in b2g/; r=ehsan
authormatekm <matekm@gmail.com>
Tue, 02 Apr 2013 20:20:15 -0400
changeset 127007 2ab6aaf3ed13ba9f0efd0f115553587a3e3f46af
parent 127006 832de954da6a9d58dd1d9df9afd2937a0926ab54
child 127008 72ed3ec3c90b92d51dd933ad4545785a27a6902d
push id1477
push uservporof@mozilla.com
push dateSun, 07 Apr 2013 09:12:54 +0000
treeherderfx-team@5e01908df6d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone23.0a1
Bug 784739 - Switch from NULL to nullptr in b2g/; r=ehsan
b2g/app/nsBrowserApp.cpp
b2g/gaia/run-b2g.cpp
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -46,17 +46,17 @@
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
   PRUnichar msg[2048];
   _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
-  MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
+  MessageBoxW(nullptr, msg, L"XULRunner", MB_OK | MB_ICONERROR);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
 
 /**
--- a/b2g/gaia/run-b2g.cpp
+++ b/b2g/gaia/run-b2g.cpp
@@ -14,61 +14,61 @@
 #ifndef B2G_NAME
 #define B2G_NAME L"b2g.exe"
 #endif
 #ifndef GAIA_PATH
 #define GAIA_PATH L"gaia\\profile"
 #endif
 
 void error(wchar_t* msg){
-    MessageBoxW(NULL, msg, L"Error starting program", MB_OK | MB_ICONERROR);
+    MessageBoxW(nullptr, msg, L"Error starting program", MB_OK | MB_ICONERROR);
 }
 
 /* This function takes a string which represents a windows path, orig.
  * The file portion of the path is stripped off and replaced with the
  * path component, file.  This function returns a string which represents
  * a windows path with the modifications requested and needs to be freed
  * explicitly by the calling function.
  */
 wchar_t* make_path_with_leaf_file_name(wchar_t* orig, wchar_t* file){
     wchar_t* buffer = (wchar_t*) malloc(NUM_MAX_PATH_BYTES);
     if (!buffer) {
-        return NULL;
+        return nullptr;
     }
     if (FAILED(StringCchCopyW(buffer, NUM_MAX_PATH_BYTES, orig))) {
         error(L"Error copying string");
         free(buffer);
-        buffer = NULL;
+        buffer = nullptr;
     }
     PathRemoveFileSpecW(buffer);
     if (!PathAppendW(buffer, file)) {
         error(L"Unable to append file to directory");
         free(buffer);
-        buffer = NULL;
+        buffer = nullptr;
     }
     return buffer;
 }
 
 BOOL execute(wchar_t* binary_path, wchar_t* args, int cp_flags) {
     STARTUPINFOW si;
     PROCESS_INFORMATION pi;
 
     ZeroMemory(&si, sizeof(si));
     si.cb = sizeof(si);
     ZeroMemory(&pi, sizeof(pi));
     
     if (!CreateProcessW(
         binary_path,
         args,
-        NULL,
-        NULL,
+        nullptr,
+        nullptr,
         FALSE,
         cp_flags,
-        NULL,
-        NULL,
+        nullptr,
+        nullptr,
         &si,
         &pi)){
             error(L"Could not execute program");
             return FALSE;
     }
 
     WaitForInputIdle(pi.hProcess, 0);
     CloseHandle(pi.hProcess);
@@ -92,11 +92,11 @@ int wmain(int argc, wchar_t *argv[], wch
     cp_flags = DETACHED_PROCESS;
 #endif
     if (!execute(b2g_path, args, cp_flags)) {
         error(L"Failed to launch program");
     }
     free(profile_path);
     free(b2g_path);
     free(args);
-    profile_path = b2g_path = args = NULL;
+    profile_path = b2g_path = args = nullptr;
     
 }