commit 3bd56b04a8bab7208494fd7dc74af5528fc41604 from: rsc date: Fri Sep 09 23:16:15 2005 UTC NetBSD-macppc ctype needs uchars. commit - 94d85bc000866ecb4874e0e5bdcf30de4a84862e commit + 3bd56b04a8bab7208494fd7dc74af5528fc41604 blob - b77e9eb91f6f878ad1b0599ef001b2cb3409427d blob + d3504ff946585bf8d1bc893856fcc60d8afc00c1 --- src/cmd/9660/dump.c +++ src/cmd/9660/dump.c @@ -456,7 +456,7 @@ static int isalldigit(char *s) { while(*s) - if(!isdigit(*s++)) + if(!isdigit((uchar)*s++)) return 0; return 1; } blob - 35b0c0564162f769fc5393fb6f94a400677b6e8c blob + 3b2b5367faa608b691c1937cbec7fd02507291aa --- src/cmd/9660/ichar.c +++ src/cmd/9660/ichar.c @@ -25,8 +25,7 @@ isostring(uchar *buf, int len) while(len > 0 && p[len-1] == ' ') p[--len] = '\0'; for(q=p; *q; q++) - *q = tolower(*q); - + *q = tolower((uchar)*q); q = atom(p); free(p); return q; blob - 16fb21f3d1a2a14d8add8754d8e33a4608314ece blob + ebf944e2041452864aec725c656783aff39f4c6c --- src/cmd/9660/util.c +++ src/cmd/9660/util.c @@ -78,7 +78,7 @@ struprcpy(char *p, char *s) op = p; for(; *s; s++) - *p++ = toupper(*s); + *p++ = toupper((uchar)*s); *p = '\0'; return op; blob - d978407fd8effd2c9c93c534decb5b7fafc2dd10 blob + e47452a4724c9e901bd6de2abb04cccd6db3d355 --- src/cmd/acid/lex.c +++ src/cmd/acid/lex.c @@ -524,7 +524,7 @@ numsym(char first) if(first == '.') isfloat = 1; - if(isdigit(*p++) || isfloat) { + if(isdigit((uchar)*p++) || isfloat) { for(;;) { c = lexc(); if(c < 0) blob - 51d71c4af79beb0a947cf639766c7aad9e64290b blob + 7cc45c262580f7506b612142c1d573602262e854 --- src/cmd/acidtypes/stabs.c +++ src/cmd/acidtypes/stabs.c @@ -115,7 +115,7 @@ comma(char **p) static int parseint(char **pp) { - if(!isdigit(**pp)) + if(!isdigit((uchar)**pp)) oops(); return strtol(*pp, pp, 10); } @@ -129,7 +129,7 @@ parsename(char *desc, char **pp) if(*desc == 'c') return nil; - if(isdigit(*desc) || *desc=='-' || *desc=='(') + if(isdigit((uchar)*desc) || *desc=='-' || *desc=='(') return parseinfo(desc, pp); if(*desc == 0) oops(); @@ -169,7 +169,7 @@ parseinfo(char *desc, char **pp) static int parsenum(char *p, int *n1, int *n2, char **pp) { - if(isdigit(*p)){ + if(isdigit((uchar)*p)){ *n1 = strtol(p, &p, 10); *n2 = 0; *pp = p; @@ -316,7 +316,7 @@ parsedefn(char *p, Type *t, char **pp) long val; Type *tt; - if(*p == '(' || isdigit(*p)){ + if(*p == '(' || isdigit((uchar)*p)){ t->ty = Defer; t->sub = parseinfo(p, pp); return t; @@ -587,7 +587,7 @@ parsebigint(char **pp) neg = 1; p++; } - if(!isdigit(*p)) + if(!isdigit((uchar)*p)) oops(); n = strtol(p, &p, 10); if(neg) blob - 4afd3e548d55b74f7117cd243e6416311b40f6c1 blob + 5757a327a9e25755274e87c5850bffa05dd8197e --- src/cmd/acidtypes/type.c +++ src/cmd/acidtypes/type.c @@ -373,7 +373,7 @@ nameof(Type *t, int doanon) else return ""; for(p=buf; *p; p++) - if(isspace(*p)) + if(isspace((uchar)*p)) *p = '_'; return buf; } blob - 4f05b6d65b55b3f694feaf29793f04b31f80cdd0 blob + 3e299bf5e35906ea954d330c330ac26dc3bf4263 --- src/cmd/auth/factotum/httpdigest.c +++ src/cmd/auth/factotum/httpdigest.c @@ -56,7 +56,7 @@ static void strtolower(char *s) { while(*s){ - *s = tolower(*s); + *s = tolower((uchar)*s); s++; } } blob - ef05364699034f8a776a633ce6fbe2961b4da6f9 blob + c2b352bc041b7cb5e16a63a8a03615ff1f9bd60a --- src/cmd/db/format.c +++ src/cmd/db/format.c @@ -22,11 +22,11 @@ scanform(long icount, int prt, char *ifp, Map *map, in savdot=dot; /*now loop over format*/ while (*fp) { - if (!isdigit(*fp)) + if (!isdigit((uchar)*fp)) fcount = 1; else { fcount = 0; - while (isdigit(c = *fp++)) { + while (isdigit((uchar)c = *fp++)) { fcount *= 10; fcount += c-'0'; } blob - 6704775a3f3ae17ed46829479b8395095078ced4 blob + 0a2cf4f300fa94a8139337107a50fb6b63119afa --- src/cmd/dict/dict.c +++ 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) blob - 16bfeae5758356ab62bac79ae6ca490199a03174 blob + d953636588dbe5f673c61b41b57bd84d61eaf31a --- src/cmd/dict/roget.c +++ 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) blob - 640f2d2baaf6be4421ecc337ed3d2709fdec5768 blob + f522ec716be51b16f7853669478f9e7fbe47551d --- src/cmd/diff/diffio.c +++ src/cmd/diff/diffio.c @@ -82,7 +82,7 @@ readhash(Biobuf *bp, char *buf) * coalesce multiple white-space */ for (space = 0; len--; p++) { - if (isspace(*p)) { + if (isspace((uchar)*p)) { space++; continue; } @@ -99,7 +99,7 @@ readhash(Biobuf *bp, char *buf) * strip all white-space */ while (len--) { - if (isspace(*p)) { + if (isspace((uchar)*p)) { p++; continue; } @@ -167,7 +167,7 @@ squishspace(char *buf) int space; for (space = 0, q = p = buf; *q; q++) { - if (isspace(*q)) { + if (isspace((uchar)*q)) { space++; continue; } blob - 0909449de84e071bfbe8d8366e31b74d4ea7b969 blob + 855c7b4e991559186fd999cb301996242606f7fe --- src/cmd/draw/gview.c +++ src/cmd/draw/gview.c @@ -67,7 +67,7 @@ int remove_substr(char* smain, char* ssub) int n = strlen(ssub); if (s==0) return 0; - if (islower(s[n])) + if (islower((uchar)s[n])) s[0] ^= 32; /* probably tolower(s[0]) or toupper(s[0]) */ else { for (ss=s+n; *ss!=0; s++, ss++) blob - a88e99f266537a722d3d3110ab9ba8b08a44516d blob + d0686679ab30456b2dada45c6f1d1032b0ee8bf2 --- src/cmd/getflags/funcgetflags.c +++ src/cmd/getflags/funcgetflags.c @@ -107,7 +107,7 @@ scanflag(int c, char *f) fc=*f++; if(*f==':'){ f++; - if(!isdigit(*f)){ reason=FLAGSYN; return -1; } + if(!isdigit((uchar)*f)){ reason=FLAGSYN; return -1; } count=strtol(f, &f, 10); } else blob - b740a53e95094f141545db53802a083f940a2ae8 blob + 01c8bc66034b3be12880996af00c86c3dbdc0adc --- src/cmd/graph/graph.c +++ src/cmd/graph/graph.c @@ -646,7 +646,7 @@ getstring(void){ return(-1); switch(*labbuf) { default: - if(!isdigit(*labbuf)) { + if(!isdigit((uchar)*labbuf)) { ungetc(*labbuf,stdin); i = scanf("%s",labbuf); break; blob - e19685a63b99e3d96464190c290559409598791e blob + 7796aacece936ad08261749d36efbdaa21d33420 --- src/cmd/ndb/ndbmkdb.c +++ src/cmd/ndb/ndbmkdb.c @@ -31,7 +31,7 @@ isdk(char *name) slash = 0; for(; *name; name++){ - if(isalnum(*name)) + if(isalnum((uchar)*name)) continue; if(*name == '/'){ slash = 1; @@ -52,7 +52,7 @@ isdomain(char *name) int alpha = 0; for(; *name; name++){ - if(isalpha(*name) || *name == '-'){ + if(isalpha((uchar)*name) || *name == '-'){ alpha = 1; continue; } @@ -60,7 +60,7 @@ isdomain(char *name) dot = 1; continue; } - if(isdigit(*name)) + if(isdigit((uchar)*name)) continue; return 0; } @@ -80,7 +80,7 @@ isip(char *name) dot = 1; continue; } - if(isdigit(*name)) + if(isdigit((uchar)*name)) continue; return 0; } blob - cff529eeda2a93272e51f39de1d2a18f34888c4e blob + ddd39284c5d5293800df1d773b2b2133388d0a7f --- src/cmd/netfiles/acme.c +++ src/cmd/netfiles/acme.c @@ -579,7 +579,7 @@ sysrun(int errto, char *fmt, ...) if(tot == sizeof buf) tot--; buf[tot] = 0; - while(tot > 0 && isspace(buf[tot-1])) + while(tot > 0 && isspace((uchar)buf[tot-1])) tot--; buf[tot] = 0; if(tot == 0){ blob - 1360f6864ce77b79e69e221588de07f97aeb5b32 blob + 2fe216afc3aeecd522bf5de5bd0df7ae10badc4e --- src/cmd/plot/plot.c +++ src/cmd/plot/plot.c @@ -494,7 +494,7 @@ void define(char *a){ short i, j; int curly = 0; ap = a; - while(isalpha(*ap))ap++; + while(isalpha((uchar)*ap))ap++; if(ap == a){ fprint(2,"no name with define\n"); exits("define"); @@ -547,7 +547,7 @@ void call(char *a){ char sav; double SC; ap = a; - while(isalpha(*ap))ap++; + while(isalpha((uchar)*ap))ap++; sav = *ap; *ap = '\0'; for(f=flibr;fmatch[s[0]-'0']); - for(t=s; isalnum(*t); t++) + for(t=s; isalnum((uchar)*t); t++) ; n = t-s; *namelen = n; @@ -377,9 +377,9 @@ assignment(char *p) char *var, *qval; int n; - if(!isalpha(p[0])) + if(!isalpha((uchar)p[0])) return 0; - for(var=p; isalnum(*p); p++) + for(var=p; isalnum((uchar)*p); p++) ; n = p-var; while(*p==' ' || *p=='\t') blob - afcdb766f74f0b5e5cec7d5f8132ef9efe922f2c blob + 6ac567ecdef81216d501c26ec3bb5e60510eaa4a --- src/cmd/postscript/common/common.c +++ src/cmd/postscript/common/common.c @@ -93,7 +93,7 @@ pagelist(char *list) { start = 0; while ((c=*list) != '\0') { n = 0; - while (isdigit(c)) { + while (isdigit((uchar)c)) { n = n * 10 + c - '0'; c = *++list; } blob - 600fc17477e7e29e91cb4ebdbe2b8c03f12d52cc blob + 366bae70a56b3768b04ca2e70ea9688dd2af1303 --- src/cmd/postscript/tr2post/readDESC.c +++ src/cmd/postscript/tr2post/readDESC.c @@ -79,7 +79,7 @@ readDESC(void) { break; case 2: if (fontmnt <=0) { - if (!isdigit(*token)) { + if (!isdigit((uchar)*token)) { error(WARNING, "readdesc: expecting number of fonts in mount table.\n"); return(FALSE); } @@ -99,7 +99,7 @@ readDESC(void) { break; case 4: /* device resolution in dots per inch */ - if (!isdigit(*token)) { + if (!isdigit((uchar)*token)) { error(WARNING, "readdesc: expecting device resolution.\n"); return(FALSE); } @@ -116,7 +116,7 @@ readDESC(void) { break; case 7: /* unitwidth is the font size at which the character widths are 1:1 */ - if (!isdigit(*token)) { + if (!isdigit((uchar)*token)) { error(WARNING, "readdesc: expecting unitwidth.\n"); return(FALSE); } blob - 9cf0bdacdc8196f64302fd093a4419a0db7d3b2c blob + 4a3b640280fd77b06a4176d0583e7f3000e958b4 --- src/cmd/troff2html/troff2html.c +++ src/cmd/troff2html/troff2html.c @@ -438,7 +438,7 @@ header(char *s) char buf[512]; strecpy(buf, buf+sizeof buf, pagename); for(p=buf; *p; p++) - *p = tolower(*p); + *p = tolower((uchar)*p); Bprint(&bout, "%s(%s) - %s\n", buf, section, s); }else Bprint(&bout, "%s\n", s); blob - 42c1635fdfbfea27da01dc9fbaf6697620ac3745 blob + df79341d322b3cf2819bb2dd15cd072f1369f211 --- src/cmd/venti/srv/part.c +++ src/cmd/venti/srv/part.c @@ -24,7 +24,7 @@ strtoullsuf(char *p, char **pp, int rad, u64int *u) { u64int v; - if(!isdigit(*p)) + if(!isdigit((uchar)*p)) return -1; v = strtoull(p, &p, rad); switch(*p){