[cfe-commits] r89224 - in /cfe/trunk: lib/Headers/stdint.h test/Preprocessor/stdint.c

Ken Dyck ken.dyck at onsemi.com
Wed Nov 18 11:22:15 PST 2009


Author: kjdyck
Date: Wed Nov 18 13:22:15 2009
New Revision: 89224

URL: http://llvm.org/viewvc/llvm-project?rev=89224&view=rev
Log:
Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros for
their corresponding exact-width type. 


Modified:
    cfe/trunk/lib/Headers/stdint.h
    cfe/trunk/test/Preprocessor/stdint.c

Modified: cfe/trunk/lib/Headers/stdint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdint.h?rev=89224&r1=89223&r2=89224&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/stdint.h (original)
+++ cfe/trunk/lib/Headers/stdint.h Wed Nov 18 13:22:15 2009
@@ -634,9 +634,9 @@
 #endif
 
 /* C99 7.18.2.5 Limits of greatest-width integer types. */
-#define INTMAX_MIN  (-__INTMAX_MAX__-1)
-#define INTMAX_MAX   __INTMAX_MAX__
-#define UINTMAX_MAX (__INTMAX_MAX__*2ULL+1ULL)
+#define INTMAX_MIN  __stdint_exjoin3( INT, __INTMAX_WIDTH__, _MIN)
+#define INTMAX_MAX  __stdint_exjoin3( INT, __INTMAX_WIDTH__, _MAX)
+#define UINTMAX_MAX __stdint_exjoin3(UINT, __INTMAX_WIDTH__, _MAX)
 
 /* C99 7.18.3 Limits of other integer types. */
 #define SIG_ATOMIC_MIN INT32_MIN

Modified: cfe/trunk/test/Preprocessor/stdint.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/stdint.c?rev=89224&r1=89223&r2=89224&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/stdint.c (original)
+++ cfe/trunk/test/Preprocessor/stdint.c Wed Nov 18 13:22:15 2009
@@ -83,7 +83,7 @@
 //
 // ARM:INTMAX_MIN_ (-9223372036854775807LL -1)
 // ARM:INTMAX_MAX_ 9223372036854775807LL
-// ARM:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// ARM:UINTMAX_MAX_ 18446744073709551615ULL
 //
 // ARM:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // ARM:SIG_ATOMIC_MAX_ 2147483647
@@ -191,7 +191,7 @@
 //
 // BFIN:INTMAX_MIN_ (-9223372036854775807LL -1)
 // BFIN:INTMAX_MAX_ 9223372036854775807LL
-// BFIN:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// BFIN:UINTMAX_MAX_ 18446744073709551615ULL
 //
 // BFIN:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // BFIN:SIG_ATOMIC_MAX_ 2147483647
@@ -299,7 +299,7 @@
 //
 // I386:INTMAX_MIN_ (-9223372036854775807LL -1)
 // I386:INTMAX_MAX_ 9223372036854775807LL
-// I386:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// I386:UINTMAX_MAX_ 18446744073709551615ULL
 //
 // I386:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // I386:SIG_ATOMIC_MAX_ 2147483647
@@ -399,7 +399,7 @@
 //
 // MSP430:INTMAX_MIN_ (-2147483647L -1)
 // MSP430:INTMAX_MAX_ 2147483647L
-// MSP430:UINTMAX_MAX_ (2147483647L*2ULL +1ULL)
+// MSP430:UINTMAX_MAX_ 4294967295UL
 //
 // MSP430:SIG_ATOMIC_MIN_ (-2147483647L -1)
 // MSP430:SIG_ATOMIC_MAX_ 2147483647L
@@ -499,7 +499,7 @@
 //
 // PIC16:INTMAX_MIN_ (-2147483647L -1)
 // PIC16:INTMAX_MAX_ 2147483647L
-// PIC16:UINTMAX_MAX_ (2147483647L*2ULL +1ULL)
+// PIC16:UINTMAX_MAX_ 4294967295UL
 //
 // PIC16:SIG_ATOMIC_MIN_ (-2147483647L -1)
 // PIC16:SIG_ATOMIC_MAX_ 2147483647L
@@ -606,7 +606,7 @@
 //
 // PPC64:INTMAX_MIN_ (-9223372036854775807L -1)
 // PPC64:INTMAX_MAX_ 9223372036854775807L
-// PPC64:UINTMAX_MAX_ (9223372036854775807L*2ULL +1ULL)
+// PPC64:UINTMAX_MAX_ 18446744073709551615UL
 //
 // PPC64:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // PPC64:SIG_ATOMIC_MAX_ 2147483647
@@ -714,7 +714,7 @@
 //
 // PPC:INTMAX_MIN_ (-9223372036854775807LL -1)
 // PPC:INTMAX_MAX_ 9223372036854775807LL
-// PPC:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// PPC:UINTMAX_MAX_ 18446744073709551615ULL
 //
 // PPC:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // PPC:SIG_ATOMIC_MAX_ 2147483647
@@ -819,9 +819,9 @@
 // S390X:PTRDIFF_MAX_ 9223372036854775807L
 // S390X:SIZE_MAX_ 18446744073709551615UL
 //
-// S390X:INTMAX_MIN_ (-9223372036854775807LL -1)
-// S390X:INTMAX_MAX_ 9223372036854775807LL
-// S390X:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// S390X:INTMAX_MIN_ (-9223372036854775807L -1)
+// S390X:INTMAX_MAX_ 9223372036854775807L
+// S390X:UINTMAX_MAX_ 18446744073709551615UL
 //
 // S390X:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // S390X:SIG_ATOMIC_MAX_ 2147483647
@@ -928,7 +928,7 @@
 //
 // SPARC:INTMAX_MIN_ (-9223372036854775807LL -1)
 // SPARC:INTMAX_MAX_ 9223372036854775807LL
-// SPARC:UINTMAX_MAX_ (9223372036854775807LL*2ULL +1ULL)
+// SPARC:UINTMAX_MAX_ 18446744073709551615ULL
 //
 // SPARC:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // SPARC:SIG_ATOMIC_MAX_ 2147483647
@@ -1026,9 +1026,9 @@
 // TCE:PTRDIFF_MAX_ 2147483647
 // TCE:SIZE_MAX_ 4294967295U
 //
-// TCE:INTMAX_MIN_ (-2147483647L -1)
-// TCE:INTMAX_MAX_ 2147483647L
-// TCE:UINTMAX_MAX_ (2147483647L*2ULL +1ULL)
+// TCE:INTMAX_MIN_ (-2147483647 -1)
+// TCE:INTMAX_MAX_ 2147483647
+// TCE:UINTMAX_MAX_ 4294967295U
 //
 // TCE:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // TCE:SIG_ATOMIC_MAX_ 2147483647
@@ -1136,7 +1136,7 @@
 //
 // X86_64:INTMAX_MIN_ (-9223372036854775807L -1)
 // X86_64:INTMAX_MAX_ 9223372036854775807L
-// X86_64:UINTMAX_MAX_ (9223372036854775807L*2ULL +1ULL)
+// X86_64:UINTMAX_MAX_ 18446744073709551615UL
 //
 // X86_64:SIG_ATOMIC_MIN_ (-2147483647 -1)
 // X86_64:SIG_ATOMIC_MAX_ 2147483647





More information about the cfe-commits mailing list