? log Index: client/clinet.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v retrieving revision 1.43 diff -u -r1.43 clinet.c --- client/clinet.c 2001/08/29 01:20:28 1.43 +++ client/clinet.c 2001/09/10 23:37:48 @@ -386,7 +386,7 @@ } s[0] = '\0'; ++s; - while (isdigit(s[0])) {++s;} + while (isdigit((int) s[0])) {++s;} } else { port = 80; if (!(s = strchr(server,'/'))) { Index: common/capability.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/capability.c,v retrieving revision 1.5 diff -u -r1.5 capability.c --- common/capability.c 2001/02/19 22:57:12 1.5 +++ common/capability.c 2001/09/10 23:37:48 @@ -20,11 +20,11 @@ #define GET_TOKEN(start, end) \ { \ /* skip leading whitespace */ \ - while (isspace(*start)) { \ + while (isspace((int) *start)) { \ start++; \ } \ /* skip to end of token */ \ - for (end = start; *end && !isspace(*end) && *end != ','; end++) \ + for (end = start; *end && !isspace((int) *end) && *end != ','; end++) \ ; \ } Index: common/inputfile.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/inputfile.c,v retrieving revision 1.10 diff -u -r1.10 inputfile.c --- common/inputfile.c 2000/08/14 12:42:04 1.10 +++ common/inputfile.c 2001/09/10 23:37:48 @@ -334,7 +334,7 @@ /* skip any whitespace: */ inf->cur_line_pos = len; c = inf->cur_line.str + len; - while (*c && isspace(*c)) c++; + while (*c && isspace((int) *c)) c++; if (*c != '\"') { inf_die(inf, "Did not find opening doublequote for '*include' line"); @@ -351,7 +351,7 @@ inf->cur_line_pos = c - inf->cur_line.str; /* check rest of line is well-formed: */ - while (*c && isspace(*c) && !my_is_comment(*c)) c++; + while (*c && isspace((int) *c) && !my_is_comment(*c)) c++; if (!(*c=='\0' || my_is_comment(*c))) { inf_die(inf, "Junk after filename for '*include' line"); } @@ -639,16 +639,16 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c && isspace((int) *c)) { c++; } if (!*c) return NULL; start = c; - while (*c && !isspace(*c) && *c != '=' && !my_is_comment(*c)) { + while (*c && !isspace((int) *c) && *c != '=' && !my_is_comment(*c)) { c++; } - if (!(*c && (isspace(*c) || *c == '='))) + if (!(*c && (isspace((int) *c) || *c == '='))) return NULL; end = c; while (*c && *c != '=' && !my_is_comment(*c)) { @@ -675,7 +675,7 @@ if (!at_eol(inf)) { c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c && isspace((int) *c)) { c++; } if (*c != '\0' && !my_is_comment(*c)) @@ -702,7 +702,7 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c && isspace((int) *c)) { c++; } if (*c != target) @@ -749,20 +749,20 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c && isspace((int) *c)) { c++; } if (!*c) return NULL; - if (*c == '-' || isdigit(*c)) { + if (*c == '-' || isdigit((int) *c)) { /* a number: */ start = c++; - while(*c && isdigit(*c)) { + while(*c && isdigit((int) *c)) { c++; } /* check that the trailing stuff is ok: */ - if (!(!*c || *c == ',' || isspace(*c) || my_is_comment(*c))) { + if (!(!*c || *c == ',' || isspace((int) *c) || my_is_comment(*c))) { return NULL; } /* If its a comma, we don't want to obliterate it permanently, @@ -782,7 +782,7 @@ if (*c == '_' && *(c+1) == '(') { has_i18n_marking = 1; c += 2; - while(*c && isspace(*c)) { + while(*c && isspace((int) *c)) { c++; } if (!*c) Index: common/registry.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/registry.c,v retrieving revision 1.34 diff -u -r1.34 registry.c --- common/registry.c 2001/08/13 15:13:35 1.34 +++ common/registry.c 2001/09/10 23:37:48 @@ -601,11 +601,11 @@ if(!SAVE_TABLES) break; c = first = pentry->name; - if(!*c || !isalpha(*c)) break; - for( ; *c && isalpha(*c); c++); + if(!*c || !isalpha((int) *c)) break; + for( ; *c && isalpha((int) *c); c++); if(strncmp(c,"0.",2) != 0) break; c+=2; - if(!*c || !isalnum(*c)) break; + if(!*c || !isalnum((int) *c)) break; offset = c - first; first[offset-2] = '\0'; Index: common/shared.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/shared.c,v retrieving revision 1.65 diff -u -r1.65 shared.c --- common/shared.c 2001/09/06 21:23:07 1.65 +++ common/shared.c 2001/09/10 23:37:48 @@ -309,7 +309,7 @@ char *skip_leading_spaces(char *s) { assert(s!=NULL); - while(*s && isspace(*s)) { + while(*s && isspace((int) *s)) { s++; } return s; @@ -346,7 +346,7 @@ len = strlen(s); if (len) { t = s + len -1; - while(isspace(*t)) { + while(isspace((int) *t)) { *t = '\0'; if (t == s) { break; @@ -408,7 +408,7 @@ /* find space and break: */ for(c=s+len; c>s; c--) { - if (isspace(*c)) { + if (isspace((int) *c)) { *c = '\n'; s = c+1; goto top; @@ -417,7 +417,7 @@ /* couldn't find a good break; settle for a bad one... */ for(c=s+len+1; *c; c++) { - if (isspace(*c)) { + if (isspace((int) *c)) { *c = '\n'; s = c+1; goto top; Index: intl/l10nflist.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/intl/l10nflist.c,v retrieving revision 1.2 diff -u -r1.2 l10nflist.c --- intl/l10nflist.c 2001/06/15 23:12:55 1.2 +++ intl/l10nflist.c 2001/09/10 23:37:48 @@ -355,11 +355,11 @@ size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) - if (isalnum (codeset[cnt])) + if (isalnum ((int) codeset[cnt])) { ++len; - if (isalpha (codeset[cnt])) + if (isalpha ((int) codeset[cnt])) only_digit = 0; } @@ -373,9 +373,9 @@ wp = retval; for (cnt = 0; cnt < name_len; ++cnt) - if (isalpha (codeset[cnt])) + if (isalpha ((int) codeset[cnt])) *wp++ = tolower (codeset[cnt]); - else if (isdigit (codeset[cnt])) + else if (isdigit ((int) codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; Index: intl/loadmsgcat.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/intl/loadmsgcat.c,v retrieving revision 1.2 diff -u -r1.2 loadmsgcat.c --- intl/loadmsgcat.c 2001/06/15 23:12:56 1.2 +++ intl/loadmsgcat.c 2001/09/10 23:37:48 @@ -507,7 +507,7 @@ struct parse_args args; nplurals += 9; - while (*nplurals != '\0' && isspace (*nplurals)) + while (*nplurals != '\0' && isspace ((int) *nplurals)) ++nplurals; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); Index: intl/localealias.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/intl/localealias.c,v retrieving revision 1.2 diff -u -r1.2 localealias.c --- intl/localealias.c 2001/06/15 23:12:56 1.2 +++ intl/localealias.c 2001/09/10 23:37:48 @@ -243,21 +243,21 @@ cp = buf; /* Ignore leading white space. */ - while (isspace (cp[0])) + while (isspace ((int) cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; - while (cp[0] != '\0' && !isspace (cp[0])) + while (cp[0] != '\0' && !isspace ((int) cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ - while (isspace (cp[0])) + while (isspace ((int) cp[0])) ++cp; if (cp[0] != '\0') @@ -266,7 +266,7 @@ size_t value_len; value = cp++; - while (cp[0] != '\0' && !isspace (cp[0])) + while (cp[0] != '\0' && !isspace ((int) cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') Index: server/savegame.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v retrieving revision 1.29 diff -u -r1.29 savegame.c --- server/savegame.c 2001/09/08 22:53:28 1.29 +++ server/savegame.c 2001/09/10 23:37:49 @@ -215,9 +215,9 @@ for(x=0; xspecial |= - ((ch-(isdigit(ch) ? '0' : 'a'-10))<<8) & S_RIVER; + ((ch-(isdigit((int) ch) ? '0' : 'a'-10))<<8) & S_RIVER; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown rivers overlay flag (map.n) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -279,8 +279,8 @@ for(x=0; xspecial=ch-(isdigit(ch) ? '0' : ('a'-10)); + if(isxdigit((int) ch)) { + map_get_tile(x, y)->special=ch-(isdigit((int) ch) ? '0' : ('a'-10)); } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(lower) (map.l) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -298,8 +298,8 @@ for(x=0; xspecial|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<4; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->special|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<4; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(upper) (map.u) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -316,8 +316,8 @@ for(x=0; xspecial|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<8; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->special|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<8; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(next) (map.n) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -335,8 +335,8 @@ for(x=0; xspecial|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<12; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->special|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<12; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(final) (map.f) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -354,8 +354,8 @@ for(x=0; xsent=0; - if(isxdigit(ch)) { - map_get_tile(x, y)->known=ch-(isdigit(ch) ? '0' : ('a'-10)); + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known=ch-(isdigit((int) ch) ? '0' : ('a'-10)); } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.a) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -371,8 +371,8 @@ char *terline=secfile_lookup_str(file, "map.b%03d", y); for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<4; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<4; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.b) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -386,8 +386,8 @@ char *terline=secfile_lookup_str(file, "map.c%03d", y); for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<8; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<8; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.c) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -402,8 +402,8 @@ for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<12; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<12; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.d) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -419,8 +419,8 @@ for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<16; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<16; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.e) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -435,8 +435,8 @@ for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<20; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<20; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.g) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -451,8 +451,8 @@ for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<24; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<24; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.h) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -467,8 +467,8 @@ for(x=0; xknown|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<28; + if(isxdigit((int) ch)) { + map_get_tile(x, y)->known|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<28; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown known flag (map.i) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -1280,8 +1280,8 @@ for(x=0; xspecial=ch-(isdigit(ch) ? '0' : ('a'-10)); + if(isxdigit((int) ch)) { + map_get_player_tile(x, y, plr)->special=ch-(isdigit((int) ch) ? '0' : ('a'-10)); } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(lower) (map.l) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -1299,8 +1299,8 @@ for(x=0; xspecial|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<4; + if(isxdigit((int) ch)) { + map_get_player_tile(x, y, plr)->special|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<4; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(upper) (map.u) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -1317,8 +1317,8 @@ for(x=0; xspecial|=(ch-(isdigit(ch) ? '0' : 'a'-10))<<8; + if(isxdigit((int) ch)) { + map_get_player_tile(x, y, plr)->special|=(ch-(isdigit((int) ch) ? '0' : 'a'-10))<<8; } else if(ch!=' ') { freelog(LOG_FATAL, "unknown special flag(next) (map.n) in map " "at position(%d,%d): %d '%c'", x, y, ch, ch); @@ -1335,7 +1335,7 @@ for(x=0; xlast_updated = ch-(isdigit(ch) ? '0' : ('a'-10)); + map_get_player_tile(x, y, plr)->last_updated = ch-(isdigit((int) ch) ? '0' : ('a'-10)); } } @@ -1345,7 +1345,7 @@ for(x=0; xlast_updated |= (ch-(isdigit(ch) ? '0' : 'a'-10))<<4; + map_get_player_tile(x, y, plr)->last_updated |= (ch-(isdigit((int) ch) ? '0' : 'a'-10))<<4; } } @@ -1356,7 +1356,7 @@ if (terline) { for(x=0; xlast_updated |= (ch-(isdigit(ch) ? '0' : 'a'-10))<<8; + map_get_player_tile(x, y, plr)->last_updated |= (ch-(isdigit((int) ch) ? '0' : 'a'-10))<<8; } } } @@ -1368,7 +1368,7 @@ if (terline) { for(x=0; xlast_updated |= (ch-(isdigit(ch) ? '0' : 'a'-10))<<12; + map_get_player_tile(x, y, plr)->last_updated |= (ch-(isdigit((int) ch) ? '0' : 'a'-10))<<12; } } } Index: server/stdinhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v retrieving revision 1.191 diff -u -r1.191 stdinhand.c --- server/stdinhand.c 2001/09/08 21:33:50 1.191 +++ server/stdinhand.c 2001/09/10 23:37:49 @@ -1911,7 +1911,7 @@ if (*s == '\0') goto usage; rules = s; - while (*s && !isspace(*s)) s++; + while (*s && !isspace((int) *s)) s++; if (*s == '\0') goto usage; *s = '\0'; /* terminate rules */ @@ -2044,10 +2044,10 @@ struct connection *ptarget; /* find the start of the level: */ - for(cptr_s=str; *cptr_s && !isalnum(*cptr_s); cptr_s++); + for(cptr_s=str; *cptr_s && !isalnum((int) *cptr_s); cptr_s++); /* copy the level into arg_level[] */ - for(cptr_d=arg_level; *cptr_s && isalnum(*cptr_s); cptr_s++, cptr_d++) { + for(cptr_d=arg_level; *cptr_s && isalnum((int) *cptr_s); cptr_s++, cptr_d++) { *cptr_d=*cptr_s; } *cptr_d='\0'; @@ -2087,11 +2087,11 @@ } /* find the start of the name: */ - for(; *cptr_s && !isalnum(*cptr_s); cptr_s++); + for(; *cptr_s && !isalnum((int) *cptr_s); cptr_s++); /* copy the name into arg_name[] */ for(cptr_d=arg_name; - *cptr_s && (*cptr_s == '-' || *cptr_s == ' ' || isalnum(*cptr_s)); + *cptr_s && (*cptr_s == '-' || *cptr_s == ' ' || isalnum((int) *cptr_s)); cptr_s++ , cptr_d++) { *cptr_d=*cptr_s; } @@ -2311,8 +2311,8 @@ char command[MAX_LEN_CONSOLE_LINE], *cptr_s, *cptr_d; int cmd; - for(cptr_s=str; *cptr_s && !isalnum(*cptr_s); cptr_s++); - for(cptr_d=command; *cptr_s && isalnum(*cptr_s); cptr_s++, cptr_d++) + for(cptr_s=str; *cptr_s && !isalnum((int) *cptr_s); cptr_s++); + for(cptr_d=command; *cptr_s && isalnum((int) *cptr_s); cptr_s++, cptr_d++) *cptr_d=*cptr_s; *cptr_d='\0'; @@ -2463,8 +2463,8 @@ int cmd,i,len1; int clen = 0; - for(cptr_s=str; *cptr_s && !isalnum(*cptr_s); cptr_s++); - for(cptr_d=command; *cptr_s && isalnum(*cptr_s); cptr_s++, cptr_d++) + for(cptr_s=str; *cptr_s && !isalnum((int) *cptr_s); cptr_s++); + for(cptr_d=command; *cptr_s && isalnum((int) *cptr_s); cptr_s++, cptr_d++) *cptr_d=*cptr_s; *cptr_d='\0'; @@ -2552,7 +2552,7 @@ ******************************************************************/ static int is_ok_opt_name_char(char c) { - return isalnum(c); + return isalnum((int) c); } /****************************************************************** @@ -2560,7 +2560,7 @@ ******************************************************************/ static int is_ok_opt_value_char(char c) { - return (c == '-') || (c == '*') || (c == '+') || (c == '=') || isalnum(c); + return (c == '-') || (c == '*') || (c == '+') || (c == '=') || isalnum((int) c); } /****************************************************************** @@ -2568,7 +2568,7 @@ ******************************************************************/ static int is_ok_opt_name_value_sep_char(char c) { - return (c == '=') || isspace(c); + return (c == '=') || isspace((int) c); } /****************************************************************** @@ -2725,7 +2725,7 @@ /* Is it a comment or a blank line? */ /* line is comment if the first non-whitespace character is '#': */ - for(cptr_s=str; *cptr_s && isspace(*cptr_s); cptr_s++); + for(cptr_s=str; *cptr_s && isspace((int) *cptr_s); cptr_s++); if(*cptr_s == 0 || *cptr_s == '#') { return; } @@ -2734,14 +2734,14 @@ given on the server command line - rp */ if (*cptr_s == SERVER_COMMAND_PREFIX) cptr_s++; - for(; *cptr_s && !isalnum(*cptr_s); cptr_s++); + for(; *cptr_s && !isalnum((int) *cptr_s); cptr_s++); /* * cptr_s points now to the beginning of the real command. It has * skipped leading whitespace, the SERVER_COMMAND_PREFIX and any * other non-alphanumeric characters. */ - for(cptr_d=command; *cptr_s && isalnum(*cptr_s) && + for(cptr_d=command; *cptr_s && isalnum((int) *cptr_s) && cptr_d < command+sizeof(command)-1; cptr_s++, cptr_d++) *cptr_d=*cptr_s; *cptr_d='\0'; @@ -2765,13 +2765,13 @@ return; } - for(; *cptr_s && isspace(*cptr_s); cptr_s++); + for(; *cptr_s && isspace((int) *cptr_s); cptr_s++); sz_strlcpy(arg, cptr_s); cut_comment(arg); i=strlen(arg)-1; - while(i>0 && isspace(arg[i])) + while(i>0 && isspace((int) arg[i])) arg[i--]='\0'; switch(cmd) {