Fix a few more <ctype.h> instances

A few isolated instances of isalpha() and isxdigit().
This commit is contained in:
H. Peter Anvin 2008-06-21 11:03:51 -07:00
parent bda7a6e371
commit f221b9ee08
3 changed files with 9 additions and 7 deletions

6
nasm.h

@ -354,10 +354,10 @@ extern Preproc nasmpp;
* start.
*/
#define isidstart(c) ( isalpha(c) || (c)=='_' || (c)=='.' || (c)=='?' \
#define isidstart(c) ( nasm_isalpha(c) || (c)=='_' || (c)=='.' || (c)=='?' \
|| (c)=='@' )
#define isidchar(c) ( isidstart(c) || nasm_isdigit(c) || (c)=='$' || (c)=='#' \
|| (c)=='~' )
#define isidchar(c) ( isidstart(c) || nasm_isdigit(c) || \
(c)=='$' || (c)=='#' || (c)=='~' )
/* Ditto for numeric constants. */

@ -29,9 +29,11 @@ extern unsigned char nasm_tolower_tab[256];
/* Wrappers around <ctype.h> functions */
/* These are only valid for values that cannot include EOF */
#define nasm_isspace(x) isspace((unsigned char)(x))
#define nasm_isalnum(x) isalnum((unsigned char)(x))
#define nasm_isdigit(x) isdigit((unsigned char)(x))
#define nasm_isspace(x) isspace((unsigned char)(x))
#define nasm_isalpha(x) isalpha((unsigned char)(x))
#define nasm_isdigit(x) isdigit((unsigned char)(x))
#define nasm_isalnum(x) isalnum((unsigned char)(x))
#define nasm_isxdigit(x) isxdigit((unsigned char)(x))
/*
* If this is defined, the wrappers around malloc et al will

@ -882,7 +882,7 @@ static Token *tokenize(char *line)
while (*r == '_')
r++;
if (nasm_isdigit(*r) || (is_hex && isxdigit(*r)) ||
if (nasm_isdigit(*r) || (is_hex && nasm_isxdigit(*r)) ||
(!is_hex && (*r == 'e' || *r == 'E')) ||
(*r == 'p' || *r == 'P')) {
p = r;