From 3bd56b04a8bab7208494fd7dc74af5528fc41604 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 9 Sep 2005 23:16:15 +0000 Subject: NetBSD-macppc ctype needs uchars. --- src/cmd/dict/dict.c | 4 ++-- src/cmd/dict/roget.c | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/cmd/dict') diff --git a/src/cmd/dict/dict.c b/src/cmd/dict/dict.c index 6704775a..0a2cf4f3 100644 --- a/src/cmd/dict/dict.c +++ b/src/cmd/dict/dict.c @@ -301,14 +301,14 @@ parseaddr(char *line, char **eptr) } else if(*line == '#') { /* absolute byte offset into dictionary */ line++; - if(!isdigit(*line)) + if(!isdigit((uchar)*line)) return -1; v = strtoul(line, &e, 10); line = e; dot->doff[0] = v; dot->n = 1; dot->cur = 0; - } else if(isdigit(*line)) { + } else if(isdigit((uchar)*line)) { v = strtoul(line, &e, 10); line = e; if(v < 1 || v > dot->n) diff --git a/src/cmd/dict/roget.c b/src/cmd/dict/roget.c index 16bfeae5..d9536365 100644 --- a/src/cmd/dict/roget.c +++ b/src/cmd/dict/roget.c @@ -18,10 +18,10 @@ rogetprintentry(Entry e, int cmd) p = e.start; if(cmd == 'h'){ - while(!isspace(*p) && p < e.end) + while(!isspace((uchar)*p) && p < e.end) p++; while(strncmp(p, " -- ", 4) != 0 && p < e.end){ - while(isspace(*p) && p < e.end) + while(isspace((uchar)*p) && p < e.end) p++; if (*p == '[' || *p == '{'){ c = (*p == '[')? ']': '}'; @@ -30,14 +30,14 @@ rogetprintentry(Entry e, int cmd) p++; continue; } - if (isdigit(*p) || ispunct(*p)){ - while(!isspace(*p) && p < e.end) + if (isdigit((uchar)*p) || ispunct((uchar)*p)){ + while(!isspace((uchar)*p) && p < e.end) p++; continue; } - if (isspace(*p)) + if (isspace((uchar)*p)) spc = 1; else if (spc){ @@ -45,15 +45,15 @@ rogetprintentry(Entry e, int cmd) spc = 0; } - while(!isspace(*p) && p < e.end) + while(!isspace((uchar)*p) && p < e.end) outchar(*p++); } return; } - while(p < e.end && !isspace(*p)) + while(p < e.end && !isspace((uchar)*p)) p++; - while(p < e.end && isspace(*p)) + while(p < e.end && isspace((uchar)*p)) p++; while (p < e.end){ @@ -78,18 +78,18 @@ rogetprintentry(Entry e, int cmd) while(p < e.end && *p != ')') outchar(*p++); p++; - while(p < e.end && isspace(*p)) + while(p < e.end && isspace((uchar)*p)) p++; - while(p < e.end && isdigit(*p)) + while(p < e.end && isdigit((uchar)*p)) p++; outchar('/'); continue; } if (p < e.end -3 && strncmp(p, "&c ", 3) == 0){ /* less usefull xref */ - while(p < e.end && !isdigit(*p)) + while(p < e.end && !isdigit((uchar)*p)) p++; - while(p < e.end && isdigit(*p)) + while(p < e.end && isdigit((uchar)*p)) p++; continue; } @@ -97,8 +97,8 @@ rogetprintentry(Entry e, int cmd) if (*p == '\n' && p < (e.end -1)){ /* their newlines */ spc = 0; p++; - if (isspace(*p)){ /* their continuation line */ - while (isspace(*p)) + if (isspace((uchar)*p)){ /* their continuation line */ + while (isspace((uchar)*p)) p++; p--; } @@ -107,11 +107,11 @@ rogetprintentry(Entry e, int cmd) } } if (spc && *p != ';' && *p != '.' && - *p != ',' && !isspace(*p)){ /* drop spaces before punct */ + *p != ',' && !isspace((uchar)*p)){ /* drop spaces before punct */ spc = 0; outchar(' '); } - if (isspace(*p)) + if (isspace((uchar)*p)) spc = 1; else outchar(*p); @@ -131,7 +131,7 @@ rogetnextoff(long fromoff) Brdline(bdict, '\n'); while ((p = Brdline(bdict, '\n')) != nil){ l = Blinelen(bdict); - if (!isdigit(*p)) + if (!isdigit((uchar)*p)) continue; for (i = 0; i < l-4; i++) if (strncmp(p+i, " -- ", 4) == 0) -- cgit v1.2.3