64-bit constants need an ll, ull, i64, or ui64 suffix.
authorTim Mann <tim@tim-mann.org>
Tue, 15 Feb 2005 05:57:42 +0000 (05:57 +0000)
committerTim Mann <tim@tim-mann.org>
Tue, 15 Feb 2005 05:57:42 +0000 (05:57 +0000)
backend.c
backend.h

index f1a79d2..4bec193 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -273,9 +273,9 @@ double
 u64ToDouble(u64 value)
 {
   double r;
-  u64 tmp = value & 0x7fffffffffffffff;
+  u64 tmp = value & u64Const(0x7fffffffffffffff);
   r = (double)(s64)tmp;
-  if (value & 0x8000000000000000)
+  if (value & u64Const(0x8000000000000000))
        r +=  9.2233720368547758080e18; /* 2^63 */
  return r;
 }
index 244838d..f782f83 100644 (file)
--- a/backend.h
+++ b/backend.h
@@ -183,22 +183,31 @@ int ics_type;
         * This is for MS Visual Studio
         */
        #ifdef _MSC_VER
-               #define u64     unsigned __int64
+               #define u64 unsigned __int64
                #define s64 signed __int64
-               #define u64Display  "%I64u"
+               #define u64Display "%I64u"
+               #define s64Display "%I64d"
+               #define u64Const(c) (c ## UI64)
+               #define s64Const(c) (c ## I64)
        #else
                /* place holder
                 * or dummy types for other compiler
                 */
-               #define u64     unsigned __int64
+               #define u64 unsigned __int64
                #define s64 signed __int64
-               #define u64Display  "%I64u"
+               #define u64Display "%I64u"
+               #define s64Display "%I64d"
+               #define u64Const(c) (c ## UI64)
+               #define s64Const(c) (c ## I64)
        #endif
 #else
        /* GNU gcc */
-       #define u64     unsigned long long
+       #define u64 unsigned long long
        #define s64 signed long long
-       #define u64Display  "%llu"
+       #define u64Display "%llu"
+       #define s64Display "%lld"
+       #define u64Const(c) (c ## ull)
+       #define s64Const(c) (c ## ll)
 #endif