From 666e8f922ffe516cb4803887a91ddd75f308a79d Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Mon, 12 Aug 2002 04:32:41 +0000 Subject: 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. --- libc/stdio/stdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libc/stdio/stdio.c') diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c index b4208f97c..2c5f3bbed 100644 --- a/libc/stdio/stdio.c +++ b/libc/stdio/stdio.c @@ -95,7 +95,7 @@ #ifndef __STDIO_THREADSAFE -#ifdef __BCC__ +#if defined(__BCC__) && 0 #define UNLOCKED_STREAM(RETURNTYPE,NAME,PARAMS,ARGS,STREAM) \ asm(".text\nexport _" "NAME" "_unlocked\n_" "NAME" "_unlocked = _" "NAME"); \ RETURNTYPE NAME PARAMS @@ -108,7 +108,7 @@ RETURNTYPE NAME PARAMS #define UNLOCKED(RETURNTYPE,NAME,PARAMS,ARGS) \ UNLOCKED_STREAM(RETURNTYPE,NAME,PARAMS,ARGS,stream) -#ifdef __BCC__ +#if defined(__BCC__) && 0 #define UNLOCKED_VOID_RETURN(NAME,PARAMS,ARGS) \ asm(".text\nexport _" "NAME" "_unlocked\n_" "NAME" "_unlocked = _" "NAME"); \ void NAME PARAMS @@ -3274,7 +3274,7 @@ void _stdio_fdout(int fd, ...) /* Avoid using long long / and % operations to cut down dependencies on * libgcc.a. Definitely helps on i386 at least. */ -#if (UINTMAX_MAX > UINT_MAX) && ((UINTMAX_MAX/UINT_MAX) - 2 <= UINT_MAX) +#if (INTMAX_MAX > INT_MAX) && (((INTMAX_MAX/INT_MAX)/2) - 2 <= INT_MAX) #define INTERNAL_DIV_MOD #endif -- cgit v1.2.3