Back out (unsigned char) cast, will use -funsigned-char instead

This commit is contained in:
ache 1997-10-26 12:14:54 +00:00
parent 9831b5e7b6
commit 1dde52fdd5
8 changed files with 42 additions and 42 deletions

View File

@ -65,30 +65,30 @@ extern int errno;
#if defined(STDC_HEADERS) || (!defined(isascii) && !defined(HAVE_ISASCII)) #if defined(STDC_HEADERS) || (!defined(isascii) && !defined(HAVE_ISASCII))
#define ISASCII(c) 1 #define ISASCII(c) 1
#else #else
#define ISASCII(c) isascii((unsigned char)c) #define ISASCII(c) isascii(c)
#endif #endif
#ifdef isblank #ifdef isblank
#define ISBLANK(c) (ISASCII(c) && isblank((unsigned char)c)) #define ISBLANK(c) (ISASCII(c) && isblank(c))
#else #else
#define ISBLANK(c) ((c) == ' ' || (c) == '\t') #define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#endif #endif
#ifdef isgraph #ifdef isgraph
#define ISGRAPH(c) (ISASCII(c) && isgraph((unsigned char)c)) #define ISGRAPH(c) (ISASCII(c) && isgraph(c))
#else #else
#define ISGRAPH(c) (ISASCII(c) && isprint((unsigned char)c) && !isspace((unsigned char)c)) #define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c))
#endif #endif
#define ISPRINT(c) (ISASCII (c) && isprint ((unsigned char)c)) #define ISPRINT(c) (ISASCII (c) && isprint (c))
#define ISDIGIT(c) (ISASCII (c) && isdigit ((unsigned char)c)) #define ISDIGIT(c) (ISASCII (c) && isdigit (c))
#define ISALNUM(c) (ISASCII (c) && isalnum ((unsigned char)c)) #define ISALNUM(c) (ISASCII (c) && isalnum (c))
#define ISALPHA(c) (ISASCII (c) && isalpha ((unsigned char)c)) #define ISALPHA(c) (ISASCII (c) && isalpha (c))
#define ISCNTRL(c) (ISASCII (c) && iscntrl ((unsigned char)c)) #define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
#define ISLOWER(c) (ISASCII (c) && islower ((unsigned char)c)) #define ISLOWER(c) (ISASCII (c) && islower (c))
#define ISPUNCT(c) (ISASCII (c) && ispunct ((unsigned char)c)) #define ISPUNCT(c) (ISASCII (c) && ispunct (c))
#define ISSPACE(c) (ISASCII (c) && isspace ((unsigned char)c)) #define ISSPACE(c) (ISASCII (c) && isspace (c))
#define ISUPPER(c) (ISASCII (c) && isupper ((unsigned char)c)) #define ISUPPER(c) (ISASCII (c) && isupper (c))
#define ISXDIGIT(c) (ISASCII (c) && isxdigit ((unsigned char)c)) #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
#ifdef __STDC__ #ifdef __STDC__

View File

