diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-02-23 17:52:50 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-02-23 17:52:50 -0800 |
commit | b80bdda14e2213e928d3dc3895b3c680d2ea674a (patch) | |
tree | 54f55fe0d2f2cf75cf1026e7dd01ca13d67f4254 /deps/v8/src/utils.h | |
parent | df1c1e593f8aac17e6edd8aa1fe278893b2e5a39 (diff) | |
download | node-new-b80bdda14e2213e928d3dc3895b3c680d2ea674a.tar.gz |
Upgrade V8 to 2.1.2
Diffstat (limited to 'deps/v8/src/utils.h')
-rw-r--r-- | deps/v8/src/utils.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/deps/v8/src/utils.h b/deps/v8/src/utils.h index c59ca258aa..2fcd241fd5 100644 --- a/deps/v8/src/utils.h +++ b/deps/v8/src/utils.h @@ -157,7 +157,9 @@ class BitField { // Returns a uint32_t mask of bit field. static uint32_t mask() { - return (1U << (size + shift)) - (1U << shift); + // To use all bits of a uint32 in a bitfield without compiler warnings we + // have to compute 2^32 without using a shift count of 32. + return ((1U << shift) << size) - (1U << shift); } // Returns a uint32_t with the bit field value encoded. @@ -168,7 +170,7 @@ class BitField { // Extracts the bit field from the value. static T decode(uint32_t value) { - return static_cast<T>((value >> shift) & ((1U << (size)) - 1)); + return static_cast<T>((value & mask()) >> shift); } }; |