int64_t is long on x86_64, and not always equivalent to long long.
authorSascha Wildner <saw@online.de>
Thu, 29 Nov 2012 20:57:05 +0000 (21:57 +0100)
committerSascha Wildner <saw@online.de>
Thu, 29 Nov 2012 20:57:05 +0000 (21:57 +0100)
Similarly, uint64_t is unsigned long.

For their min/max value definitions, change LL/ULL suffixes to L/UL.

The bug report has some C++ sample code that show issues resulting
from treating them as long long.

Reported-by: David Shao <davshao@gmail.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2461>

sys/cpu/x86_64/include/int_limits.h

index 0c7ffa1..122f946 100644 (file)
 #define        INT8_MIN        (-0x7f-1)
 #define        INT16_MIN       (-0x7fff-1)
 #define        INT32_MIN       (-0x7fffffff-1)
-#define        INT64_MIN       (-0x7fffffffffffffffLL-1)
+#define        INT64_MIN       (-0x7fffffffffffffffL-1)
 
 /* Maximum values of exact-width signed integer types. */
 #define        INT8_MAX        0x7f
 #define        INT16_MAX       0x7fff
 #define        INT32_MAX       0x7fffffff
-#define        INT64_MAX       0x7fffffffffffffffLL
+#define        INT64_MAX       0x7fffffffffffffffL
 
 /* Maximum values of exact-width unsigned integer types. */
 #define        UINT8_MAX       0xff
 #define        UINT16_MAX      0xffff
 #define        UINT32_MAX      0xffffffffU
-#define        UINT64_MAX      0xffffffffffffffffULL
+#define        UINT64_MAX      0xffffffffffffffffUL
 
 /*
  * ISO/IEC 9899:1999