mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
Don't user __tolower directly for tolower implementation. Use inline function which tests for the range first. Make _tolower equivalent to old tolower macros. Likewise for toupper.
This commit is contained in:
parent
e3822a8a50
commit
8831788577
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1997, 1999 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -39,11 +39,11 @@ func (isxdigit, _ISxdigit)
|
|||||||
int
|
int
|
||||||
tolower (int c)
|
tolower (int c)
|
||||||
{
|
{
|
||||||
return __tolower (c);
|
return __c >= -128 && __c < 256 ? __tolower (__c) : __c;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
toupper (int c)
|
toupper (int c)
|
||||||
{
|
{
|
||||||
return __toupper (c);
|
return __c >= -128 && __c < 256 ? __toupper (__c) : __c;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
|
/* Copyright (C) 1991,92,93,95,96,97,98,99 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -150,12 +150,26 @@ __exctype (_tolower);
|
|||||||
# define isblank(c) __isctype((c), _ISblank)
|
# define isblank(c) __isctype((c), _ISblank)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define tolower(c) __tolower(c)
|
#if __GNUC__ >= 2
|
||||||
#define toupper(c) __toupper(c)
|
extern inline int
|
||||||
|
tolower (int __c)
|
||||||
|
{
|
||||||
|
return __c >= -128 && __c < 256 ? __tolower (__c) : __c;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern inline int
|
||||||
|
toupper (int __c)
|
||||||
|
{
|
||||||
|
return __c >= -128 && __c < 256 ? __toupper (__c) : __c;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
||||||
# define isascii(c) __isascii(c)
|
# define isascii(c) __isascii(c)
|
||||||
# define toascii(c) __toascii(c)
|
# define toascii(c) __toascii(c)
|
||||||
|
|
||||||
|
# define _tolower(c) __tolower(c)
|
||||||
|
# define _toupper(c) __toupper(c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* Not __NO_CTYPE. */
|
#endif /* Not __NO_CTYPE. */
|
||||||
|
Loading…
Reference in New Issue
Block a user