@ -231,7 +231,7 @@ NODE *tree;
while (l1 > 0) { while (l1 > 0) {
if (l2 > l1) if (l2 > l1)
break; break;
if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] if (casetable[(int)*p1] == casetable[(int)*p2]
&& (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) {
ret = 1 + s1->stlen - l1; ret = 1 + s1->stlen - l1;
break; break;
@ -2038,7 +2038,7 @@ size_t len;
} }
} else if (*str == '0') { } else if (*str == '0') {
for (; len > 0; len--) { for (; len > 0; len--) {
if (! isdigit((unsigned char)*str) || *str == '8' || *str == '9') if (! isdigit(*str) || *str == '8' || *str == '9')
goto done; goto done;
retval = (retval * 8) + (*str - '0'); retval = (retval * 8) + (*str - '0');
str++; str++;

View File

@ -736,9 +736,9 @@ lex()
setbit(c3, ccl); setbit(c3, ccl);
if (case_fold) if (case_fold)
if (ISUPPER(c3)) if (ISUPPER(c3))
setbit(tolower((unsigned char)c3), ccl); setbit(tolower(c3), ccl);
else if (ISLOWER(c3)) else if (ISLOWER(c3))
setbit(toupper((unsigned char)c3), ccl); setbit(toupper(c3), ccl);
} }
} }
#else #else
@ -747,9 +747,9 @@ lex()
setbit(c, ccl); setbit(c, ccl);
if (case_fold) if (case_fold)
if (ISUPPER(c)) if (ISUPPER(c))
setbit(tolower((unsigned char)c), ccl); setbit(tolower(c), ccl);
else if (ISLOWER(c)) else if (ISLOWER(c))
setbit(toupper((unsigned char)c), ccl); setbit(toupper(c), ccl);
++c; ++c;
} }
#endif #endif
@ -773,10 +773,10 @@ lex()
{ {
zeroset(ccl); zeroset(ccl);
setbit(c, ccl); setbit(c, ccl);
if (isupper((unsigned char)c)) if (isupper(c))
setbit(tolower((unsigned char)c), ccl); setbit(tolower(c), ccl);
else else
setbit(toupper((unsigned char)c), ccl); setbit(toupper(c), ccl);
return lasttok = CSET + charclass_index(ccl); return lasttok = CSET + charclass_index(ccl);
} }
return c; return c;
@ -2047,7 +2047,7 @@ dfacomp(s, len, d, searchflag)
case_fold = 0; case_fold = 0;
for (i = 0; i < len; ++i) for (i = 0; i < len; ++i)
if (ISUPPER(s[i])) if (ISUPPER(s[i]))
lcopy[i] = tolower((unsigned char)s[i]); lcopy[i] = tolower(s[i]);
else else
lcopy[i] = s[i]; lcopy[i] = s[i];

View File

@ -1652,13 +1652,13 @@ NODE *n;
return 0; return 0;
while (*p && strchr(" +-#", *p) != NULL) /* flags */ while (*p && strchr(" +-#", *p) != NULL) /* flags */
p++; p++;
while (*p && isdigit((unsigned char)*p)) /* width - %*.*g is NOT allowed */ while (*p && isdigit(*p)) /* width - %*.*g is NOT allowed */
p++; p++;
if (*p == '\0' || (*p != '.' && ! isdigit((unsigned char)*p))) if (*p == '\0' || (*p != '.' && ! isdigit(*p)))
return 0; return 0;
if (*p == '.') if (*p == '.')
p++; p++;
while (*p && isdigit((unsigned char)*p)) /* precision */ while (*p && isdigit(*p)) /* precision */
p++; p++;
if (*p == '\0' || strchr("efgEG", *p) == NULL) if (*p == '\0' || strchr("efgEG", *p) == NULL)
return 0; return 0;

View File

