Add an explicit cast for an integral promotion that MSVC warns about.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Sep 2011 12:16:30 +0000 (12:16 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Sep 2011 12:16:30 +0000 (12:16 +0000)
I don't think the warning is valid, but it's a good sign that MSVC is
fixin' to generate the wrong code no matter what I think.

R=ricow@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7869008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/utils.h

index 852a6ae26df81f198385f9afa9b89627a31f58c6..26c522b89f2025e06f56ffd4878aabdf51d42dbc 100644 (file)
@@ -213,7 +213,7 @@ class BitField {
 
   // Tells whether the provided value fits into the bit field.
   static bool is_valid(T value) {
-    return (static_cast<uint32_t>(value) & ~kMax) == 0;
+    return (static_cast<uint32_t>(value) & ~static_cast<uint32_t>(kMax)) == 0;
   }
 
   // Returns a uint32_t with the bit field value encoded.