diff options
author | dsl <dsl@NetBSD.org> | 2004-11-05 21:30:31 +0000 |
---|---|---|
committer | dsl <dsl@NetBSD.org> | 2004-11-05 21:30:31 +0000 |
commit | 9649fe0209de88926626165951e2db3043b73ee6 (patch) | |
tree | f7d328358e6de9a877c8d0fc24f5ae49ad21f031 | |
parent | ef4d58572f66f86a3db4aa555d139fee63cca10c (diff) | |
download | bsdgames-darwin-9649fe0209de88926626165951e2db3043b73ee6.tar.gz bsdgames-darwin-9649fe0209de88926626165951e2db3043b73ee6.tar.zst bsdgames-darwin-9649fe0209de88926626165951e2db3043b73ee6.zip |
Add (unsigned char) cast to ctype functions
-rw-r--r-- | arithmetic/arithmetic.c | 8 | ||||
-rw-r--r-- | battlestar/getcom.c | 22 | ||||
-rw-r--r-- | boggle/boggle/bog.c | 6 | ||||
-rw-r--r-- | boggle/boggle/mach.c | 10 | ||||
-rw-r--r-- | canfield/canfield/canfield.c | 6 | ||||
-rw-r--r-- | cribbage/io.c | 12 | ||||
-rw-r--r-- | dm/dm.c | 12 | ||||
-rw-r--r-- | fortune/fortune/fortune.c | 22 | ||||
-rw-r--r-- | gomoku/stoc.c | 6 | ||||
-rw-r--r-- | hack/hack.u_init.c | 12 | ||||
-rw-r--r-- | hangman/getword.c | 6 | ||||
-rw-r--r-- | hunt/hunt/hunt.c | 10 | ||||
-rw-r--r-- | hunt/hunt/otto.c | 6 | ||||
-rw-r--r-- | hunt/huntd/answer.c | 6 | ||||
-rw-r--r-- | mille/move.c | 10 | ||||
-rw-r--r-- | monop/getinp.c | 9 | ||||
-rw-r--r-- | monop/misc.c | 8 | ||||
-rw-r--r-- | number/number.c | 6 | ||||
-rw-r--r-- | pig/pig.c | 12 | ||||
-rw-r--r-- | robots/main.c | 6 | ||||
-rw-r--r-- | sail/dr_1.c | 7 | ||||
-rw-r--r-- | sail/misc.c | 6 | ||||
-rw-r--r-- | sail/pl_4.c | 6 | ||||
-rw-r--r-- | sail/pl_5.c | 6 |
24 files changed, 109 insertions, 111 deletions
diff --git a/arithmetic/arithmetic.c b/arithmetic/arithmetic.c index 29094c9d..8eff98ee 100644 --- a/arithmetic/arithmetic.c +++ b/arithmetic/arithmetic.c @@ -1,4 +1,4 @@ -/* $NetBSD: arithmetic.c,v 1.20 2004/01/27 20:30:28 jsm Exp $ */ +/* $NetBSD: arithmetic.c,v 1.21 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: arithmetic.c,v 1.20 2004/01/27 20:30:28 jsm Exp $"); +__RCSID("$NetBSD: arithmetic.c,v 1.21 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -246,8 +246,8 @@ retry: (void)printf("\n"); return(EOF); } - for (p = line; *p && isspace(*p); ++p); - if (!isdigit(*p)) { + for (p = line; *p && isspace((unsigned char)*p); ++p); + if (!isdigit((unsigned char)*p)) { (void)printf("Please type a number.\n"); continue; } diff --git a/battlestar/getcom.c b/battlestar/getcom.c index 29a34560..1b60e11f 100644 --- a/battlestar/getcom.c +++ b/battlestar/getcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: getcom.c,v 1.11 2003/08/07 09:37:02 agc Exp $ */ +/* $NetBSD: getcom.c,v 1.12 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getcom.c,v 1.11 2003/08/07 09:37:02 agc Exp $"); +__RCSID("$NetBSD: getcom.c,v 1.12 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -54,7 +54,7 @@ getcom(buf, size, prompt, error) clearerr(stdin); continue; } - while (isspace(*buf)) + while (isspace((unsigned char)*buf)) buf++; if (*buf) break; @@ -83,25 +83,25 @@ getword(buf1, buf2, flag) int cnt; cnt = 1; - while (isspace(*buf1)) + while (isspace((unsigned char)*buf1)) buf1++; if (*buf1 != ',') { if (!*buf1) { *buf2 = 0; return (0); } - while (cnt < WORDLEN && *buf1 && !isspace(*buf1) && *buf1 != ',') + while (cnt < WORDLEN && *buf1 && !isspace((unsigned char)*buf1) && *buf1 != ',') if (flag < 0) { - if (isupper(*buf1)) { - *buf2++ = tolower(*buf1++); + if (isupper((unsigned char)*buf1)) { + *buf2++ = tolower((unsigned char)*buf1++); cnt++; } else { *buf2++ = *buf1++; cnt++; } } else if (flag > 0) { - if (islower(*buf1)) { - *buf2++ = toupper(*buf1++); + if (islower((unsigned char)*buf1)) { + *buf2++ = toupper((unsigned char)*buf1++); cnt++; } else { *buf2++ = *buf1++; @@ -112,12 +112,12 @@ getword(buf1, buf2, flag) cnt++; } if (cnt == WORDLEN) - while (*buf1 && !isspace(*buf1)) + while (*buf1 && !isspace((unsigned char)*buf1)) buf1++; } else *buf2++ = *buf1++; *buf2 = '\0'; - while (isspace(*buf1)) + while (isspace((unsigned char)*buf1)) buf1++; return (*buf1 ? buf1 : NULL); } diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c index f0012ca8..d89654aa 100644 --- a/boggle/boggle/bog.c +++ b/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bog.c,v 1.18 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: bog.c,v 1.19 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\ #if 0 static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: bog.c,v 1.18 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: bog.c,v 1.19 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -180,7 +180,7 @@ main(argc, argv) } if (argc > 0) { - if (islower(argv[0][0])) { + if (islower((unsigned char)argv[0][0])) { if (strlen(argv[0]) != 16) { usage(); } else { diff --git a/boggle/boggle/mach.c b/boggle/boggle/mach.c index b6b76401..c21ddbd4 100644 --- a/boggle/boggle/mach.c +++ b/boggle/boggle/mach.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach.c,v 1.13 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: mach.c,v 1.14 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93"; #else -__RCSID("$NetBSD: mach.c,v 1.13 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: mach.c,v 1.14 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -445,7 +445,7 @@ findword() if (board[wordpath[i]] == 'q') printw("Qu"); else - printw("%c", toupper(board[wordpath[i]])); + printw("%c", toupper((unsigned char)board[wordpath[i]])); move(r, c); refresh(); delay(5); @@ -460,7 +460,7 @@ findword() if (board[wordpath[i]] == 'q') printw("Qu"); else - printw("%c", toupper(board[wordpath[i]])); + printw("%c", toupper((unsigned char)board[wordpath[i]])); } move(r, c); clrtoeol(); @@ -666,7 +666,7 @@ tty_showboard(b) if (b[i] == 'q') printw("| Qu"); else - printw("| %c ", toupper(b[i])); + printw("| %c ", toupper((unsigned char)b[i])); if ((i + 1) % 4 == 0) { printw("|"); move(++line, BOARD_COL); diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c index 5b838be5..2112b616 100644 --- a/canfield/canfield/canfield.c +++ b/canfield/canfield/canfield.c @@ -1,4 +1,4 @@ -/* $NetBSD: canfield.c,v 1.19 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: canfield.c,v 1.20 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: canfield.c,v 1.19 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: canfield.c,v 1.20 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -1400,7 +1400,7 @@ getcmd(row, col, cp) suspend(); move(row, col + i); refresh(); - } else if (isprint(ch)) { + } else if (isprint((unsigned char)ch)) { cmd[i++] = ch; addch(ch); refresh(); diff --git a/cribbage/io.c b/cribbage/io.c index 591e0c43..3d692576 100644 --- a/cribbage/io.c +++ b/cribbage/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.17 2004/01/26 09:58:35 jsm Exp $ */ +/* $NetBSD: io.c,v 1.18 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.17 2004/01/26 09:58:35 jsm Exp $"); +__RCSID("$NetBSD: io.c,v 1.18 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -353,10 +353,10 @@ number(lo, hi, prompt) } sum = 0; - if (!isdigit(*p)) + if (!isdigit((unsigned char)*p)) sum = lo - 1; else - while (isdigit(*p)) { + while (isdigit((unsigned char)*p)) { sum = 10 * sum + (*p - '0'); ++p; } @@ -424,8 +424,8 @@ endmsg() /* All messages should start with uppercase */ mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); - if (islower(Msgbuf[0]) && Msgbuf[1] != ')') - Msgbuf[0] = toupper(Msgbuf[0]); + if (islower((unsigned char)Msgbuf[0]) && Msgbuf[1] != ')') + Msgbuf[0] = toupper((unsigned char)Msgbuf[0]); mp = Msgbuf; len = strlen(mp); if (len / MSG_X + Lineno >= MSG_Y) { @@ -1,4 +1,4 @@ -/* $NetBSD: dm.c,v 1.20 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1987, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\ #if 0 static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dm.c,v 1.20 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -173,7 +173,7 @@ c_day(s_day, s_start, s_stop) ct = localtime(&now); if (strcasecmp(s_day, days[ct->tm_wday])) return; - if (!isdigit(*s_start) || !isdigit(*s_stop)) + if (!isdigit((unsigned char)*s_start) || !isdigit((unsigned char)*s_stop)) return; start = atoi(s_start); stop = atoi(s_stop); @@ -221,11 +221,11 @@ c_game(s_game, s_load, s_users, s_priority) if (strcmp(game, s_game) && strcasecmp("default", s_game)) return; ++found; - if (isdigit(*s_load) && atoi(s_load) < load()) + if (isdigit((unsigned char)*s_load) && atoi(s_load) < load()) errx(0, "Sorry, the load average is too high right now."); - if (isdigit(*s_users) && atoi(s_users) <= users()) + if (isdigit((unsigned char)*s_users) && atoi(s_users) <= users()) errx(0, "Sorry, there are too many users logged on right now."); - if (isdigit(*s_priority)) + if (isdigit((unsigned char)*s_priority)) priority = atoi(s_priority); } diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index 4a8ee817..8675adc0 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.43 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: fortune.c,v 1.44 2004/11/05 21:30:32 dsl Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.43 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.44 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -282,9 +282,9 @@ rot13(line, len) len = strlen(line); for (p = line; (ch = *p) != 0; ++p) - if (isupper(ch)) + if (isupper((unsigned char)ch)) *p = 'A' + (ch - 'A' + 13) % 26; - else if (islower(ch)) + else if (islower((unsigned char)ch)) *p = 'a' + (ch - 'a' + 13) % 26; } @@ -453,11 +453,11 @@ form_file_list(files, file_cnt) } for (i = 0; i < file_cnt; i++) { percent = NO_PROB; - if (!isdigit(files[i][0])) + if (!isdigit((unsigned char)files[i][0])) sp = files[i]; else { percent = 0; - for (sp = files[i]; isdigit(*sp); sp++) + for (sp = files[i]; isdigit((unsigned char)*sp); sp++) percent = percent * 10 + *sp - '0'; if (percent > 100) { warnx("Percentages must be <= 100"); @@ -1268,7 +1268,7 @@ conv_pat(orig) cnt = 1; /* allow for '\0' */ for (sp = orig; *sp != '\0'; sp++) - if (isalpha(*sp)) + if (isalpha((unsigned char)*sp)) cnt += 4; else cnt++; @@ -1276,16 +1276,16 @@ conv_pat(orig) err(1, NULL); for (sp = new; *orig != '\0'; orig++) { - if (islower(*orig)) { + if (islower((unsigned char)*orig)) { *sp++ = '['; *sp++ = *orig; - *sp++ = toupper(*orig); + *sp++ = toupper((unsigned char)*orig); *sp++ = ']'; } - else if (isupper(*orig)) { + else if (isupper((unsigned char)*orig)) { *sp++ = '['; *sp++ = *orig; - *sp++ = tolower(*orig); + *sp++ = tolower((unsigned char)*orig); *sp++ = ']'; } else diff --git a/gomoku/stoc.c b/gomoku/stoc.c index 16488e6d..9ca5e659 100644 --- a/gomoku/stoc.c +++ b/gomoku/stoc.c @@ -1,4 +1,4 @@ -/* $NetBSD: stoc.c,v 1.7 2003/08/07 09:37:18 agc Exp $ */ +/* $NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1994 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)stoc.c 8.1 (Berkeley) 7/24/94"; #else -__RCSID("$NetBSD: stoc.c,v 1.7 2003/08/07 09:37:18 agc Exp $"); +__RCSID("$NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -88,7 +88,7 @@ ctos(mp) for (i = 0; mv[i].m_code >= 0; i++) if (strcmp(mp, mv[i].m_text) == 0) return(mv[i].m_code); - if (!isalpha(mp[0])) + if (!isalpha((unsigned char)mp[0])) return(ILLEGAL); i = atoi(&mp[1]); if (i < 1 || i > 19) diff --git a/hack/hack.u_init.c b/hack/hack.u_init.c index 97246c61..9b111029 100644 --- a/hack/hack.u_init.c +++ b/hack/hack.u_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.u_init.c,v 1.7 2003/04/02 18:36:41 jsm Exp $ */ +/* $NetBSD: hack.u_init.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.u_init.c,v 1.7 2003/04/02 18:36:41 jsm Exp $"); +__RCSID("$NetBSD: hack.u_init.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ #include <ctype.h> @@ -169,8 +169,8 @@ u_init() rolesyms[i] = 0; if ((pc = pl_character[0]) != '\0') { - if (islower(pc)) - pc = toupper(pc); + if (islower((unsigned char)pc)) + pc = toupper((unsigned char)pc); if ((i = role_index(pc)) >= 0) goto got_suffix; /* implies experienced */ printf("\nUnknown role: %c\n", pc); @@ -201,8 +201,8 @@ u_init() printf("? [%s] ", rolesyms); while ((pc = readchar()) != '\0') { - if (islower(pc)) - pc = toupper(pc); + if (islower((unsigned char)pc)) + pc = toupper((unsigned char)pc); if ((i = role_index(pc)) >= 0) { printf("%c\n", pc); /* echo */ (void) fflush(stdout); /* should be seen */ diff --git a/hangman/getword.c b/hangman/getword.c index 8d8cc726..1b5396a9 100644 --- a/hangman/getword.c +++ b/hangman/getword.c @@ -1,4 +1,4 @@ -/* $NetBSD: getword.c,v 1.8 2003/08/07 09:37:21 agc Exp $ */ +/* $NetBSD: getword.c,v 1.9 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getword.c,v 1.8 2003/08/07 09:37:21 agc Exp $"); +__RCSID("$NetBSD: getword.c,v 1.9 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -63,7 +63,7 @@ getword() if (strlen(Word) < Minlen) continue; for (wp = Word; *wp; wp++) - if (!islower(*wp)) + if (!islower((unsigned char)*wp)) goto cont; break; cont: ; diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c index 898cd019..48e717b7 100644 --- a/hunt/hunt/hunt.c +++ b/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: hunt.c,v 1.23 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: hunt.c,v 1.23 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include <sys/param.h> @@ -142,7 +142,7 @@ main(ac, av) break; case 't': team = *optarg; - if (!isdigit(team)) { + if (!isdigit((unsigned char)team)) { warnx("Team names must be numeric"); team = ' '; } @@ -1048,7 +1048,7 @@ env_init(enter_status) # endif else if (strncmp(envp, "team=", s - envp + 1) == 0) { team = *(s + 1); - if (!isdigit(team)) + if (!isdigit((unsigned char)team)) team = ' '; if ((s = strchr(envp, ',')) == NULL) { *envp = '\0'; @@ -1111,7 +1111,7 @@ again: goto again; } for (cp = name; *cp != '\0'; cp++) - if (!isprint(*cp)) { + if (!isprint((unsigned char)*cp)) { name[0] = '\0'; printf("Illegal character in your code name.\n"); goto again; diff --git a/hunt/hunt/otto.c b/hunt/hunt/otto.c index 3fcaaeed..a2c97e0c 100644 --- a/hunt/hunt/otto.c +++ b/hunt/hunt/otto.c @@ -1,4 +1,4 @@ -/* $NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: otto.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ # ifdef OTTO /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -45,7 +45,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: otto.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include <sys/time.h> @@ -438,7 +438,7 @@ face_and_move_direction(rel_dir, distance) int i; struct item items[NUMDIRECTIONS]; - command[comlen++] = toupper(cmd); + command[comlen++] = toupper((unsigned char)cmd); if (distance == 0) { /* rotate ottolook's to be in right position */ for (i = 0; i < NUMDIRECTIONS; i++) diff --git a/hunt/huntd/answer.c b/hunt/huntd/answer.c index 40b099ef..20371629 100644 --- a/hunt/huntd/answer.c +++ b/hunt/huntd/answer.c @@ -1,4 +1,4 @@ -/* $NetBSD: answer.c,v 1.6 2003/06/11 12:00:22 wiz Exp $ */ +/* $NetBSD: answer.c,v 1.7 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: answer.c,v 1.6 2003/06/11 12:00:22 wiz Exp $"); +__RCSID("$NetBSD: answer.c,v 1.7 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include <ctype.h> @@ -115,7 +115,7 @@ answer() * between driver and player processes */ for (cp1 = cp2 = name; *cp1 != '\0'; cp1++) - if (isprint(*cp1) || *cp1 == ' ') + if (isprint((unsigned char)*cp1) || *cp1 == ' ') *cp2++ = *cp1; *cp2 = '\0'; diff --git a/mille/move.c b/mille/move.c index caca78c1..e383e9c8 100644 --- a/mille/move.c +++ b/mille/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.14 2004/04/06 19:15:07 jdc Exp $ */ +/* $NetBSD: move.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: move.c,v 1.14 2004/04/06 19:15:07 jdc Exp $"); +__RCSID("$NetBSD: move.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -367,9 +367,9 @@ getmove() refresh(); while ((c = readch()) == killchar() || c == erasechar()) continue; - if (islower(c)) - c = toupper(c); - if (isprint(c) && !isspace(c)) { + if (islower((unsigned char)c)) + c = toupper((unsigned char)c); + if (isprint((unsigned char)c) && !isspace((unsigned char)c)) { addch(c); refresh(); } diff --git a/monop/getinp.c b/monop/getinp.c index 3fb739b4..fee84c5e 100644 --- a/monop/getinp.c +++ b/monop/getinp.c @@ -1,4 +1,4 @@ -/* $NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -91,8 +91,7 @@ inter: } *sp = '\0'; for (sp = buf; *sp; sp++) - if (isupper(*sp)) - *sp = tolower(*sp); + *sp = tolower((unsigned char)*sp); for (i = n_match = 0; list[i]; i++) if (comp(list[i])) { n_match++; @@ -115,7 +114,7 @@ comp(s1) if (buf[0] != '\0') for (sp = buf, tsp = s1; *sp; ) { - c = isupper(*tsp) ? tolower(*tsp) : *tsp; + c = tolower((unsigned char)*tsp); tsp++; if (c != *sp++) return 0; diff --git a/monop/misc.c b/monop/misc.c index f9a37557..1d3a5669 100644 --- a/monop/misc.c +++ b/monop/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $ */ +/* $NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $"); +__RCSID("$NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -109,9 +109,9 @@ inter: *sp = c; if (sp == buf) continue; - for (sp = buf; isspace(*sp); sp++) + for (sp = buf; isspace((unsigned char)*sp); sp++) continue; - for (; isdigit(*sp); sp++) + for (; isdigit((unsigned char)*sp); sp++) num = num * 10 + *sp - '0'; if (*sp == '\n') return num; diff --git a/number/number.c b/number/number.c index 89cb17a9..954359fe 100644 --- a/number/number.c +++ b/number/number.c @@ -1,4 +1,4 @@ -/* $NetBSD: number.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: number.c,v 1.10 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: number.c,v 1.9 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: number.c,v 1.10 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -141,7 +141,7 @@ convert(line) } goto badnum; } - if (isdigit(*p)) + if (isdigit((unsigned char)*p)) continue; switch (*p) { case '.': @@ -1,4 +1,4 @@ -/* $NetBSD: pig.c,v 1.10 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: pig.c,v 1.11 2004/11/05 21:30:32 dsl Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ #if 0 static char sccsid[] = "@(#)pig.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: pig.c,v 1.10 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: pig.c,v 1.11 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -99,9 +99,9 @@ pigout(buf, len) int olen, allupper, firstupper; /* See if the word is all upper case */ - allupper = firstupper = isupper(buf[0]); + allupper = firstupper = isupper((unsigned char)buf[0]); for (i = 1; i < len && allupper; i++) - allupper = allupper && isupper(buf[i]); + allupper = allupper && isupper((unsigned char)buf[i]); /* * If the word starts with a vowel, append "way". Don't treat 'y' @@ -118,7 +118,7 @@ pigout(buf, len) * isn't treated as a vowel. */ if (!allupper) - buf[0] = tolower(buf[0]); + buf[0] = tolower((unsigned char)buf[0]); for (start = 0, olen = len; !strchr("aeiouyAEIOUY", buf[start]) && start < olen;) { ch = buf[len++] = buf[start++]; @@ -127,7 +127,7 @@ pigout(buf, len) buf[len++] = buf[start++]; } if (firstupper) - buf[start] = toupper(buf[start]); + buf[start] = toupper((unsigned char)buf[start]); (void)printf("%.*s%s", olen, buf + start, allupper ? "AY" : "ay"); } diff --git a/robots/main.c b/robots/main.c index 7877fa92..85cbefd2 100644 --- a/robots/main.c +++ b/robots/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: main.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: main.c,v 1.20 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -76,7 +76,7 @@ main(ac, av) bad_arg = FALSE; for (++av; ac > 1 && *av[0]; av++, ac--) if (av[0][0] != '-') - if (isdigit(av[0][0])) + if (isdigit((unsigned char)av[0][0])) Max_per_uid = atoi(av[0]); else { Scorefile = av[0]; diff --git a/sail/dr_1.c b/sail/dr_1.c index 1d8b5444..df2ade32 100644 --- a/sail/dr_1.c +++ b/sail/dr_1.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_1.c,v 1.20 2004/09/07 13:20:39 jrf Exp $ */ +/* $NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dr_1.c,v 1.20 2004/09/07 13:20:39 jrf Exp $"); +__RCSID("$NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -425,8 +425,7 @@ next(void) if (tp == 0) p = "Driver"; else { - if (islower(*tp)) - *tp = toupper(*tp); + *tp = toupper((unsigned char)*tp); p = tp; } strlcpy(bestship->file->captain, p, diff --git a/sail/misc.c b/sail/misc.c index d576b35e..ad3a647d 100644 --- a/sail/misc.c +++ b/sail/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.14 2004/02/08 00:32:48 jsm Exp $ */ +/* $NetBSD: misc.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: misc.c,v 1.14 2004/02/08 00:32:48 jsm Exp $"); +__RCSID("$NetBSD: misc.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -188,7 +188,7 @@ colours(struct ship *sp) if (sp->file->struck) return flag; flag = *countryname[capship(sp)->nationality]; - return sp->file->FS ? flag : tolower(flag); + return sp->file->FS ? flag : tolower((unsigned char)flag); } void diff --git a/sail/pl_4.c b/sail/pl_4.c index 5d2a16f1..7958b56e 100644 --- a/sail/pl_4.c +++ b/sail/pl_4.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_4.c,v 1.14 2003/08/07 09:37:44 agc Exp $ */ +/* $NetBSD: pl_4.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_4.c,v 1.14 2003/08/07 09:37:44 agc Exp $"); +__RCSID("$NetBSD: pl_4.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -95,7 +95,7 @@ lookout(void) sgetstr("What ship? ", buf, sizeof buf); foreachship(sp) { c = *countryname[sp->nationality]; - if ((c == *buf || tolower(c) == *buf || colours(sp) == *buf) + if ((tolower((unsigned char)c) == *buf || colours(sp) == *buf) && (sp->file->stern == buf[1] || sterncolour(sp) == buf[1] || buf[1] == '?')) { eyeball(sp); diff --git a/sail/pl_5.c b/sail/pl_5.c index c8d9229e..b3bdd77a 100644 --- a/sail/pl_5.c +++ b/sail/pl_5.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_5.c,v 1.16 2003/08/07 09:37:44 agc Exp $ */ +/* $NetBSD: pl_5.c,v 1.17 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_5.c,v 1.16 2003/08/07 09:37:44 agc Exp $"); +__RCSID("$NetBSD: pl_5.c,v 1.17 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -122,7 +122,7 @@ acceptmove(void) *p-- = '\0'; break; default: - if (!isspace(*p)) { + if (!isspace((unsigned char)*p)) { Msg("Input error."); *p-- = '\0'; } |