Skip to content

Commit

Permalink
Oops, wrong version of digittoint fix was commited, step back to v1.8
Browse files Browse the repository at this point in the history
instead just remove '!!' to make digittoint() work and re-arrange
things a little
  • Loading branch information
Andrey A. Chernov authored and Andrey A. Chernov committed Sep 25, 1997
1 parent 9f05e73 commit 80fd925
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions include/_ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ int digittoint __P((int));
#endif
__END_DECLS

#define __istype(c,f) (__runeflags((c)) & (f))

#define isalnum(c) __istype((c), (_A|_D))
#define isalpha(c) __istype((c), _A)
#define iscntrl(c) __istype((c), _C)
Expand All @@ -108,7 +106,7 @@ __END_DECLS
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
#define toascii(c) ((c) & 0x7F)
#define digittoint(c) __runeflags((c))
#define digittoint(c) __istype((c), 0xFF)

/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
Expand Down Expand Up @@ -142,17 +140,17 @@ __END_DECLS
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
static __inline int
__runeflags(_BSD_CT_RUNE_T_ _c)
__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
_CurrentRuneLocale->runetype[_c];
return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
_CurrentRuneLocale->runetype[_c]) & _f;
}

static __inline int
__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
(_DefaultRuneLocale.runetype[_c] & _f);
(_DefaultRuneLocale.runetype[_c] & _f);
}

static __inline _BSD_CT_RUNE_T_
Expand All @@ -172,7 +170,7 @@ __tolower(_BSD_CT_RUNE_T_ _c)
#else /* not using inlines */

__BEGIN_DECLS
int __runeflags __P((_BSD_CT_RUNE_T_));
int __istype __P((_BSD_CT_RUNE_T_, unsigned long));
int __isctype __P((_BSD_CT_RUNE_T_, unsigned long));
_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_));
_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_));
Expand Down
14 changes: 6 additions & 8 deletions include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ int digittoint __P((int));
#endif
__END_DECLS

#define __istype(c,f) (__runeflags((c)) & (f))

#define isalnum(c) __istype((c), (_A|_D))
#define isalpha(c) __istype((c), _A)
#define iscntrl(c) __istype((c), _C)
Expand All @@ -108,7 +106,7 @@ __END_DECLS
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
#define toascii(c) ((c) & 0x7F)
#define digittoint(c) __runeflags((c))
#define digittoint(c) __istype((c), 0xFF)

/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
Expand Down Expand Up @@ -142,17 +140,17 @@ __END_DECLS
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
static __inline int
__runeflags(_BSD_CT_RUNE_T_ _c)
__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
_CurrentRuneLocale->runetype[_c];
return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
_CurrentRuneLocale->runetype[_c]) & _f;
}

static __inline int
__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
(_DefaultRuneLocale.runetype[_c] & _f);
(_DefaultRuneLocale.runetype[_c] & _f);
}

static __inline _BSD_CT_RUNE_T_
Expand All @@ -172,7 +170,7 @@ __tolower(_BSD_CT_RUNE_T_ _c)
#else /* not using inlines */

__BEGIN_DECLS
int __runeflags __P((_BSD_CT_RUNE_T_));
int __istype __P((_BSD_CT_RUNE_T_, unsigned long));
int __isctype __P((_BSD_CT_RUNE_T_, unsigned long));
_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_));
_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_));
Expand Down

0 comments on commit 80fd925

Please sign in to comment.