Slightly simplify inlined functions

This commit is contained in:
Andrey A. Chernov 1996-03-25 13:46:21 +00:00
parent 7871e36865
commit f905bd5001
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14813
2 changed files with 6 additions and 12 deletions

View File

@ -141,8 +141,7 @@ __END_DECLS
static __inline int static __inline int
__istype(_BSD_RUNE_T_ _c, unsigned long _f) __istype(_BSD_RUNE_T_ _c, unsigned long _f)
{ {
return (_c < 0 || _c & _CRMASK) ? !!(___runetype(_c) & _f) : return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) :
(_c >= _CACHED_RUNES) ? 0 :
!!(_CurrentRuneLocale->runetype[_c] & _f); !!(_CurrentRuneLocale->runetype[_c] & _f);
} }
@ -156,16 +155,14 @@ __isctype(_BSD_RUNE_T_ _c, unsigned long _f)
static __inline _BSD_RUNE_T_ static __inline _BSD_RUNE_T_
__toupper(_BSD_RUNE_T_ _c) __toupper(_BSD_RUNE_T_ _c)
{ {
return (_c < 0 || _c & _CRMASK) ? ___toupper(_c) : return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
(_c >= _CACHED_RUNES) ? _c :
_CurrentRuneLocale->mapupper[_c]; _CurrentRuneLocale->mapupper[_c];
} }
static __inline _BSD_RUNE_T_ static __inline _BSD_RUNE_T_
__tolower(_BSD_RUNE_T_ _c) __tolower(_BSD_RUNE_T_ _c)
{ {
return (_c < 0 || _c & _CRMASK) ? ___tolower(_c) : return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
(_c >= _CACHED_RUNES) ? _c :
_CurrentRuneLocale->maplower[_c]; _CurrentRuneLocale->maplower[_c];
} }

View File

@ -141,8 +141,7 @@ __END_DECLS
static __inline int static __inline int
__istype(_BSD_RUNE_T_ _c, unsigned long _f) __istype(_BSD_RUNE_T_ _c, unsigned long _f)
{ {
return (_c < 0 || _c & _CRMASK) ? !!(___runetype(_c) & _f) : return (_c < 0 || _c >= _CACHED_RUNES) ? !!(___runetype(_c) & _f) :
(_c >= _CACHED_RUNES) ? 0 :
!!(_CurrentRuneLocale->runetype[_c] & _f); !!(_CurrentRuneLocale->runetype[_c] & _f);
} }
@ -156,16 +155,14 @@ __isctype(_BSD_RUNE_T_ _c, unsigned long _f)
static __inline _BSD_RUNE_T_ static __inline _BSD_RUNE_T_
__toupper(_BSD_RUNE_T_ _c) __toupper(_BSD_RUNE_T_ _c)
{ {
return (_c < 0 || _c & _CRMASK) ? ___toupper(_c) : return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
(_c >= _CACHED_RUNES) ? _c :
_CurrentRuneLocale->mapupper[_c]; _CurrentRuneLocale->mapupper[_c];
} }
static __inline _BSD_RUNE_T_ static __inline _BSD_RUNE_T_
__tolower(_BSD_RUNE_T_ _c) __tolower(_BSD_RUNE_T_ _c)
{ {
return (_c < 0 || _c & _CRMASK) ? ___tolower(_c) : return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
(_c >= _CACHED_RUNES) ? _c :
_CurrentRuneLocale->maplower[_c]; _CurrentRuneLocale->maplower[_c];
} }