From f905bd50019a30e07276981a42b90c8ed4610882 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 25 Mar 1996 13:46:21 +0000 Subject: [PATCH] Slightly simplify inlined functions --- include/_ctype.h | 9 +++------ include/ctype.h | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/_ctype.h b/include/_ctype.h index 963a4d4416b1..e87570542b15 100644 --- a/include/_ctype.h +++ b/include/_ctype.h @@ -141,8 +141,7 @@ __END_DECLS static __inline int __istype(_BSD_RUNE_T_ _c, unsigned long _f) { - return (_c < 0 || _c & _CRMASK) ? !!(___runetype(_c) & _f) : - (_c >= _CACHED_RUNES) ? 0 : + return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) : !!(_CurrentRuneLocale->runetype[_c] & _f); } @@ -156,16 +155,14 @@ __isctype(_BSD_RUNE_T_ _c, unsigned long _f) static __inline _BSD_RUNE_T_ __toupper(_BSD_RUNE_T_ _c) { - return (_c < 0 || _c & _CRMASK) ? ___toupper(_c) : - (_c >= _CACHED_RUNES) ? _c : + return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } static __inline _BSD_RUNE_T_ __tolower(_BSD_RUNE_T_ _c) { - return (_c < 0 || _c & _CRMASK) ? ___tolower(_c) : - (_c >= _CACHED_RUNES) ? _c : + return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; } diff --git a/include/ctype.h b/include/ctype.h index 963a4d4416b1..e87570542b15 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -141,8 +141,7 @@ __END_DECLS static __inline int __istype(_BSD_RUNE_T_ _c, unsigned long _f) { - return (_c < 0 || _c & _CRMASK) ? !!(___runetype(_c) & _f) : - (_c >= _CACHED_RUNES) ? 0 : + return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) : !!(_CurrentRuneLocale->runetype[_c] & _f); } @@ -156,16 +155,14 @@ __isctype(_BSD_RUNE_T_ _c, unsigned long _f) static __inline _BSD_RUNE_T_ __toupper(_BSD_RUNE_T_ _c) { - return (_c < 0 || _c & _CRMASK) ? ___toupper(_c) : - (_c >= _CACHED_RUNES) ? _c : + return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } static __inline _BSD_RUNE_T_ __tolower(_BSD_RUNE_T_ _c) { - return (_c < 0 || _c & _CRMASK) ? ___tolower(_c) : - (_c >= _CACHED_RUNES) ? _c : + return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; }