URI:
       tNetBSD-macppc ctype needs uchars. - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 3bd56b04a8bab7208494fd7dc74af5528fc41604
   DIR parent 94d85bc000866ecb4874e0e5bdcf30de4a84862e
  HTML Author: rsc <devnull@localhost>
       Date:   Fri,  9 Sep 2005 23:16:15 +0000
       
       NetBSD-macppc ctype needs uchars.
       
       Diffstat:
         M src/cmd/9660/dump.c                 |       2 +-
         M src/cmd/9660/ichar.c                |       3 +--
         M src/cmd/9660/util.c                 |       2 +-
         M src/cmd/acid/lex.c                  |       2 +-
         M src/cmd/acidtypes/stabs.c           |      10 +++++-----
         M src/cmd/acidtypes/type.c            |       2 +-
         M src/cmd/auth/factotum/httpdigest.c  |       2 +-
         M src/cmd/db/format.c                 |       4 ++--
         M src/cmd/dict/dict.c                 |       4 ++--
         M src/cmd/dict/roget.c                |      34 ++++++++++++++++----------------
         M src/cmd/diff/diffio.c               |       6 +++---
         M src/cmd/draw/gview.c                |       2 +-
         M src/cmd/getflags/funcgetflags.c     |       2 +-
         M src/cmd/graph/graph.c               |       2 +-
         M src/cmd/ndb/ndbmkdb.c               |       8 ++++----
         M src/cmd/netfiles/acme.c             |       2 +-
         M src/cmd/plot/plot.c                 |       6 +++---
         M src/cmd/plumb/rules.c               |       6 +++---
         M src/cmd/postscript/common/common.c  |       2 +-
         M src/cmd/postscript/tr2post/readDES… |       6 +++---
         M src/cmd/troff2html/troff2html.c     |       2 +-
         M src/cmd/venti/srv/part.c            |       2 +-
       
       22 files changed, 55 insertions(+), 56 deletions(-)
       ---
   DIR diff --git a/src/cmd/9660/dump.c b/src/cmd/9660/dump.c
       t@@ -456,7 +456,7 @@ static int
        isalldigit(char *s)
        {
                while(*s)
       -                if(!isdigit(*s++))
       +                if(!isdigit((uchar)*s++))
                                return 0;
                return 1;
        }
   DIR diff --git a/src/cmd/9660/ichar.c b/src/cmd/9660/ichar.c
       t@@ -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;
   DIR diff --git a/src/cmd/9660/util.c b/src/cmd/9660/util.c
       t@@ -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;
   DIR diff --git a/src/cmd/acid/lex.c b/src/cmd/acid/lex.c
       t@@ -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)
   DIR diff --git a/src/cmd/acidtypes/stabs.c b/src/cmd/acidtypes/stabs.c
       t@@ -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);
        }
       t@@ -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();
       t@@ -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;
       t@@ -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;
       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)
   DIR diff --git a/src/cmd/acidtypes/type.c b/src/cmd/acidtypes/type.c
       t@@ -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;
        }
   DIR diff --git a/src/cmd/auth/factotum/httpdigest.c b/src/cmd/auth/factotum/httpdigest.c
       t@@ -56,7 +56,7 @@ static void
        strtolower(char *s)
        {
                while(*s){
       -                *s = tolower(*s);
       +                *s = tolower((uchar)*s);
                        s++;
                }
        }
   DIR diff --git a/src/cmd/db/format.c b/src/cmd/db/format.c
       t@@ -22,11 +22,11 @@ scanform(long icount, int prt, char *ifp, Map *map, int literal)
                        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';
                                        }
   DIR diff --git a/src/cmd/dict/dict.c b/src/cmd/dict/dict.c
       t@@ -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)
   DIR diff --git a/src/cmd/dict/roget.c b/src/cmd/dict/roget.c
       t@@ -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 == '[')? ']': '}';
       t@@ -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){
       t@@ -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){
       t@@ -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;
                        }
       t@@ -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--;
                                }
       t@@ -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);
       t@@ -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)
   DIR diff --git a/src/cmd/diff/diffio.c b/src/cmd/diff/diffio.c
       t@@ -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;
                                }
       t@@ -99,7 +99,7 @@ readhash(Biobuf *bp, char *buf)
                         * strip all white-space
                         */
                        while (len--) {
       -                        if (isspace(*p)) {
       +                        if (isspace((uchar)*p)) {
                                        p++;
                                        continue;
                                }
       t@@ -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;
                        }
   DIR diff --git a/src/cmd/draw/gview.c b/src/cmd/draw/gview.c
       t@@ -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++)
   DIR diff --git a/src/cmd/getflags/funcgetflags.c b/src/cmd/getflags/funcgetflags.c
       t@@ -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
   DIR diff --git a/src/cmd/graph/graph.c b/src/cmd/graph/graph.c
       t@@ -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;
   DIR diff --git a/src/cmd/ndb/ndbmkdb.c b/src/cmd/ndb/ndbmkdb.c
       t@@ -31,7 +31,7 @@ isdk(char *name)
        
                slash = 0;
                for(; *name; name++){
       -                if(isalnum(*name))
       +                if(isalnum((uchar)*name))
                                continue;
                        if(*name == '/'){
                                slash = 1;
       t@@ -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;
                        }
       t@@ -60,7 +60,7 @@ isdomain(char *name)
                                dot = 1;
                                continue;
                        }
       -                if(isdigit(*name))
       +                if(isdigit((uchar)*name))
                                continue;
                        return 0;
                }
       t@@ -80,7 +80,7 @@ isip(char *name)
                                dot = 1;
                                continue;
                        }
       -                if(isdigit(*name))
       +                if(isdigit((uchar)*name))
                                continue;
                        return 0;
                }
   DIR diff --git a/src/cmd/netfiles/acme.c b/src/cmd/netfiles/acme.c
       t@@ -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){
   DIR diff --git a/src/cmd/plot/plot.c b/src/cmd/plot/plot.c
       t@@ -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");
       t@@ -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;f<fptr;f++){
       t@@ -559,7 +559,7 @@ void call(char *a){
                        exits("undefined");
                }
                *ap = sav;
       -        while (isspace(*ap) || *ap == ',') 
       +        while (isspace((uchar)*ap) || *ap == ',') 
                        ap++;
                if (*ap != '\0')
                        SC = atof(ap);
   DIR diff --git a/src/cmd/plumb/rules.c b/src/cmd/plumb/rules.c
       t@@ -255,7 +255,7 @@ dollar(Exec *e, char *s, int *namelen)
                if(e!=nil && '0'<=s[0] && s[0]<='9')
                        return nonnil(e->match[s[0]-'0']);
        
       -        for(t=s; isalnum(*t); t++)
       +        for(t=s; isalnum((uchar)*t); t++)
                        ;
                n = t-s;
                *namelen = n;
       t@@ -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')
   DIR diff --git a/src/cmd/postscript/common/common.c b/src/cmd/postscript/common/common.c
       t@@ -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;
                        }
   DIR diff --git a/src/cmd/postscript/tr2post/readDESC.c b/src/cmd/postscript/tr2post/readDESC.c
       t@@ -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);
                                        }
       t@@ -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);
                                }
       t@@ -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);
                                }
   DIR diff --git a/src/cmd/troff2html/troff2html.c b/src/cmd/troff2html/troff2html.c
       t@@ -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, "<title>%s(%s) - %s</title>\n", buf, section, s);
                }else
                        Bprint(&bout, "<title>%s</title>\n", s);
   DIR diff --git a/src/cmd/venti/srv/part.c b/src/cmd/venti/srv/part.c
       t@@ -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){