Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(971)

Unified Diff: src/utils.h

Issue 1072333002: Fix some -Werror=sign-compare errors (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-cpu-profiler.cc » ('j') | test/cctest/test-cpu-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 881d8bffabe9a58387e5b723c64db66a125da994..dd4712903126bd0e2f08917dae07df553309b212 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -41,7 +41,7 @@ inline int WhichPowerOf2(uint32_t x) {
DCHECK(base::bits::IsPowerOfTwo32(x));
int bits = 0;
#ifdef DEBUG
- int original_x = x;
+ uint32_t original_x = x;
#endif
if (x >= 0x10000) {
bits += 16;
@@ -62,7 +62,7 @@ inline int WhichPowerOf2(uint32_t x) {
case 2: bits++; // Fall through.
case 1: break;
}
- DCHECK_EQ(1 << bits, original_x);
+ DCHECK_EQ(static_cast<uint32_t>(1) << bits, original_x);
return bits;
}
@@ -97,7 +97,7 @@ inline int WhichPowerOf2_64(uint64_t x) {
case 2: bits++; // Fall through.
case 1: break;
}
- DCHECK_EQ(1L << bits, original_x);
+ DCHECK_EQ(static_cast<uint64_t>(1) << bits, original_x);
return bits;
}
« no previous file with comments | « no previous file | test/cctest/test-cpu-profiler.cc » ('j') | test/cctest/test-cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698