diff options
author | rsc <devnull@localhost> | 2005-10-31 16:42:32 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-10-31 16:42:32 +0000 |
commit | 74374cc8a40c450423785015c2e30d5a2ed2920c (patch) | |
tree | 1d8a5ca97056a320115a342fd251aa0cf0cda751 /src/cmd | |
parent | b330c942b468ab82fd8853590145187e859258cb (diff) | |
download | plan9port-74374cc8a40c450423785015c2e30d5a2ed2920c.tar.gz plan9port-74374cc8a40c450423785015c2e30d5a2ed2920c.tar.bz2 plan9port-74374cc8a40c450423785015c2e30d5a2ed2920c.zip |
ctype sign fixes (Tom Miller)
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/eqn/input.c | 4 | ||||
-rw-r--r-- | src/cmd/eqn/size.c | 4 | ||||
-rw-r--r-- | src/cmd/grap/input.c | 8 | ||||
-rw-r--r-- | src/cmd/grap/print.c | 2 | ||||
-rw-r--r-- | src/cmd/mk/archive.c | 2 | ||||
-rw-r--r-- | src/cmd/mk/rule.c | 1 | ||||
-rw-r--r-- | src/cmd/postscript/common/misc.c | 5 | ||||
-rw-r--r-- | src/cmd/troff/dwbinit.c | 5 | ||||
-rw-r--r-- | src/cmd/troff/n1.c | 5 | ||||
-rw-r--r-- | src/cmd/troff/n8.c | 3 |
10 files changed, 22 insertions, 17 deletions
diff --git a/src/cmd/eqn/input.c b/src/cmd/eqn/input.c index 85a57366..a7432f33 100644 --- a/src/cmd/eqn/input.c +++ b/src/cmd/eqn/input.c @@ -189,9 +189,9 @@ input(void) ERROR "argfp underflow" FATAL; popsrc(); goto loop; - } else if (c == '$' && isdigit(*srcp->sp)) { + } else if (c == '$' && isdigit((uchar)*srcp->sp)) { int n = 0; - while (isdigit(*srcp->sp)) + while (isdigit((uchar)*srcp->sp)) n = 10 * n + *srcp->sp++ - '0'; if (n > 0 && n <= MAXARGS) pushsrc(String, argfp->argstk[n-1]); diff --git a/src/cmd/eqn/size.c b/src/cmd/eqn/size.c index 59bf3f20..67d3dae8 100644 --- a/src/cmd/eqn/size.c +++ b/src/cmd/eqn/size.c @@ -13,7 +13,7 @@ void setsize(char *p) /* set size as found in p */ ps -= atoi(p+1); if (szstack[nszstack-1] != 0) szstack[nszstack] = ps; - } else if (isdigit(*p)) { + } else if (isdigit((uchar)*p)) { if (szstack[nszstack-1] == 0) printf(".nr %d \\n(.s\n", 99-nszstack); else @@ -52,7 +52,7 @@ void globsize(void) gsize -= atoi(temp+1); if (szstack[0] != 0) szstack[0] = gsize; - } else if (isdigit(temp[0])) { + } else if (isdigit((uchar)temp[0])) { gsize = atoi(temp); szstack[0] = gsize; printf(".nr 99 \\n(.s\n"); diff --git a/src/cmd/grap/input.c b/src/cmd/grap/input.c index 1e90cb9a..509fb01b 100644 --- a/src/cmd/grap/input.c +++ b/src/cmd/grap/input.c @@ -277,9 +277,9 @@ nextchar(void) ERROR "argfp underflow" FATAL; popsrc(); goto loop; - } else if (c == '$' && isdigit(*srcp->sp)) { /* $3 */ + } else if (c == '$' && isdigit((uchar)*srcp->sp)) { /* $3 */ int n = 0; - while (isdigit(*srcp->sp)) + while (isdigit((uchar)*srcp->sp)) n = 10 * n + *srcp->sp++ - '0'; if (n > 0 && n <= MAXARGS) pushsrc(String, argfp->argstk[n-1]); @@ -456,11 +456,11 @@ void eprint(void) /* try to print context around error */ for (q=ep-1; q>=p && *q!=' ' && *q!='\t' && *q!='\n'; q--) ; for (; p < q; p++) - if (isprint(*p)) + if (isprint((uchar)*p)) putc(*p, stderr); fprintf(stderr, " >>> "); for (; p < q; p++) - if (isprint(*p)) + if (isprint((uchar)*p)) putc(*p, stderr); fprintf(stderr, " <<< "); while (pb >= pbuf) diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c index 1ce32116..5a2e4e78 100644 --- a/src/cmd/grap/print.c +++ b/src/cmd/grap/print.c @@ -147,7 +147,7 @@ void graph(char *s) /* graph statement */ s++; if (c == '\0') ERROR "no name on graph statement" WARNING; - if (!isupper(s[0])) + if (!isupper((uchar)s[0])) ERROR "graph name %s must be capitalized", s WARNING; for (p=graphname; (c = *s) != ' ' && c != '\t' && c != '\0'; ) *p++ = *s++; diff --git a/src/cmd/mk/archive.c b/src/cmd/mk/archive.c index 07aa565f..9955b3fd 100644 --- a/src/cmd/mk/archive.c +++ b/src/cmd/mk/archive.c @@ -171,7 +171,7 @@ atimes(char *ar) continue; } goto skip; - }else if(strings && h.name[0]=='/' && isdigit(h.name[1])){ + }else if(strings && h.name[0]=='/' && isdigit((uchar)h.name[1])){ i = strtol(h.name+1, &p, 10); if(*p != ' ' || i >= strlen(strings)) goto skip; diff --git a/src/cmd/mk/rule.c b/src/cmd/mk/rule.c index d73595d2..8613955b 100644 --- a/src/cmd/mk/rule.c +++ b/src/cmd/mk/rule.c @@ -83,6 +83,7 @@ dumpr(char *s, Rule *r) Bprint(&bout, " prog='%s'", r->prog); Bprint(&bout, "\n\ttarget=%s: %s\n", r->target, wtos(r->tail, ' ')); Bprint(&bout, "\trecipe@%ld='%s'\n", r->recipe, r->recipe); +break; } } diff --git a/src/cmd/postscript/common/misc.c b/src/cmd/postscript/common/misc.c index aca58f0e..28120ea5 100644 --- a/src/cmd/postscript/common/misc.c +++ b/src/cmd/postscript/common/misc.c @@ -4,6 +4,7 @@ * */ +#include <u.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -170,10 +171,10 @@ str_convert(str, err) * */ - if ( ! isdigit(**str) ) + if ( ! isdigit((uchar)**str) ) return(err); - for ( i = 0; isdigit(**str); *str += 1 ) + for ( i = 0; isdigit((uchar)**str); *str += 1 ) i = 10 * i + **str - '0'; return(i); diff --git a/src/cmd/troff/dwbinit.c b/src/cmd/troff/dwbinit.c index 59f74ec8..9c1845b0 100644 --- a/src/cmd/troff/dwbinit.c +++ b/src/cmd/troff/dwbinit.c @@ -73,6 +73,7 @@ * */ +#include <u.h> #include <stdio.h> #include <ctype.h> #include <string.h> @@ -169,10 +170,10 @@ char *DWBhome(void) if ( (fp = fopen(DWBCONFIG, "r")) != NULL ) { len = strlen(DWBENV); while ( fgets(buf, sizeof(buf), fp) != NULL ) { - for ( ptr = buf; isspace(*ptr); ptr++ ) ; + for ( ptr = buf; isspace((uchar)*ptr); ptr++ ) ; if ( strncmp(ptr, DWBENV, len) == 0 && *(ptr+len) == '=' ) { path = ptr + len + 1; - for ( ptr = path; !isspace(*ptr) && *ptr != ';'; ptr++ ) ; + for ( ptr = path; !isspace((uchar)*ptr) && *ptr != ';'; ptr++ ) ; *ptr = '\0'; if ( home != NULL ) free(home); diff --git a/src/cmd/troff/n1.c b/src/cmd/troff/n1.c index 7fe87b63..4c2bec4b 100644 --- a/src/cmd/troff/n1.c +++ b/src/cmd/troff/n1.c @@ -5,6 +5,7 @@ * input routines, escape function calling */ +#include <u.h> #include "tdef.h" #include "fns.h" #include "ext.h" @@ -1091,10 +1092,10 @@ void getpn(char *a) continue; default: n = 0; - if (isdigit(*a)) { + if (isdigit((uchar)*a)) { do n = 10 * n + *a++ - '0'; - while (isdigit(*a)); + while (isdigit((uchar)*a)); a--; } else n = 9999; diff --git a/src/cmd/troff/n8.c b/src/cmd/troff/n8.c index ded45438..b2ab175b 100644 --- a/src/cmd/troff/n8.c +++ b/src/cmd/troff/n8.c @@ -1,3 +1,4 @@ +#include <u.h> #include "tdef.h" #include "fns.h" #include "ext.h" @@ -495,7 +496,7 @@ static void install(char *s) /* map ab4c5de to: 12 abcde \0 00405 \0 */ num[0] = '0'; *nextpat++ = ' '; /* fill in with count later */ for (npat = lastpat = 0; *s != '\n' && *s != '\0'; s++) { - if (isdigit(*s)) { + if (isdigit((uchar)*s)) { num[npat] = *s; lastpat = npat; } else { |