Bug 1392617 Fix comparison between signed and unsigned integer expressions
The return of these functions is actually (DWORD) –1
MozReview-Commit-ID: 112d6BTBt8O
--- 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;