diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-03-12 16:26:16 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-03-12 16:26:16 +0000 |
commit | bab5c5fac0fba6b6e0735e8bd9dfecb7bd474700 (patch) | |
tree | c6bea75d9210d3d657b34686d6592f329a01e3d9 | |
parent | 2010-03-12 Sebastian Huber <Sebastian.Huber@embedded-brains.de> (diff) | |
download | rtems-bab5c5fac0fba6b6e0735e8bd9dfecb7bd474700.tar.bz2 |
2010-03-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* ftpd/ftpd.c, httpd/asp.c, httpd/ejparse.c, httpd/emfdb.c,
httpd/misc.c, httpd/um.c, httpd/webs.c, httpd/websuemf.c,
libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_format.c,
libfs/src/dosfs/msdos_misc.c, libfs/src/nfsclient/src/nfs.c,
libmisc/capture/capture-cli.c, libmisc/monitor/mon-network.c,
libmisc/shell/hexdump-odsyntax.c, libmisc/shell/main_ifconfig.c,
libmisc/shell/shell.c, libmisc/shell/shell_makeargs.c,
libmisc/uuid/parse.c, libnetworking/libc/gethostbydns.c,
libnetworking/libc/gethostbyht.c, libnetworking/libc/gethostnamadr.c,
libnetworking/libc/getnetnamadr.c, libnetworking/libc/inet_addr.c,
libnetworking/libc/inet_network.c, libnetworking/libc/res_debug.c,
libnetworking/libc/res_init.c, libnetworking/libc/res_query.c,
libnetworking/rtems/rtems_mii_ioctl.c,
score/src/objectgetnameasstring.c: Readdress use of ctype methods per
recommendation from D.J. Delorie on the newlib mailing list. We
should pass an unsigned char into these methods.
Diffstat (limited to '')
31 files changed, 111 insertions, 92 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 4d1d8187e0..9c73d13b07 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,22 @@ +2010-03-12 Joel Sherrill <joel.sherrill@oarcorp.com> + + * ftpd/ftpd.c, httpd/asp.c, httpd/ejparse.c, httpd/emfdb.c, + httpd/misc.c, httpd/um.c, httpd/webs.c, httpd/websuemf.c, + libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_format.c, + libfs/src/dosfs/msdos_misc.c, libfs/src/nfsclient/src/nfs.c, + libmisc/capture/capture-cli.c, libmisc/monitor/mon-network.c, + libmisc/shell/hexdump-odsyntax.c, libmisc/shell/main_ifconfig.c, + libmisc/shell/shell.c, libmisc/shell/shell_makeargs.c, + libmisc/uuid/parse.c, libnetworking/libc/gethostbydns.c, + libnetworking/libc/gethostbyht.c, libnetworking/libc/gethostnamadr.c, + libnetworking/libc/getnetnamadr.c, libnetworking/libc/inet_addr.c, + libnetworking/libc/inet_network.c, libnetworking/libc/res_debug.c, + libnetworking/libc/res_init.c, libnetworking/libc/res_query.c, + libnetworking/rtems/rtems_mii_ioctl.c, + score/src/objectgetnameasstring.c: Readdress use of ctype methods per + recommendation from D.J. Delorie on the newlib mailing list. We + should pass an unsigned char into these methods. + 2010-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de> * libfs/src/dosfs/msdos_misc.c: Do not overwrite errno in case diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c index 92f2946c94..51fd93f428 100644 --- a/cpukit/ftpd/ftpd.c +++ b/cpukit/ftpd/ftpd.c @@ -1568,18 +1568,18 @@ skip_options(char **p) char* buf = *p; char* last = NULL; while(1) { - while(isspace((int)*buf)) + while(isspace((unsigned char)*buf)) ++buf; if(*buf == '-') { if(*++buf == '-') { /* `--' should terminate options */ - if(isspace((int)*++buf)) { + if(isspace((unsigned char)*++buf)) { last = buf; do ++buf; - while(isspace((int)*buf)); + while(isspace((unsigned char)*buf)); break; } } - while(*buf && !isspace((int)*buf)) + while(*buf && !isspace((unsigned char)*buf)) ++buf; last = buf; } @@ -1612,18 +1612,18 @@ split_command(char *buf, char **cmd, char **opts, char **args) { char* eoc; char* p = buf; - while(isspace((int)*p)) + while(isspace((unsigned char)*p)) ++p; *cmd = p; - while(*p && !isspace((int)*p)) + while(*p && !isspace((unsigned char)*p)) { - *p = toupper((int)*p); + *p = toupper((unsigned char)*p); ++p; } eoc = p; if(*p) *p++ = '\0'; - while(isspace((int)*p)) + while(isspace((unsigned char)*p)) ++p; *opts = p; skip_options(&p); diff --git a/cpukit/httpd/asp.c b/cpukit/httpd/asp.c index 26fcac3a3c..b31236fbfe 100644 --- a/cpukit/httpd/asp.c +++ b/cpukit/httpd/asp.c @@ -287,7 +287,7 @@ static char_t *strtokcmp(char_t *s1, char_t *s2) s1 = skipWhite(s1); len = gstrlen(s2); - for (len = gstrlen(s2); len > 0 && (tolower((int)*s1) == tolower((int)*s2)); len--) { + for (len = gstrlen(s2); len > 0 && (tolower((unsigned char)*s1) == tolower((unsigned char)*s2)); len--) { if (*s2 == '\0') { return s1; } @@ -312,7 +312,7 @@ static char_t *skipWhite(char_t *s) if (s == NULL) { return s; } - while (*s && gisspace((int)*s)) { + while (*s && gisspace((unsigned char)*s)) { s++; } return s; diff --git a/cpukit/httpd/ejparse.c b/cpukit/httpd/ejparse.c index 59fc785752..f2e97a221b 100644 --- a/cpukit/httpd/ejparse.c +++ b/cpukit/httpd/ejparse.c @@ -1144,7 +1144,7 @@ static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs) a_assert(rel > 0); lval = 0; - if (gisdigit((int)*lhs) && gisdigit((int)*rhs)) { + if (gisdigit((unsigned char)*lhs) && gisdigit((unsigned char)*rhs)) { l = gatoi(lhs); r = gatoi(rhs); switch (rel) { @@ -1159,7 +1159,7 @@ static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs) return -1; } } else { - if (!gisdigit((int)*lhs)) { + if (!gisdigit((unsigned char)*lhs)) { ejError(ep, T("Conditional must be numeric"), lhs); } else { ejError(ep, T("Conditional must be numeric"), rhs); @@ -1190,7 +1190,7 @@ static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs) */ numeric = 1; for (cp = lhs; *cp; cp++) { - if (!gisdigit((int)*cp)) { + if (!gisdigit((unsigned char)*cp)) { numeric = 0; break; } @@ -1198,7 +1198,7 @@ static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs) if (numeric) { for (cp = rhs; *cp; cp++) { - if (!gisdigit((int)*cp)) { + if (!gisdigit((unsigned char)*cp)) { numeric = 0; break; } diff --git a/cpukit/httpd/emfdb.c b/cpukit/httpd/emfdb.c index 242aa929bb..e3a8072d0f 100644 --- a/cpukit/httpd/emfdb.c +++ b/cpukit/httpd/emfdb.c @@ -980,7 +980,7 @@ char_t *dbGetTableName(int did, int tid) static char_t *trim(char_t *str) { - while (isspace((int)*str)) { + while (isspace((unsigned char)*str)) { str++; } return str; diff --git a/cpukit/httpd/misc.c b/cpukit/httpd/misc.c index 7d8c6d71c9..f9f4aac144 100644 --- a/cpukit/httpd/misc.c +++ b/cpukit/httpd/misc.c @@ -281,7 +281,7 @@ static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, int msize) } c = *fmt++; } else { - for ( ; gisdigit((int)c); c = *fmt++) { + for ( ; gisdigit((unsigned char)c); c = *fmt++) { width = width * 10 + (c - '0'); } } @@ -292,7 +292,7 @@ static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, int msize) prec = va_arg(arg, int); c = *fmt++; } else { - for (prec = 0; gisdigit((int)c); c = *fmt++) { + for (prec = 0; gisdigit((unsigned char)c); c = *fmt++) { prec = prec * 10 + (c - '0'); } } diff --git a/cpukit/httpd/um.c b/cpukit/httpd/um.c index b2ea6671db..58e288affb 100644 --- a/cpukit/httpd/um.c +++ b/cpukit/httpd/um.c @@ -1419,7 +1419,7 @@ static bool_t umCheckName(char_t *name) if (name && *name) { while (*name) { - if (gisspace((int)*name)) { + if (gisspace((unsigned char)*name)) { return FALSE; } diff --git a/cpukit/httpd/webs.c b/cpukit/httpd/webs.c index 8fe5a6aa65..509e7061d8 100644 --- a/cpukit/httpd/webs.c +++ b/cpukit/httpd/webs.c @@ -861,7 +861,7 @@ static void websParseRequest(webs_t wp) value = T(""); } - while (gisspace((int)*value)) { + while (gisspace((unsigned char)*value)) { value++; } strlower(key); @@ -897,7 +897,7 @@ static void websParseRequest(webs_t wp) * Truncate authType at the next non-alpha character */ cp = authType; - while (gisalpha((int)*cp)) { + while (gisalpha((unsigned char)*cp)) { cp++; } *cp = '\0'; diff --git a/cpukit/httpd/websuemf.c b/cpukit/httpd/websuemf.c index 267ada8c2f..2a2cb19ea4 100644 --- a/cpukit/httpd/websuemf.c +++ b/cpukit/httpd/websuemf.c @@ -84,7 +84,7 @@ int strcmpci(char_t *s1, char_t *s2) } do { - rc = gtolower((int)*s1) - gtolower((int)*s2); + rc = gtolower((unsigned char)*s1) - gtolower((unsigned char)*s2); if (*s1 == '\0') { break; } diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index 1bb5c73024..9140bc7229 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -146,7 +146,7 @@ msdos_format_dirent_with_dot(char *dst,const char *src) src_tmp = src; len = i; while (i-- > 0) { - *dst++ = tolower((int)(*src_tmp++)); + *dst++ = tolower((unsigned char)(*src_tmp++)); } /* * find last non-blank character of extension @@ -165,7 +165,7 @@ msdos_format_dirent_with_dot(char *dst,const char *src) len += i + 1; /* extension + dot */ src_tmp = src + MSDOS_SHORT_BASE_LEN; while (i-- > 0) { - *dst++ = tolower((int)(*src_tmp++)); + *dst++ = tolower((unsigned char)(*src_tmp++)); len++; } } diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c index d2ec19b267..6c331527a0 100644 --- a/cpukit/libfs/src/dosfs/msdos_format.c +++ b/cpukit/libfs/src/dosfs/msdos_format.c @@ -648,7 +648,7 @@ static int msdos_format_determine_fmt_params for (cnt = 0; cnt < (sizeof(fmt_params->OEMName)-1); cnt++) { - if (isprint((int)*from)) { + if (isprint((unsigned char)*from)) { *to++ = *from++; } else { @@ -679,7 +679,7 @@ static int msdos_format_determine_fmt_params for (cnt = 0; cnt < (sizeof(fmt_params->VolLabel)-1); cnt++) { - if (isprint((int)*from)) { + if (isprint((unsigned char)*from)) { *to++ = *from++; } else { diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 67573b8505..e6dfb415b4 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -65,7 +65,7 @@ msdos_is_valid_name_char(const char ch) if (strchr(" +,;=[]", ch) != NULL) return MSDOS_NAME_LONG; - if ((ch == '.') || isalnum((int)ch) || + if ((ch == '.') || isalnum((unsigned char)ch) || (strchr("$%'-_@~`!(){}^#&", ch) != NULL)) return MSDOS_NAME_SHORT; diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index 53bfa770fb..ec158e8e7c 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -3262,7 +3262,7 @@ char *dev = 0; host++; } - if (isdigit((int)*host)) { + if (isdigit((unsigned char)*host)) { /* avoid using gethostbyname */ sprintf(dev,"%s:%s",uidhost,path); } else { diff --git a/cpukit/libmisc/capture/capture-cli.c b/cpukit/libmisc/capture/capture-cli.c index 7f8e37c66e..98f76764f3 100644 --- a/cpukit/libmisc/capture/capture-cli.c +++ b/cpukit/libmisc/capture/capture-cli.c @@ -642,7 +642,7 @@ rtems_capture_cli_get_name_id (char* arg, l = strlen (arg); for (i = 0; i < l; i++) - if (!isxdigit ((int)arg[i])) + if (!isxdigit ((unsigned char)arg[i])) break; if (i == l) @@ -1324,7 +1324,7 @@ rtems_capture_cli_trace_records (int argc, l = strlen (argv[arg]); for (i = 0; i < l; i++) - if (!isdigit ((int)argv[arg][i])) + if (!isdigit ((unsigned char)argv[arg][i])) { fprintf (stdout, "error: not a number\n"); return; diff --git a/cpukit/libmisc/monitor/mon-network.c b/cpukit/libmisc/monitor/mon-network.c index f311b0de09..52c0cd9852 100644 --- a/cpukit/libmisc/monitor/mon-network.c +++ b/cpukit/libmisc/monitor/mon-network.c @@ -70,7 +70,7 @@ void mon_ifconfig(int argc, char *argv[], cur_idx += 1; } else { iface = argv[1]; - if (isdigit((int)*argv[2])) { + if (isdigit((unsigned char)*argv[2])) { if (inet_pton(AF_INET, argv[2], &ipaddr.sin_addr) < 0) { printf("bad ip address: %s\n", argv[2]); return; diff --git a/cpukit/libmisc/shell/hexdump-odsyntax.c b/cpukit/libmisc/shell/hexdump-odsyntax.c index 3924a680af..c18c40b9e8 100644 --- a/cpukit/libmisc/shell/hexdump-odsyntax.c +++ b/cpukit/libmisc/shell/hexdump-odsyntax.c @@ -219,7 +219,7 @@ odoffset(rtems_shell_hexdump_globals* globals, int argc, char ***argvp) p = argc == 1 ? (*argvp)[0] : (*argvp)[1]; if (*p != '+' && (argc < 2 || - (!isdigit((int)p[0]) && (p[0] != 'x' || !isxdigit((int)p[1]))))) + (!isdigit((unsigned char)p[0]) && (p[0] != 'x' || !isxdigit((unsigned char)p[1]))))) return; base = 0; @@ -229,7 +229,7 @@ odoffset(rtems_shell_hexdump_globals* globals, int argc, char ***argvp) */ if (p[0] == '+') ++p; - if (p[0] == 'x' && isxdigit((int)p[1])) { + if (p[0] == 'x' && isxdigit((unsigned char)p[1])) { ++p; base = 16; } else if (p[0] == '0' && p[1] == 'x') { @@ -239,9 +239,9 @@ odoffset(rtems_shell_hexdump_globals* globals, int argc, char ***argvp) /* skip over the number */ if (base == 16) - for (num = p; isxdigit((int)*p); ++p); + for (num = p; isxdigit((unsigned char)*p); ++p); else - for (num = p; isdigit((int)*p); ++p); + for (num = p; isdigit((unsigned char)*p); ++p); /* check for no number */ if (num == p) diff --git a/cpukit/libmisc/shell/main_ifconfig.c b/cpukit/libmisc/shell/main_ifconfig.c index b314dc9b9c..9f16207b10 100644 --- a/cpukit/libmisc/shell/main_ifconfig.c +++ b/cpukit/libmisc/shell/main_ifconfig.c @@ -73,7 +73,7 @@ int rtems_shell_main_ifconfig( cur_idx += 1; } else { iface = argv[1]; - if (isdigit((int)*argv[2])) { + if (isdigit((unsigned char)*argv[2])) { if (inet_pton(AF_INET, argv[2], &ipaddr.sin_addr) < 0) { printf("bad ip address: %s\n", argv[2]); return 0; diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c index 6e2096433a..bcc146731b 100644 --- a/cpukit/libmisc/shell/shell.c +++ b/cpukit/libmisc/shell/shell.c @@ -765,7 +765,7 @@ bool rtems_shell_main_loop( /* evaluate cmd section */ c = cmds[cmd]; while (*c) { - if (!isblank((int)*c)) + if (!isblank((unsigned char)*c)) break; c++; } diff --git a/cpukit/libmisc/shell/shell_makeargs.c b/cpukit/libmisc/shell/shell_makeargs.c index 346a8706b5..248a8c6a89 100644 --- a/cpukit/libmisc/shell/shell_makeargs.c +++ b/cpukit/libmisc/shell/shell_makeargs.c @@ -34,7 +34,7 @@ int rtems_shell_make_args( while ( *ch ) { - while ( isspace((int)*ch) ) ch++; + while ( isspace((unsigned char)*ch) ) ch++; if ( *ch == '\0' ) break; @@ -44,7 +44,7 @@ int rtems_shell_make_args( while ( ( *ch == '\0' ) && ( *ch != '"' ) ) ch++; } else { argv_p[ argc++ ] = ch; - while ( ( *ch == '\0' ) && ( !isspace((int)*ch) ) ) ch++; + while ( ( *ch == '\0' ) && ( !isspace((unsigned char)*ch) ) ) ch++; } if ( *ch == '\0' ) diff --git a/cpukit/libmisc/uuid/parse.c b/cpukit/libmisc/uuid/parse.c index aa003dec32..d2f04f9f85 100644 --- a/cpukit/libmisc/uuid/parse.c +++ b/cpukit/libmisc/uuid/parse.c @@ -61,7 +61,7 @@ int uuid_parse(const char *in, uuid_t uu) if (i== 36) if (*cp == 0) continue; - if (!isxdigit((int)*cp)) + if (!isxdigit((unsigned char)*cp)) return -1; } uuid.time_low = strtoul(in, NULL, 16); diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c index 07d6f2042b..28c31713a0 100644 --- a/cpukit/libnetworking/libc/gethostbydns.c +++ b/cpukit/libnetworking/libc/gethostbydns.c @@ -516,7 +516,7 @@ _gethostbydnsname( * disallow names consisting only of digits/dots, unless * they end in a dot. */ - if (isdigit((int)name[0])) + if (isdigit((unsigned char)name[0])) for (cp = name;; ++cp) { if (!*cp) { if (*--cp == '.') @@ -545,10 +545,10 @@ _gethostbydnsname( h_errno = NETDB_SUCCESS; return (&host); } - if (!isdigit((int)*cp) && *cp != '.') + if (!isdigit((unsigned char)*cp) && *cp != '.') break; } - if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) || + if ((isxdigit((unsigned char)name[0]) && strchr(name, ':') != NULL) || name[0] == ':') for (cp = name;; ++cp) { if (!*cp) { @@ -576,7 +576,7 @@ _gethostbydnsname( h_errno = NETDB_SUCCESS; return (&host); } - if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.') + if (!isxdigit((unsigned char)*cp) && *cp != ':' && *cp != '.') break; } diff --git a/cpukit/libnetworking/libc/gethostbyht.c b/cpukit/libnetworking/libc/gethostbyht.c index e20414ca45..915adfc62c 100644 --- a/cpukit/libnetworking/libc/gethostbyht.c +++ b/cpukit/libnetworking/libc/gethostbyht.c @@ -252,7 +252,7 @@ again: if (*cur=='#' || *cur=='\n') goto parseerror; /* first, the ip number */ pe->h_name=cur; - while (cur<last && !isspace((int)*cur)) cur++; + while (cur<last && !isspace((unsigned char)*cur)) cur++; if (cur>=last) return 0; if (*cur=='\n') goto parseerror; { @@ -278,9 +278,9 @@ again: ++cur; /* now the aliases */ for (aliasidx=0;aliasidx<9;++aliasidx) { - while (cur<last && isblank((int)*cur)) ++cur; + while (cur<last && isblank((unsigned char)*cur)) ++cur; pe->h_aliases[aliasidx]=cur; - while (cur<last && !isspace((int)*cur)) ++cur; + while (cur<last && !isspace((unsigned char)*cur)) ++cur; { char *from=pe->h_aliases[aliasidx]; int len=cur-from; @@ -291,7 +291,7 @@ again: *dest=0; ++dest; } if (*cur=='\n') { ++cur; ++aliasidx; break; } - if (cur>=last || !isblank((int)*cur)) break; + if (cur>=last || !isblank((unsigned char)*cur)) break; cur++; } pe->h_aliases[aliasidx]=0; diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c index 2513fbf2b2..6fb3157299 100644 --- a/cpukit/libnetworking/libc/gethostnamadr.c +++ b/cpukit/libnetworking/libc/gethostnamadr.c @@ -102,7 +102,7 @@ init_services(void) if (cp == NULL) continue; do { - if (isalpha((int)cp[0])) { + if (isalpha((unsigned char)cp[0])) { service_order[cc] = get_service_name(cp); if(service_order[cc] != SERVICE_NONE) cc++; diff --git a/cpukit/libnetworking/libc/getnetnamadr.c b/cpukit/libnetworking/libc/getnetnamadr.c index 0ce9341f1f..736444fc14 100644 --- a/cpukit/libnetworking/libc/getnetnamadr.c +++ b/cpukit/libnetworking/libc/getnetnamadr.c @@ -101,7 +101,7 @@ init_services(void) if (cp == NULL) continue; do { - if (isalpha((int)cp[0])) { + if (isalpha((unsigned char)cp[0])) { service_order[cc] = get_service_name(cp); if(service_order[cc] != SERVICE_NONE) cc++; diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c index 1d86052c18..9820e25ce2 100644 --- a/cpukit/libnetworking/libc/inet_addr.c +++ b/cpukit/libnetworking/libc/inet_addr.c @@ -102,7 +102,7 @@ inet_aton( * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ - if (!isdigit((int)c)) + if (!isdigit((unsigned char)c)) return (0); val = 0; base = 10; if (c == '0') { @@ -113,12 +113,12 @@ inet_aton( base = 8; } for (;;) { - if (isascii((int)c) && isdigit((int)c)) { + if (isascii((unsigned char)c) && isdigit((unsigned char)c)) { val = (val * base) + (c - '0'); c = *++cp; - } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) { + } else if (base == 16 && isascii((unsigned char)c) && isxdigit((unsigned char)c)) { val = (val << 4) | - (c + 10 - (islower((int)c) ? 'a' : 'A')); + (c + 10 - (islower((unsigned char)c) ? 'a' : 'A')); c = *++cp; } else break; @@ -140,7 +140,7 @@ inet_aton( /* * Check for trailing characters. */ - if (c != '\0' && (!isascii((int)c) || !isspace((int)c))) + if (c != '\0' && (!isascii((unsigned char)c) || !isspace((unsigned char)c))) return (0); /* * Concoct the address according to diff --git a/cpukit/libnetworking/libc/inet_network.c b/cpukit/libnetworking/libc/inet_network.c index 1efbf19ca3..ffeaa900a1 100644 --- a/cpukit/libnetworking/libc/inet_network.c +++ b/cpukit/libnetworking/libc/inet_network.c @@ -62,13 +62,13 @@ again: if (*cp == 'x' || *cp == 'X') base = 16, cp++; while ((c = *cp) != 0) { - if (isdigit((int)c)) { + if (isdigit((unsigned char)c)) { val = (val * base) + (c - '0'); cp++; continue; } - if (base == 16 && isxdigit((int)c)) { - val = (val << 4) + (c + 10 - (islower((int)c) ? 'a' : 'A')); + if (base == 16 && isxdigit((unsigned char)c)) { + val = (val << 4) + (c + 10 - (islower((unsigned char)c) ? 'a' : 'A')); cp++; continue; } @@ -80,7 +80,7 @@ again: *pp++ = val, cp++; goto again; } - if (*cp && !isspace((int)*cp)) + if (*cp && !isspace((unsigned char)*cp)) return (INADDR_NONE); *pp++ = val; n = pp - parts; diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c index f7a36abf25..c4792e3e72 100644 --- a/cpukit/libnetworking/libc/res_debug.c +++ b/cpukit/libnetworking/libc/res_debug.c @@ -579,14 +579,14 @@ precsize_aton( cp = *strptr; - while (isdigit((int)*cp)) + while (isdigit((unsigned char)*cp)) mval = mval * 10 + (*cp++ - '0'); if (*cp == '.') { /* centimeters */ cp++; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { cmval = (*cp++ - '0') * 10; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { cmval += (*cp++ - '0'); } } @@ -620,44 +620,44 @@ latlon2ul( cp = *latlonstrptr; - while (isdigit((int)*cp)) + while (isdigit((unsigned char)*cp)) deg = deg * 10 + (*cp++ - '0'); - while (isspace((int)*cp)) + while (isspace((unsigned char)*cp)) cp++; - if (!(isdigit((int)*cp))) + if (!(isdigit((unsigned char)*cp))) goto fndhemi; - while (isdigit((int)*cp)) + while (isdigit((unsigned char)*cp)) min = min * 10 + (*cp++ - '0'); - while (isspace((int)*cp)) + while (isspace((unsigned char)*cp)) cp++; - if (!(isdigit((int)*cp))) + if (!(isdigit((unsigned char)*cp))) goto fndhemi; - while (isdigit((int)*cp)) + while (isdigit((unsigned char)*cp)) secs = secs * 10 + (*cp++ - '0'); if (*cp == '.') { /* decimal seconds */ cp++; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { secsfrac = (*cp++ - '0') * 100; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { secsfrac += (*cp++ - '0') * 10; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { secsfrac += (*cp++ - '0'); } } } } - while (!isspace((int)*cp)) /* if any trailing garbage */ + while (!isspace((unsigned char)*cp)) /* if any trailing garbage */ cp++; - while (isspace((int)*cp)) + while (isspace((unsigned char)*cp)) cp++; fndhemi: @@ -695,10 +695,10 @@ latlon2ul( cp++; /* skip the hemisphere */ - while (!isspace((int)*cp)) /* if any trailing garbage */ + while (!isspace((unsigned char)*cp)) /* if any trailing garbage */ cp++; - while (isspace((int)*cp)) /* move to next field */ + while (isspace((unsigned char)*cp)) /* move to next field */ cp++; *latlonstrptr = cp; @@ -756,14 +756,14 @@ loc_aton( if (*cp == '+') cp++; - while (isdigit((int)*cp)) + while (isdigit((unsigned char)*cp)) altmeters = altmeters * 10 + (*cp++ - '0'); if (*cp == '.') { /* decimal meters */ cp++; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { altfrac = (*cp++ - '0') * 10; - if (isdigit((int)*cp)) { + if (isdigit((unsigned char)*cp)) { altfrac += (*cp++ - '0'); } } @@ -771,10 +771,10 @@ loc_aton( alt = (10000000 + (altsign * (altmeters * 100 + altfrac))); - while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((unsigned char)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace((int)*cp) && (cp < maxcp)) + while (isspace((unsigned char)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) @@ -782,10 +782,10 @@ loc_aton( siz = precsize_aton(&cp); - while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((unsigned char)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace((int)*cp) && (cp < maxcp)) + while (isspace((unsigned char)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) @@ -793,10 +793,10 @@ loc_aton( hp = precsize_aton(&cp); - while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((unsigned char)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace((int)*cp) && (cp < maxcp)) + while (isspace((unsigned char)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c index 564c230311..9af80e3727 100644 --- a/cpukit/libnetworking/libc/res_init.c +++ b/cpukit/libnetworking/libc/res_init.c @@ -340,7 +340,7 @@ res_init(void) break; net = cp; while (*cp && !ISSORTMASK(*cp) && *cp != ';' && - isascii((int)*cp) && !isspace((int)*cp)) + isascii((unsigned char)*cp) && !isspace((unsigned char)*cp)) cp++; n = *cp; *cp = 0; @@ -350,7 +350,7 @@ res_init(void) *cp++ = n; net = cp; while (*cp && *cp != ';' && - isascii((int)*cp) && !isspace((int)*cp)) + isascii((unsigned char)*cp) && !isspace((unsigned char)*cp)) cp++; n = *cp; *cp = 0; diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c index f53327511b..00a0c30041 100644 --- a/cpukit/libnetworking/libc/res_query.c +++ b/cpukit/libnetworking/libc/res_query.c @@ -384,17 +384,17 @@ hostalias(const char *name) setbuf(fp, NULL); buf[sizeof(buf) - 1] = '\0'; while (fgets(buf, sizeof(buf), fp)) { - for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1) + for (cp1 = buf; *cp1 && !isspace((unsigned char)*cp1); ++cp1) ; if (!*cp1) break; *cp1 = '\0'; if (!strcasecmp(buf, name)) { - while (isspace((int)*++cp1)) + while (isspace((unsigned char)*++cp1)) ; if (!*cp1) break; - for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2) + for (cp2 = cp1 + 1; *cp2 && !isspace((unsigned char)*cp2); ++cp2) ; abuf[sizeof(abuf) - 1] = *cp2 = '\0'; strncpy(abuf, cp1, sizeof(abuf) - 1); diff --git a/cpukit/libnetworking/rtems/rtems_mii_ioctl.c b/cpukit/libnetworking/rtems/rtems_mii_ioctl.c index b2b8b4d35f..93e9a0d580 100644 --- a/cpukit/libnetworking/rtems/rtems_mii_ioctl.c +++ b/cpukit/libnetworking/rtems/rtems_mii_ioctl.c @@ -158,9 +158,9 @@ rtems_str2ifmedia (const char *str, int phy) return 0; if (!strncmp (chpt, "ase", 3)) chpt += 3; - if (toupper ((int)*chpt++) != 'T') + if (toupper ((unsigned char)*chpt++) != 'T') return 0; - if (IFM_100_TX == sub && toupper ((int)*chpt++) != 'X') + if (IFM_100_TX == sub && toupper ((unsigned char)*chpt++) != 'X') return 0; } } diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c index a764b74296..4c15cd9811 100644 --- a/cpukit/score/src/objectgetnameasstring.c +++ b/cpukit/score/src/objectgetnameasstring.c @@ -84,7 +84,7 @@ char *_Objects_Get_name_as_string( d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { - *d = (isprint((int)*s)) ? *s : '*'; + *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; |