summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-08-12 04:32:41 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-08-12 04:32:41 +0000
commit666e8f922ffe516cb4803887a91ddd75f308a79d (patch)
treec1d5e82d40b2ca178d179d5f1887ef1f88142a53 /libc/sysdeps/linux/common
parent9a34fd5b8807487a89bb9dd4e895f1f448d75e94 (diff)
Revert commit by davidm to printf.c that initialized conv_num
needlessly. To do so increases the generated code size with bcc. Eliminate duplicate define warnings in wstring.c. Fix potentially broken preprocessor comparisons. The preprocessor converts integers to maximal signed type, so inequality comparisons involving UINTMAX_MAX, ULLONG_MAX, and (if no long long) ULONG_MAX were potentially broken.
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_stdio.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
index b8812e7b0..24f2ec39e 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
@@ -427,35 +427,35 @@ extern void __stdio_validate_FILE(FILE *stream);
#include <limits.h>
#include <stdint.h>
-#if UINTMAX_MAX <= 4294967295UL
+#if INTMAX_MAX <= 2147483647L
#define __UIM_BUFLEN 12 /* 10 digits + 1 nul + 1 sign */
-#elif UINTMAX_MAX <= 18446744073709551615ULL
+#elif INTMAX_MAX <= 9223372036854775807LL
#define __UIM_BUFLEN 22 /* 20 digits + 1 nul + 1 sign */
#else
#error unknown number of digits for intmax_t!
#endif
-#ifdef ULLONG_MAX /* --------------- */
-#if ULLONG_MAX <= 4294967295UL
+#ifdef LLONG_MAX /* --------------- */
+#if LLONG_MAX <= 2147483647L
#define __UIM_BUFLEN_LLONG 12 /* 10 digits + 1 nul + 1 sign */
-#elif ULLONG_MAX <= 18446744073709551615ULL
+#elif LLONG_MAX <= 9223372036854775807LL
#define __UIM_BUFLEN_LLONG 22 /* 20 digits + 1 nul + 1 sign */
#else
#error unknown number of digits for long long!
#endif
#endif /* ULLONG_MAX ----------------------------- */
-#if ULONG_MAX <= 4294967295UL
+#if LONG_MAX <= 2147483647L
#define __UIM_BUFLEN_LONG 12 /* 10 digits + 1 nul + 1 sign */
-#elif ULONG_MAX <= 18446744073709551615ULL
+#elif LONG_MAX <= 9223372036854775807LL
#define __UIM_BUFLEN_LONG 22 /* 20 digits + 1 nul + 1 sign */
#else
#error unknown number of digits for long!
#endif
-#if UINT_MAX <= 65536U
+#if INT_MAX <= 32767
#define __UIM_BUFLEN_INT 7 /* 10 digits + 1 nul + 1 sign */
-#elif UINT_MAX <= 4294967295UL
+#elif INT_MAX <= 2147483647L
#define __UIM_BUFLEN_INT 12 /* 10 digits + 1 nul + 1 sign */
#else
#error unknown number of digits for int!