Bug 1380092 Return 0 instead of nullptr draft
authorTom Ritter <tom@mozilla.com>
Tue, 11 Jul 2017 15:13:38 -0500
changeset 607074 3d4f66ac993387c4aefda13253053886454258d2
parent 607041 f6d7b11505c6defc5e99c34f5bed10d95c31d797
child 607601 abee18f7373e54d1579dc9e95d38ea4eb07cd35c
push id67880
push userbmo:tom@mozilla.com
push dateTue, 11 Jul 2017 20:15:36 +0000
bugs1380092
milestone56.0a1
Bug 1380092 Return 0 instead of nullptr nullptr is explicitly not allowed to be cast to an int. But uintptr_t is an unsigned int that happens to be large enough to hold a pointer. Return 0, which is an int. MozReview-Commit-ID: 2SE76JuJLCo
ipc/mscom/Utils.cpp
--- a/ipc/mscom/Utils.cpp
+++ b/ipc/mscom/Utils.cpp
@@ -87,17 +87,17 @@ GetContainingModuleHandle()
   HMODULE thisModule = nullptr;
 #if defined(_MSC_VER)
   thisModule = reinterpret_cast<HMODULE>(&__ImageBase);
 #else
   if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
                          GET_MODULE_HANDLE_EX_UNCHANGED_REFCOUNT,
                          reinterpret_cast<LPCTSTR>(&GetContainingModuleHandle),
                          &thisModule)) {
-    return nullptr;
+    return 0;
   }
 #endif
   return reinterpret_cast<uintptr_t>(thisModule);
 }
 
 #if defined(MOZILLA_INTERNAL_API)
 
 void