summaryrefslogtreecommitdiffstats
path: root/contrib/awk
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-10-26 12:14:54 +0000
committerache <ache@FreeBSD.org>1997-10-26 12:14:54 +0000
commit105ae2c382b7a2c0420be6bd7b24da661805d6d2 (patch)
tree39b4d1af3e193a0ac6091c29ec198e975aeec4ba /contrib/awk
parent1433c9c29edb81cd29e7e2b588d73ec32b9698b6 (diff)
downloadFreeBSD-src-105ae2c382b7a2c0420be6bd7b24da661805d6d2.zip
FreeBSD-src-105ae2c382b7a2c0420be6bd7b24da661805d6d2.tar.gz
Back out (unsigned char) cast, will use -funsigned-char instead
Diffstat (limited to 'contrib/awk')
-rw-r--r--contrib/awk/awk.h28
-rw-r--r--contrib/awk/builtin.c4
-rw-r--r--contrib/awk/dfa.c16
-rw-r--r--contrib/awk/eval.c6
-rw-r--r--contrib/awk/field.c6
-rw-r--r--contrib/awk/io.c14
-rw-r--r--contrib/awk/main.c4
-rw-r--r--contrib/awk/node.c6
8 files changed, 42 insertions, 42 deletions
diff --git a/contrib/awk/awk.h b/contrib/awk/awk.h
index b87a645..3ab2015 100644
--- a/contrib/awk/awk.h
+++ b/contrib/awk/awk.h
@@ -65,30 +65,30 @@ extern int errno;
#if defined(STDC_HEADERS) || (!defined(isascii) && !defined(HAVE_ISASCII))
#define ISASCII(c) 1
#else
-#define ISASCII(c) isascii((unsigned char)c)
+#define ISASCII(c) isascii(c)
#endif
#ifdef isblank
-#define ISBLANK(c) (ISASCII(c) && isblank((unsigned char)c))
+#define ISBLANK(c) (ISASCII(c) && isblank(c))
#else
#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef isgraph
-#define ISGRAPH(c) (ISASCII(c) && isgraph((unsigned char)c))
+#define ISGRAPH(c) (ISASCII(c) && isgraph(c))
#else
-#define ISGRAPH(c) (ISASCII(c) && isprint((unsigned char)c) && !isspace((unsigned char)c))
+#define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c))
#endif
-#define ISPRINT(c) (ISASCII (c) && isprint ((unsigned char)c))
-#define ISDIGIT(c) (ISASCII (c) && isdigit ((unsigned char)c))
-#define ISALNUM(c) (ISASCII (c) && isalnum ((unsigned char)c))
-#define ISALPHA(c) (ISASCII (c) && isalpha ((unsigned char)c))
-#define ISCNTRL(c) (ISASCII (c) && iscntrl ((unsigned char)c))
-#define ISLOWER(c) (ISASCII (c) && islower ((unsigned char)c))
-#define ISPUNCT(c) (ISASCII (c) && ispunct ((unsigned char)c))
-#define ISSPACE(c) (ISASCII (c) && isspace ((unsigned char)c))
-#define ISUPPER(c) (ISASCII (c) && isupper ((unsigned char)c))
-#define ISXDIGIT(c) (ISASCII (c) && isxdigit ((unsigned char)c))
+#define ISPRINT(c) (ISASCII (c) && isprint (c))
+#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
+#define ISALNUM(c) (ISASCII (c) && isalnum (c))
+#define ISALPHA(c) (ISASCII (c) && isalpha (c))
+#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
+#define ISLOWER(c) (ISASCII (c) && islower (c))
+#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
+#define ISSPACE(c) (ISASCII (c) && isspace (c))
+#define ISUPPER(c) (ISASCII (c) && isupper (c))
+#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
#ifdef __STDC__
diff --git a/contrib/awk/builtin.c b/contrib/awk/builtin.c
index 32bde1c..dc2c1d3 100644
--- a/contrib/awk/builtin.c
+++ b/contrib/awk/builtin.c
@@ -231,7 +231,7 @@ NODE *tree;
while (l1 > 0) {
if (l2 > l1)
break;
- if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2]
+ if (casetable[(int)*p1] == casetable[(int)*p2]
&& (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) {
ret = 1 + s1->stlen - l1;
break;
@@ -2038,7 +2038,7 @@ size_t len;
}
} else if (*str == '0') {
for (; len > 0; len--) {
- if (! isdigit((unsigned char)*str) || *str == '8' || *str == '9')
+ if (! isdigit(*str) || *str == '8' || *str == '9')
goto done;
retval = (retval * 8) + (*str - '0');
str++;
diff --git a/contrib/awk/dfa.c b/contrib/awk/dfa.c
index 72ef552..88e8e3e 100644
--- a/contrib/awk/dfa.c
+++ b/contrib/awk/dfa.c
@@ -736,9 +736,9 @@ lex()
setbit(c3, ccl);
if (case_fold)
if (ISUPPER(c3))
- setbit(tolower((unsigned char)c3), ccl);
+ setbit(tolower(c3), ccl);
else if (ISLOWER(c3))
- setbit(toupper((unsigned char)c3), ccl);
+ setbit(toupper(c3), ccl);
}
}
#else
@@ -747,9 +747,9 @@ lex()
setbit(c, ccl);
if (case_fold)
if (ISUPPER(c))
- setbit(tolower((unsigned char)c), ccl);
+ setbit(tolower(c), ccl);
else if (ISLOWER(c))
- setbit(toupper((unsigned char)c), ccl);
+ setbit(toupper(c), ccl);
++c;
}
#endif
@@ -773,10 +773,10 @@ lex()
{
zeroset(ccl);
setbit(c, ccl);
- if (isupper((unsigned char)c))
- setbit(tolower((unsigned char)c), ccl);
+ if (isupper(c))
+ setbit(tolower(c), ccl);
else
- setbit(toupper((unsigned char)c), ccl);
+ setbit(toupper(c), ccl);
return lasttok = CSET + charclass_index(ccl);
}
return c;
@@ -2047,7 +2047,7 @@ dfacomp(s, len, d, searchflag)
case_fold = 0;
for (i = 0; i < len; ++i)
if (ISUPPER(s[i]))
- lcopy[i] = tolower((unsigned char)s[i]);
+ lcopy[i] = tolower(s[i]);
else
lcopy[i] = s[i];
diff --git a/contrib/awk/eval.c b/contrib/awk/eval.c
index 6ba00f6a..aa2e881 100644
--- a/contrib/awk/eval.c
+++ b/contrib/awk/eval.c
@@ -1652,13 +1652,13 @@ NODE *n;
return 0;
while (*p && strchr(" +-#", *p) != NULL) /* flags */
p++;
- while (*p && isdigit((unsigned char)*p)) /* width - %*.*g is NOT allowed */
+ while (*p && isdigit(*p)) /* width - %*.*g is NOT allowed */
p++;
- if (*p == '\0' || (*p != '.' && ! isdigit((unsigned char)*p)))
+ if (*p == '\0' || (*p != '.' && ! isdigit(*p)))
return 0;
if (*p == '.')
p++;
- while (*p && isdigit((unsigned char)*p)) /* precision */
+ while (*p && isdigit(*p)) /* precision */
p++;
if (*p == '\0' || strchr("efgEG", *p) == NULL)
return 0;
diff --git a/contrib/awk/field.c b/contrib/awk/field.c
index 81ee121..31c9628 100644
--- a/contrib/awk/field.c
+++ b/contrib/awk/field.c
@@ -550,9 +550,9 @@ NODE *n;
else
fschar = fs->stptr[0];
- onecase = (IGNORECASE && isalpha((unsigned char)fschar));
+ onecase = (IGNORECASE && isalpha(fschar));
if (onecase)
- fschar = casetable[(unsigned char) fschar];
+ fschar = casetable[(int) fschar];
/* before doing anything save the char at *end */
sav = *end;
@@ -562,7 +562,7 @@ NODE *n;
for (; nf < up_to;) {
field = scan;
if (onecase) {
- while (casetable[(unsigned char) *scan] != fschar)
+ while (casetable[(int) *scan] != fschar)
scan++;
} else {
while (*scan != fschar)
diff --git a/contrib/awk/io.c b/contrib/awk/io.c
index 5db2796..74d9a8d 100644
--- a/contrib/awk/io.c
+++ b/contrib/awk/io.c
@@ -1540,9 +1540,9 @@ int *errcode; /* pointer to error variable */
else
rs = (char) grRS;
- onecase = (IGNORECASE && isalpha((unsigned char)rs));
+ onecase = (IGNORECASE && isalpha(rs));
if (onecase)
- rs = casetable[(unsigned char)rs];
+ rs = casetable[rs];
/* set up sentinel */
if (iop->buf) {
@@ -1703,7 +1703,7 @@ int *errcode; /* pointer to error variable */
}
/* search for RS, #2, RS = <single char> */
if (onecase) {
- while (casetable[(unsigned char) *bp++] != rs)
+ while (casetable[(int) *bp++] != rs)
continue;
} else {
while (*bp++ != rs)
@@ -1732,7 +1732,7 @@ int *errcode; /* pointer to error variable */
bstart = iop->off = bp;
bp--;
- if (onecase ? casetable[(unsigned char) *bp] != rs : *bp != rs) {
+ if (onecase ? casetable[(int) *bp] != rs : *bp != rs) {
bp++;
bstart = bp;
}
@@ -1816,9 +1816,9 @@ int *errcode; /* pointer to error variable */
else
rs = (char) grRS;
- onecase = (IGNORECASE && isalpha((unsigned char)rs));
+ onecase = (IGNORECASE && isalpha(rs));
if (onecase)
- rs = casetable[(unsigned char)rs];
+ rs = casetable[rs];
/* if RS = "", skip leading newlines at the front of the file */
if (grRS == FALSE && iop->off == iop->buf) {
@@ -1891,7 +1891,7 @@ int *errcode; /* pointer to error variable */
*/
/* search for RS, #2, RS = <single char> */
if (onecase) {
- while (bp < end && casetable[(unsigned char)*bp++] != rs)
+ while (bp < end && casetable[*bp++] != rs)
continue;
} else {
while (bp < end && *bp++ != rs)
diff --git a/contrib/awk/main.c b/contrib/awk/main.c
index 35fb119..92445de 100644
--- a/contrib/awk/main.c
+++ b/contrib/awk/main.c
@@ -644,11 +644,11 @@ char *arg;
*cp++ = '\0';
/* first check that the variable name has valid syntax */
badvar = FALSE;
- if (! isalpha((unsigned char)arg[0]) && arg[0] != '_')
+ if (! isalpha(arg[0]) && arg[0] != '_')
badvar = TRUE;
else
for (cp2 = arg+1; *cp2; cp2++)
- if (! isalnum((unsigned char)*cp2) && *cp2 != '_') {
+ if (! isalnum(*cp2) && *cp2 != '_') {
badvar = TRUE;
break;
}
diff --git a/contrib/awk/node.c b/contrib/awk/node.c
index 98df143..6f10b9f 100644
--- a/contrib/awk/node.c
+++ b/contrib/awk/node.c
@@ -61,9 +61,9 @@ register NODE *n;
return 0.0;
cpend = cp + n->stlen;
- while (cp < cpend && isspace((unsigned char)*cp))
+ while (cp < cpend && isspace(*cp))
cp++;
- if (cp == cpend || isalpha((unsigned char)*cp))
+ if (cp == cpend || isalpha(*cp))
return 0.0;
if (n->flags & MAYBE_NUM) {
@@ -489,7 +489,7 @@ char **string_ptr;
}
if (do_posix)
return ('x');
- if (! isxdigit((unsigned char)(*string_ptr)[0])) {
+ if (! isxdigit((*string_ptr)[0])) {
warning("no hex digits in \\x escape sequence");
return ('x');
}
OpenPOWER on IntegriCloud