@ -550,9 +550,9 @@ NODE *n;
else else
fschar = fs->stptr[0]; fschar = fs->stptr[0];
onecase = (IGNORECASE && isalpha((unsigned char)fschar)); onecase = (IGNORECASE && isalpha(fschar));
if (onecase) if (onecase)
fschar = casetable[(unsigned char) fschar]; fschar = casetable[(int) fschar];
/* before doing anything save the char at *end */ /* before doing anything save the char at *end */
sav = *end; sav = *end;
@ -562,7 +562,7 @@ NODE *n;
for (; nf < up_to;) { for (; nf < up_to;) {
field = scan; field = scan;
if (onecase) { if (onecase) {
while (casetable[(unsigned char) *scan] != fschar) while (casetable[(int) *scan] != fschar)
scan++; scan++;
} else { } else {
while (*scan != fschar) while (*scan != fschar)

View File

@ -1540,9 +1540,9 @@ int *errcode; /* pointer to error variable */
else else
rs = (char) grRS; rs = (char) grRS;
onecase = (IGNORECASE && isalpha((unsigned char)rs)); onecase = (IGNORECASE && isalpha(rs));
if (onecase) if (onecase)
rs = casetable[(unsigned char)rs]; rs = casetable[rs];
/* set up sentinel */ /* set up sentinel */
if (iop->buf) { if (iop->buf) {
@ -1703,7 +1703,7 @@ int *errcode; /* pointer to error variable */
} }
/* search for RS, #2, RS = <single char> */ /* search for RS, #2, RS = <single char> */
if (onecase) { if (onecase) {
while (casetable[(unsigned char) *bp++] != rs) while (casetable[(int) *bp++] != rs)
continue; continue;
} else { } else {
while (*bp++ != rs) while (*bp++ != rs)
@ -1732,7 +1732,7 @@ int *errcode; /* pointer to error variable */
bstart = iop->off = bp; bstart = iop->off = bp;
bp--; bp--;
if (onecase ? casetable[(unsigned char) *bp] != rs : *bp != rs) { if (onecase ? casetable[(int) *bp] != rs : *bp != rs) {
bp++; bp++;
bstart = bp; bstart = bp;
} }
@ -1816,9 +1816,9 @@ int *errcode; /* pointer to error variable */
else else
rs = (char) grRS; rs = (char) grRS;
onecase = (IGNORECASE && isalpha((unsigned char)rs)); onecase = (IGNORECASE && isalpha(rs));
if (onecase) if (onecase)
rs = casetable[(unsigned char)rs]; rs = casetable[rs];
/* if RS = "", skip leading newlines at the front of the file */ /* if RS = "", skip leading newlines at the front of the file */
if (grRS == FALSE && iop->off == iop->buf) { if (grRS == FALSE && iop->off == iop->buf) {
@ -1891,7 +1891,7 @@ int *errcode; /* pointer to error variable */
*/ */
/* search for RS, #2, RS = <single char> */ /* search for RS, #2, RS = <single char> */
if (onecase) { if (onecase) {
while (bp < end && casetable[(unsigned char)*bp++] != rs) while (bp < end && casetable[*bp++] != rs)
continue; continue;
} else { } else {
while (bp < end && *bp++ != rs) while (bp < end && *bp++ != rs)

View File

@ -644,11 +644,11 @@ char *arg;
*cp++ = '\0'; *cp++ = '\0';
/* first check that the variable name has valid syntax */ /* first check that the variable name has valid syntax */
badvar = FALSE; badvar = FALSE;
if (! isalpha((unsigned char)arg[0]) && arg[0] != '_') if (! isalpha(arg[0]) && arg[0] != '_')
badvar = TRUE; badvar = TRUE;
else else
for (cp2 = arg+1; *cp2; cp2++) for (cp2 = arg+1; *cp2; cp2++)
if (! isalnum((unsigned char)*cp2) && *cp2 != '_') { if (! isalnum(*cp2) && *cp2 != '_') {
badvar = TRUE; badvar = TRUE;
break; break;
} }

View File

@ -61,9 +61,9 @@ register NODE *n;
return 0.0; return 0.0;
cpend = cp + n->stlen; cpend = cp + n->stlen;
while (cp < cpend && isspace((unsigned char)*cp)) while (cp < cpend && isspace(*cp))
cp++; cp++;
if (cp == cpend || isalpha((unsigned char)*cp)) if (cp == cpend || isalpha(*cp))
return 0.0; return 0.0;
if (n->flags & MAYBE_NUM) { if (n->flags & MAYBE_NUM) {
@ -489,7 +489,7 @@ char **string_ptr;
} }
if (do_posix) if (do_posix)
return ('x'); return ('x');
if (! isxdigit((unsigned char)(*string_ptr)[0])) { if (! isxdigit((*string_ptr)[0])) {
warning("no hex digits in \\x escape sequence"); warning("no hex digits in \\x escape sequence");
return ('x'); return ('x');
} }