Bug 1392617 Fix comparison between signed and unsigned integer expressions draft
authorTom Ritter <tom@mozilla.com>
Tue, 22 Aug 2017 06:35:12 -0500
changeset 650472 772bd711e4087aba9f7fdede285bb59d61a51074
parent 650471 f5a87fae1c4d77b598af790034402407c3d97ab3
child 727419 bcb7b497313ea1dda8c7b8d209a0a2c08d964e43
push id75408
push userbmo:tom@mozilla.com
push dateTue, 22 Aug 2017 13:43:21 +0000
bugs1392617
milestone57.0a1
Bug 1392617 Fix comparison between signed and unsigned integer expressions The return of these functions is actually (DWORD) –1 MozReview-Commit-ID: 112d6BTBt8O
xpcom/threads/HangMonitor.cpp
xpcom/threads/nsThread.cpp
--- a/xpcom/threads/HangMonitor.cpp
+++ b/xpcom/threads/HangMonitor.cpp
@@ -158,26 +158,26 @@ GetChromeHangReport(Telemetry::Processed
     CONTEXT context;
     context.ContextFlags = CONTEXT_CONTROL;
     if (::GetThreadContext(winMainThreadHandle, &context)) {
       suspended = true;
     }
   }
 
   if (!suspended) {
-    if (ret != -1) {
+    if (ret != (DWORD)-1) {
       MOZ_ALWAYS_TRUE(::ResumeThread(winMainThreadHandle) != DWORD(-1));
     }
     return;
   }
 
   MozStackWalkThread(ChromeStackWalker, /* skipFrames */ 0, /* maxFrames */ 0,
                      &rawStack, winMainThreadHandle, nullptr);
   ret = ::ResumeThread(winMainThreadHandle);
-  if (ret == -1) {
+  if (ret == (DWORD)-1) {
     return;
   }
   aStack = Telemetry::GetStackAndModules(rawStack);
 
   // Record system uptime (in minutes) at the time of the hang
   aSystemUptime = ((GetTickCount() / 1000) - (gTimeout * 2)) / 60;
 
   // Record Firefox uptime (in minutes) at the time of the hang
old mode 100644
new mode 100755
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -402,17 +402,17 @@ SetThreadAffinity(unsigned int cpu)
   // to run them on the same processor. To run threads on different processors,
   // tag them as belonging to different affinity sets. Tag 0, the default, means
   // "no affinity" so let's pretend each CPU has its own tag `cpu+1`.
   thread_affinity_policy_data_t policy;
   policy.affinity_tag = cpu + 1;
   MOZ_ALWAYS_TRUE(thread_policy_set(mach_thread_self(), THREAD_AFFINITY_POLICY,
                                     &policy.affinity_tag, 1) == KERN_SUCCESS);
 #elif defined(XP_WIN)
-  MOZ_ALWAYS_TRUE(SetThreadIdealProcessor(GetCurrentThread(), cpu) != -1);
+  MOZ_ALWAYS_TRUE(SetThreadIdealProcessor(GetCurrentThread(), cpu) != (DWORD)-1);
 #endif
 }
 
 static void
 SetupCurrentThreadForChaosMode()
 {
   if (!ChaosMode::isActive(ChaosFeature::ThreadScheduling)) {
     return;