Skip to content

Commit

Permalink
Slightly simplify inlined functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey A. Chernov authored and Andrey A. Chernov committed Mar 25, 1996
1 parent 7871e36 commit f905bd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions include/_ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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];
}

Expand Down
9 changes: 3 additions & 6 deletions include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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];
}

Expand Down

0 comments on commit f905bd5

Please sign in to comment.