Fix the 64-bit build.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Aug 2008 14:55:46 +0000 (14:55 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Aug 2008 14:55:46 +0000 (14:55 +0000)
Add extra cast to avoid warnings about loss of precision when casting from
JSValue* to an integer type.

* kjs/JSImmediate.h:
(KJS::JSImmediate::intValue):
(KJS::JSImmediate::uintValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35782 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/JSImmediate.h

index 2a8ebd9..b9ce25b 100644 (file)
@@ -1,3 +1,14 @@
+2008-08-15  Mark Rowe  <mrowe@apple.com>
+
+        Fix the 64-bit build.
+
+        Add extra cast to avoid warnings about loss of precision when casting from
+        JSValue* to an integer type.
+
+        * kjs/JSImmediate.h:
+        (KJS::JSImmediate::intValue):
+        (KJS::JSImmediate::uintValue):
+
 2008-08-15  Alexey Proskuryakov  <ap@webkit.org>
 
         Still fixing Windows build.
index 3eb9f79..55e5f30 100644 (file)
@@ -259,17 +259,17 @@ namespace KJS {
         
         static ALWAYS_INLINE int32_t intValue(const JSValue* v)
         {
-            return reinterpret_cast<int32_t>(v) >> IntegerPayloadShift;
+            return static_cast<int32_t>(reinterpret_cast<intptr_t>(v) >> IntegerPayloadShift);
         }
         
         static ALWAYS_INLINE uint32_t uintValue(const JSValue* v)
         {
-            return reinterpret_cast<uint32_t>(v) >> IntegerPayloadShift;
+            return static_cast<uint32_t>(rawValue(v) >> IntegerPayloadShift);
         }
         
         static ALWAYS_INLINE bool boolValue(const JSValue* v)
         {
-            return (reinterpret_cast<uint32_t>(v) & ExtendedPayloadBitBoolValue) != 0;
+            return (rawValue(v) & ExtendedPayloadBitBoolValue) != 0;
         }
         
         static ALWAYS_INLINE uintptr_t rawValue(const JSValue* v)