From c0dab37d0a2e079d0e0c85aa979439373e9096ca Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 22 Oct 2009 22:28:08 +0200 Subject: *: remove last function calls to isspace function old new delta xstrtoul_range_sfx 232 231 -1 xstrtoull_range_sfx 295 293 -2 trim 82 80 -2 trim_trailing_spaces_and_print 57 52 -5 isspace 18 - -18 Signed-off-by: Denys Vlasenko --- coreutils/cal.c | 2 +- coreutils/wc.c | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'coreutils') diff --git a/coreutils/cal.c b/coreutils/cal.c index ef70b0e..7973b82 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c @@ -262,7 +262,7 @@ static void trim_trailing_spaces_and_print(char *s) } while (p != s) { --p; - if (!(isspace)(*p)) { /* We want the function... not the inline. */ + if (!isspace(*p)) { p[1] = '\0'; break; } diff --git a/coreutils/wc.c b/coreutils/wc.c index d0e5482..3e32e3d 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -43,22 +43,19 @@ #include "libbb.h" -#if ENABLE_LOCALE_SUPPORT -#define isspace_given_isprint(c) isspace(c) -#else -#undef isspace -#undef isprint -#define isspace(c) ((((c) == ' ') || (((unsigned int)((c) - 9)) <= (13 - 9)))) -#define isprint(c) (((unsigned int)((c) - 0x20)) <= (0x7e - 0x20)) -#define isspace_given_isprint(c) ((c) == ' ') +#if !ENABLE_LOCALE_SUPPORT +# undef isprint +# undef isspace +# define isprint(c) ((unsigned)((c) - 0x20) <= (0x7e - 0x20)) +# define isspace(c) ((c) == ' ') #endif #if ENABLE_FEATURE_WC_LARGE -#define COUNT_T unsigned long long -#define COUNT_FMT "llu" +# define COUNT_T unsigned long long +# define COUNT_FMT "llu" #else -#define COUNT_T unsigned -#define COUNT_FMT "u" +# define COUNT_T unsigned +# define COUNT_FMT "u" #endif enum { @@ -123,11 +120,11 @@ int wc_main(int argc UNUSED_PARAM, char **argv) c = getc(fp); if (isprint(c)) { ++linepos; - if (!isspace_given_isprint(c)) { + if (!isspace(c)) { in_word = 1; continue; } - } else if (((unsigned int)(c - 9)) <= 4) { + } else if ((unsigned)(c - 9) <= 4) { /* \t 9 * \n 10 * \v 11 -- cgit v1.1