From 43123f2ccc714bbb4991b538dd70e411899f98e3 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Tue, 3 Jan 2006 17:17:14 +0000 Subject: Get rid of tolower/toupper jump reloc, correct tow* for XLOCALE --- libc/inet/ntop.c | 4 ++-- libc/inet/rpc/rcmd.c | 2 +- libc/misc/fnmatch/fnmatch.c | 2 +- libc/misc/fnmatch/fnmatch_old.c | 2 +- libc/misc/regex/regcomp.c | 2 +- libc/misc/regex/regex_internal.c | 4 ++-- libc/misc/regex/regex_old.c | 2 +- libc/misc/wctype/wctype.c | 13 ++++++++++--- libc/string/strcasestr.c | 4 ++-- 9 files changed, 21 insertions(+), 14 deletions(-) diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 7bf242354..6f3a8ccec 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -249,7 +249,7 @@ inet_pton4(const char *src, u_char *dst) * So undef it here so we get the function version of tolower * instead. */ -#undef tolower +#undef __tolower static int inet_pton6(const char *src, u_char *dst) @@ -271,7 +271,7 @@ inet_pton6(const char *src, u_char *dst) curtok = src; saw_xdigit = 0; val = 0; - while ((ch = tolower (*src++)) != '\0') { + while ((ch = __tolower (*src++)) != '\0') { const char *pch; pch = __strchr(xdigits, ch); diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index b3f2a198c..c7a5be0db 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -673,7 +673,7 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost) } for (;*p && !isspace(*p); ++p) { - *p = tolower (*p); + *p = __tolower (*p); } /* Next we want to find the permitted name for the remote user. */ diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c index 8cacc9a88..f1419bfd8 100644 --- a/libc/misc/fnmatch/fnmatch.c +++ b/libc/misc/fnmatch/fnmatch.c @@ -245,7 +245,7 @@ __wcschrnul (s, c) /* Note that this evaluates C many times. */ # if defined _LIBC || defined __UCLIBC__ -# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) +# define FOLD(c) ((flags & FNM_CASEFOLD) ? __tolower (c) : (c)) # else # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) # endif diff --git a/libc/misc/fnmatch/fnmatch_old.c b/libc/misc/fnmatch/fnmatch_old.c index 892738999..384756569 100644 --- a/libc/misc/fnmatch/fnmatch_old.c +++ b/libc/misc/fnmatch/fnmatch_old.c @@ -56,7 +56,7 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag register char c; /* Note that this evaluates C many times. */ -# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) +# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? __tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD(c); diff --git a/libc/misc/regex/regcomp.c b/libc/misc/regex/regcomp.c index b15109c93..419d879be 100644 --- a/libc/misc/regex/regcomp.c +++ b/libc/misc/regex/regcomp.c @@ -292,7 +292,7 @@ re_set_fastmap (char *fastmap, int icase, int ch) { fastmap[ch] = 1; if (icase) - fastmap[tolower (ch)] = 1; + fastmap[__tolower (ch)] = 1; } /* Helper function for re_compile_fastmap. diff --git a/libc/misc/regex/regex_internal.c b/libc/misc/regex/regex_internal.c index f9814d290..c1ee85040 100644 --- a/libc/misc/regex/regex_internal.c +++ b/libc/misc/regex/regex_internal.c @@ -289,7 +289,7 @@ build_wcs_upper_buffer (re_string_t *pstr) { /* In case of a singlebyte character. */ pstr->mbs[byte_idx] - = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]); + = __toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]); /* The next step uses the assumption that wchar_t is encoded ASCII-safe: all ASCII values can be converted like this. */ pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx]; @@ -523,7 +523,7 @@ build_upper_buffer (re_string_t *pstr) if (BE (pstr->trans != NULL, 0)) ch = pstr->trans[ch]; if (islower (ch)) - pstr->mbs[char_idx] = toupper (ch); + pstr->mbs[char_idx] = __toupper (ch); else pstr->mbs[char_idx] = ch; } diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index b995cabfa..9031cebff 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -275,7 +275,7 @@ char *realloc (); # ifdef _tolower # define TOLOWER(c) _tolower(c) # else -# define TOLOWER(c) tolower(c) +# define TOLOWER(c) __tolower(c) # endif # ifndef NULL diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c index 67b1ca600..659000558 100644 --- a/libc/misc/wctype/wctype.c +++ b/libc/misc/wctype/wctype.c @@ -378,7 +378,9 @@ strong_alias(__towlower_l,towlower_l) #endif /* __LOCALE_C_ONLY */ +#ifndef L_towlower_l strong_alias(__towlower,towlower) +#endif #endif /**********************************************************************/ @@ -484,7 +486,9 @@ strong_alias(__towupper_l,towupper_l) #endif /* __LOCALE_C_ONLY */ +#ifndef L_towupper_l strong_alias(__towupper,towupper) +#endif #endif /**********************************************************************/ @@ -724,11 +728,11 @@ weak_alias(__iswctype, iswctype) #ifndef _tolower #warning _tolower is undefined! -#define _tolower(c) tolower(c) +#define _tolower(c) __tolower(c) #endif #ifndef _toupper #warning _toupper is undefined! -#define _toupper(c) toupper(c) +#define _toupper(c) __toupper(c) #endif wint_t attribute_hidden __towctrans(wint_t wc, wctrans_t desc) @@ -880,10 +884,13 @@ wint_t attribute_hidden TOWCTRANS(wint_t wc, wctrans_t desc) #ifdef L_towctrans_l strong_alias(__towctrans_l, towctrans_l) #endif /* L_towctrans_l */ -strong_alias(__towctrans,towctrans) #endif /* __LOCALE_C_ONLY */ +#ifndef L_towctrans_l +strong_alias(__towctrans,towctrans) +#endif + #endif /**********************************************************************/ #ifdef L_wctrans diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c index 320430ce6..5222eda71 100644 --- a/libc/string/strcasestr.c +++ b/libc/string/strcasestr.c @@ -19,7 +19,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2) return (char *) s1;; } if ((*p == *s) - || (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s))) + || (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s))) ) { ++p; ++s; @@ -34,7 +34,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2) #else while (*p && *s) { if ((*p == *s) - || (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s))) + || (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s))) ) { ++p; ++s; -- cgit v1.2.3