tctype sign fixes (Tom Miller) - plan9port - [fork] Plan 9 from user space | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 74374cc8a40c450423785015c2e30d5a2ed2920c | |
parent b330c942b468ab82fd8853590145187e859258cb | |
Author: rsc <devnull@localhost> | |
Date: Mon, 31 Oct 2005 16:42:32 +0000 | |
ctype sign fixes (Tom Miller) | |
Diffstat: | |
M src/cmd/eqn/input.c | 4 ++-- | |
M src/cmd/eqn/size.c | 4 ++-- | |
M src/cmd/grap/input.c | 8 ++++---- | |
M src/cmd/grap/print.c | 2 +- | |
M src/cmd/mk/archive.c | 2 +- | |
M src/cmd/mk/rule.c | 1 + | |
M src/cmd/postscript/common/misc.c | 5 +++-- | |
M src/cmd/troff/dwbinit.c | 5 +++-- | |
M src/cmd/troff/n1.c | 5 +++-- | |
M 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 | |
t@@ -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 | |
t@@ -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 | |
t@@ -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 | |
t@@ -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)) { /* … | |
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]); | |
t@@ -456,11 +456,11 @@ void eprint(void) /* try to print context around … | |
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 | |
t@@ -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 | |
t@@ -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 | |
t@@ -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 | |
t@@ -4,6 +4,7 @@ | |
* | |
*/ | |
+#include <u.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
t@@ -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 | |
t@@ -73,6 +73,7 @@ | |
* | |
*/ | |
+#include <u.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
t@@ -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 | |
t@@ -5,6 +5,7 @@ | |
* input routines, escape function calling | |
*/ | |
+#include <u.h> | |
#include "tdef.h" | |
#include "fns.h" | |
#include "ext.h" | |
t@@ -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 | |
t@@ -1,3 +1,4 @@ | |
+#include <u.h> | |
#include "tdef.h" | |
#include "fns.h" | |
#include "ext.h" | |
t@@ -495,7 +496,7 @@ static void install(char *s) /* map ab4c5de to: 12 … | |
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 { |