diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-06-21 10:23:17 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-06-21 10:23:17 -0700 |
commit | bda7a6e3715b270ebb0854b3cef667976d241d96 (patch) | |
tree | 86e645d4e025b1dbf0169d0a4ce1c6ec602a15d5 /nasm.c | |
parent | 86877b294aabac1059d32611c8dce65910243454 (diff) | |
download | nasm-bda7a6e3715b270ebb0854b3cef667976d241d96.tar.gz nasm-bda7a6e3715b270ebb0854b3cef667976d241d96.tar.bz2 nasm-bda7a6e3715b270ebb0854b3cef667976d241d96.zip |
ctype.h: wrapper ctype functions with a cast to (unsigned char)
ctype functions take an *int*, which the user is expected to have
taken the input character from getc() and friends, or taken a
character and cast it to (unsigned char).
We don't care about EOF (-1), so use macros that cast to (unsigned
char) for us.
Diffstat (limited to 'nasm.c')
-rw-r--r-- | nasm.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -482,7 +482,7 @@ static char *get_param(char *p, char *q, bool *advance) *advance = false; if (p[2]) { /* the parameter's in the option */ p += 2; - while (isspace(*p)) + while (nasm_isspace(*p)) p++; return p; } @@ -1001,11 +1001,11 @@ static void process_respfile(FILE * rfile) */ *(p = &buffer[strcspn(buffer, "\r\n\032")]) = '\0'; - while (p > buffer && isspace(p[-1])) + while (p > buffer && nasm_isspace(p[-1])) *--p = '\0'; p = buffer; - while (isspace(*p)) + while (nasm_isspace(*p)) p++; if (process_arg(prevarg, p)) @@ -1310,7 +1310,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) validid = true; if (!isidstart(*p)) validid = false; - while (*p && !isspace(*p)) { + while (*p && !nasm_isspace(*p)) { if (!isidchar(*p)) validid = false; p++; @@ -1323,7 +1323,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) if (*p) { int64_t size; - while (*p && isspace(*p)) + while (*p && nasm_isspace(*p)) *p++ = '\0'; q = p; while (*q && *q != ':') @@ -1348,7 +1348,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) } else if (pass0 == 2) { /* pass == 2 */ q = value; while (*q && *q != ':') { - if (isspace(*q)) + if (nasm_isspace(*q)) *q = '\0'; q++; } @@ -1388,7 +1388,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) validid = true; if (!isidstart(*p)) validid = false; - while (*p && !isspace(*p)) { + while (*p && !nasm_isspace(*p)) { if (!isidchar(*p)) validid = false; *q++ = *p++; @@ -1399,14 +1399,14 @@ static void assemble_file(char *fname, StrList **depend_ptr) "identifier expected after DEBUG"); break; } - while (*p && isspace(*p)) + while (*p && nasm_isspace(*p)) p++; if (pass0 == 2) ofmt->current_dfmt->debug_directive(debugid, p); break; case D_WARNING: /* [WARNING {+|-}warn-name] */ if (pass1 == 1) { - while (*value && isspace(*value)) + while (*value && nasm_isspace(*value)) value++; if (*value == '+' || *value == '-') { @@ -1429,7 +1429,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) cpu = get_cpu(value); break; case D_LIST: /* [LIST {+|-}] */ - while (*value && isspace(*value)) + while (*value && nasm_isspace(*value)) value++; if (*value == '+') { @@ -1783,7 +1783,7 @@ static enum directives getkw(char **directive, char **value) q = p++; while (*p && *p != ';') { - if (!isspace(*p)) + if (!nasm_isspace(*p)) return 0; p++; } @@ -1797,7 +1797,7 @@ static enum directives getkw(char **directive, char **value) *value = buf; } else { *buf++ = '\0'; - while (isspace(*buf)) + while (nasm_isspace(*buf)) buf++; /* beppu - skip leading whitespace */ *value = buf; while (*buf != ']') |