From ff0f694d466fb114c185bf464811658f97d012f1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 20 Aug 1998 21:47:37 +0000 Subject: Fixed many warnings. --- cpukit/libnetworking/libc/base64.c | 2 ++ cpukit/libnetworking/libc/gethostbydns.c | 8 ++--- cpukit/libnetworking/libc/gethostnamadr.c | 2 +- cpukit/libnetworking/libc/inet_addr.c | 10 +++--- cpukit/libnetworking/libc/ns_name.c | 8 +++-- cpukit/libnetworking/libc/ns_netint.c | 6 ++-- cpukit/libnetworking/libc/ns_parse.c | 6 ++-- cpukit/libnetworking/libc/ns_print.c | 6 ++-- cpukit/libnetworking/libc/ns_ttl.c | 8 +++-- cpukit/libnetworking/libc/res_config.h | 8 +++++ cpukit/libnetworking/libc/res_debug.c | 54 +++++++++++++++---------------- cpukit/libnetworking/libc/res_init.c | 4 +-- cpukit/libnetworking/libc/res_mkupdate.c | 9 +++--- cpukit/libnetworking/libc/res_query.c | 6 ++-- cpukit/libnetworking/libc/res_send.c | 8 ++++- cpukit/libnetworking/libc/res_update.c | 2 ++ cpukit/libnetworking/libc/strsep.c | 2 -- 17 files changed, 88 insertions(+), 61 deletions(-) (limited to 'cpukit/libnetworking/libc') diff --git a/cpukit/libnetworking/libc/base64.c b/cpukit/libnetworking/libc/base64.c index c9518ca730..3017ccc01c 100644 --- a/cpukit/libnetworking/libc/base64.c +++ b/cpukit/libnetworking/libc/base64.c @@ -40,9 +40,11 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#if !defined(__rtems__) #if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; #endif /* not lint */ +#endif /* not rtems */ #include #include diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c index ceb7088160..3d80ffde7a 100644 --- a/cpukit/libnetworking/libc/gethostbydns.c +++ b/cpukit/libnetworking/libc/gethostbydns.c @@ -518,7 +518,7 @@ _gethostbydnsname(name, af) * disallow names consisting only of digits/dots, unless * they end in a dot. */ - if (isdigit(name[0])) + if (isdigit((int)name[0])) for (cp = name;; ++cp) { if (!*cp) { if (*--cp == '.') @@ -547,10 +547,10 @@ _gethostbydnsname(name, af) h_errno = NETDB_SUCCESS; return (&host); } - if (!isdigit(*cp) && *cp != '.') + if (!isdigit((int)*cp) && *cp != '.') break; } - if ((isxdigit(name[0]) && strchr(name, ':') != NULL) || + if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) || name[0] == ':') for (cp = name;; ++cp) { if (!*cp) { @@ -578,7 +578,7 @@ _gethostbydnsname(name, af) h_errno = NETDB_SUCCESS; return (&host); } - if (!isxdigit(*cp) && *cp != ':' && *cp != '.') + if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.') break; } diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c index 2ad832f4b1..92f7a21014 100644 --- a/cpukit/libnetworking/libc/gethostnamadr.c +++ b/cpukit/libnetworking/libc/gethostnamadr.c @@ -103,7 +103,7 @@ init_services() if (cp == NULL) continue; do { - if (isalpha(cp[0])) { + if (isalpha((int)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 a1ac899519..225ccc1269 100644 --- a/cpukit/libnetworking/libc/inet_addr.c +++ b/cpukit/libnetworking/libc/inet_addr.c @@ -103,7 +103,7 @@ inet_aton(cp, addr) * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ - if (!isdigit(c)) + if (!isdigit((int)c)) return (0); val = 0; base = 10; if (c == '0') { @@ -114,12 +114,12 @@ inet_aton(cp, addr) base = 8; } for (;;) { - if (isascii(c) && isdigit(c)) { + if (isascii((int)c) && isdigit((int)c)) { val = (val * base) + (c - '0'); c = *++cp; - } else if (base == 16 && isascii(c) && isxdigit(c)) { + } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) { val = (val << 4) | - (c + 10 - (islower(c) ? 'a' : 'A')); + (c + 10 - (islower((int)c) ? 'a' : 'A')); c = *++cp; } else break; @@ -141,7 +141,7 @@ inet_aton(cp, addr) /* * Check for trailing characters. */ - if (c != '\0' && (!isascii(c) || !isspace(c))) + if (c != '\0' && (!isascii((int)c) || !isspace((int)c))) return (0); /* * Concoct the address according to diff --git a/cpukit/libnetworking/libc/ns_name.c b/cpukit/libnetworking/libc/ns_name.c index 3e6b2b87fa..af10d2f062 100644 --- a/cpukit/libnetworking/libc/ns_name.c +++ b/cpukit/libnetworking/libc/ns_name.c @@ -15,9 +15,11 @@ * SOFTWARE. */ -#ifndef lint +#if !defined(__rtems__) +#if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; -#endif +#endif /* not lint */ +#endif /* not rtems */ #include @@ -244,7 +246,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src, { const u_char *srcp, *dstlim; u_char *dstp; - int n, c, len, checked; + int n, len, checked; len = -1; checked = 0; diff --git a/cpukit/libnetworking/libc/ns_netint.c b/cpukit/libnetworking/libc/ns_netint.c index bf0f793c2c..3c09da8f8c 100644 --- a/cpukit/libnetworking/libc/ns_netint.c +++ b/cpukit/libnetworking/libc/ns_netint.c @@ -15,9 +15,11 @@ * SOFTWARE. */ -#ifndef lint +#if !defined(__rtems__) +#if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; -#endif +#endif /* not lint */ +#endif /* not rtems */ /* Import. */ diff --git a/cpukit/libnetworking/libc/ns_parse.c b/cpukit/libnetworking/libc/ns_parse.c index 13b9956d93..cc1f070156 100644 --- a/cpukit/libnetworking/libc/ns_parse.c +++ b/cpukit/libnetworking/libc/ns_parse.c @@ -15,9 +15,11 @@ * SOFTWARE. */ -#ifndef lint +#if !defined(__rtems__) +#if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; -#endif +#endif /* not lint */ +#endif /* not rtems */ #include diff --git a/cpukit/libnetworking/libc/ns_print.c b/cpukit/libnetworking/libc/ns_print.c index 8e27c1290c..f7d7d16c64 100644 --- a/cpukit/libnetworking/libc/ns_print.c +++ b/cpukit/libnetworking/libc/ns_print.c @@ -15,9 +15,11 @@ * SOFTWARE. */ -#ifndef lint +#if !defined(__rtems__) +#if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; -#endif +#endif /* not lint */ +#endif /* not rtems */ /* Import. */ diff --git a/cpukit/libnetworking/libc/ns_ttl.c b/cpukit/libnetworking/libc/ns_ttl.c index cca162b270..75093c1dbc 100644 --- a/cpukit/libnetworking/libc/ns_ttl.c +++ b/cpukit/libnetworking/libc/ns_ttl.c @@ -15,9 +15,11 @@ * SOFTWARE. */ -#ifndef lint +#if !defined(__rtems__) +#if !defined(LINT) && !defined(CODECENTER) static char rcsid[] = "$Id$"; -#endif +#endif /* not lint */ +#endif /* not rtems */ /* Import. */ @@ -44,7 +46,7 @@ int ns_format_ttl(u_long src, char *dst, size_t dstlen) { char *odst = dst; int secs, mins, hours, days, weeks, x; - char tmp[50], *p; + char *p; secs = src % 60; src /= 60; mins = src % 60; src /= 60; diff --git a/cpukit/libnetworking/libc/res_config.h b/cpukit/libnetworking/libc/res_config.h index 644e7d796a..9e5715cf28 100644 --- a/cpukit/libnetworking/libc/res_config.h +++ b/cpukit/libnetworking/libc/res_config.h @@ -6,3 +6,11 @@ #define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */ #define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */ #define BIND_UPDATE 1 /* update support */ + +#if defined(__rtems__) +u_int16_t _getshort(const u_char *src); +u_int32_t _getlong(const u_char *src); +int gethostname (char *name, int namelen); +int sethostname (char *name, int namelen); +int issetugid (void); +#endif diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c index e58867acb3..b747b6e6d2 100644 --- a/cpukit/libnetworking/libc/res_debug.c +++ b/cpukit/libnetworking/libc/res_debug.c @@ -204,7 +204,7 @@ fp_query(const u_char *msg, FILE *file) { void fp_nquery(const u_char *msg, int len, FILE *file) { ns_msg handle; - int n, qdcount, ancount, nscount, arcount; + int qdcount, ancount, nscount, arcount; u_int opcode, rcode, id; if ((_res.options & RES_INIT) == 0 && res_init() == -1) @@ -577,14 +577,14 @@ precsize_aton(strptr) cp = *strptr; - while (isdigit(*cp)) + while (isdigit((int)*cp)) mval = mval * 10 + (*cp++ - '0'); if (*cp == '.') { /* centimeters */ cp++; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { cmval = (*cp++ - '0') * 10; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { cmval += (*cp++ - '0'); } } @@ -618,44 +618,44 @@ latlon2ul(latlonstrptr,which) cp = *latlonstrptr; - while (isdigit(*cp)) + while (isdigit((int)*cp)) deg = deg * 10 + (*cp++ - '0'); - while (isspace(*cp)) + while (isspace((int)*cp)) cp++; - if (!(isdigit(*cp))) + if (!(isdigit((int)*cp))) goto fndhemi; - while (isdigit(*cp)) + while (isdigit((int)*cp)) min = min * 10 + (*cp++ - '0'); - while (isspace(*cp)) + while (isspace((int)*cp)) cp++; - if (!(isdigit(*cp))) + if (!(isdigit((int)*cp))) goto fndhemi; - while (isdigit(*cp)) + while (isdigit((int)*cp)) secs = secs * 10 + (*cp++ - '0'); if (*cp == '.') { /* decimal seconds */ cp++; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { secsfrac = (*cp++ - '0') * 100; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { secsfrac += (*cp++ - '0') * 10; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { secsfrac += (*cp++ - '0'); } } } } - while (!isspace(*cp)) /* if any trailing garbage */ + while (!isspace((int)*cp)) /* if any trailing garbage */ cp++; - while (isspace(*cp)) + while (isspace((int)*cp)) cp++; fndhemi: @@ -693,10 +693,10 @@ latlon2ul(latlonstrptr,which) cp++; /* skip the hemisphere */ - while (!isspace(*cp)) /* if any trailing garbage */ + while (!isspace((int)*cp)) /* if any trailing garbage */ cp++; - while (isspace(*cp)) /* move to next field */ + while (isspace((int)*cp)) /* move to next field */ cp++; *latlonstrptr = cp; @@ -754,14 +754,14 @@ loc_aton(ascii, binary) if (*cp == '+') cp++; - while (isdigit(*cp)) + while (isdigit((int)*cp)) altmeters = altmeters * 10 + (*cp++ - '0'); if (*cp == '.') { /* decimal meters */ cp++; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { altfrac = (*cp++ - '0') * 10; - if (isdigit(*cp)) { + if (isdigit((int)*cp)) { altfrac += (*cp++ - '0'); } } @@ -769,10 +769,10 @@ loc_aton(ascii, binary) alt = (10000000 + (altsign * (altmeters * 100 + altfrac))); - while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace(*cp) && (cp < maxcp)) + while (isspace((int)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) @@ -780,10 +780,10 @@ loc_aton(ascii, binary) siz = precsize_aton(&cp); - while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace(*cp) && (cp < maxcp)) + while (isspace((int)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) @@ -791,10 +791,10 @@ loc_aton(ascii, binary) hp = precsize_aton(&cp); - while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */ + while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; - while (isspace(*cp) && (cp < maxcp)) + while (isspace((int)*cp) && (cp < maxcp)) cp++; if (cp >= maxcp) diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c index 8b60889c6f..9371e9fa82 100644 --- a/cpukit/libnetworking/libc/res_init.c +++ b/cpukit/libnetworking/libc/res_init.c @@ -337,7 +337,7 @@ res_init() break; net = cp; while (*cp && !ISSORTMASK(*cp) && *cp != ';' && - isascii(*cp) && !isspace(*cp)) + isascii((int)*cp) && !isspace((int)*cp)) cp++; n = *cp; *cp = 0; @@ -347,7 +347,7 @@ res_init() *cp++ = n; net = cp; while (*cp && *cp != ';' && - isascii(*cp) && !isspace(*cp)) + isascii((int)*cp) && !isspace((int)*cp)) cp++; n = *cp; *cp = 0; diff --git a/cpukit/libnetworking/libc/res_mkupdate.c b/cpukit/libnetworking/libc/res_mkupdate.c index b74f16ba78..56362f650b 100644 --- a/cpukit/libnetworking/libc/res_mkupdate.c +++ b/cpukit/libnetworking/libc/res_mkupdate.c @@ -20,9 +20,11 @@ * */ +#if !defined(__rtems__) #if !defined(lint) && !defined(SABER) static char rcsid[] = "$Id$"; #endif /* not lint */ +#endif /* not rtems */ #include #include @@ -64,9 +66,9 @@ int res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) { ns_updrec *rrecp_start = rrecp_in; HEADER *hp; - u_char c, *cp, *cp1, *sp1, *sp2, *startp, *endp; - int n, i, j, found, soanum, multiline; - ns_updrec *rrecp, *tmprrecp, *recptr = NULL; + u_char *cp, *sp1, *sp2, *startp, *endp; + int n, i, soanum, multiline; + ns_updrec *rrecp; struct in_addr ina; char buf2[MAXDNAME]; int section, numrrs = 0, counts[ns_s_max]; @@ -350,7 +352,6 @@ static int getnum_str(u_char **startpp, u_char *endp) { int c, n; int seendigit = 0; - int seendecimal = 0; int m = 0; for (n = 0; *startpp <= endp; ) { diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c index 42b7f1ecc2..784fa433bc 100644 --- a/cpukit/libnetworking/libc/res_query.c +++ b/cpukit/libnetworking/libc/res_query.c @@ -387,17 +387,17 @@ hostalias(name) setbuf(fp, NULL); buf[sizeof(buf) - 1] = '\0'; while (fgets(buf, sizeof(buf), fp)) { - for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1) + for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1) ; if (!*cp1) break; *cp1 = '\0'; if (!strcasecmp(buf, name)) { - while (isspace(*++cp1)) + while (isspace((int)*++cp1)) ; if (!*cp1) break; - for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2) + for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2) ; abuf[sizeof(abuf) - 1] = *cp2 = '\0'; strncpy(abuf, cp1, sizeof(abuf) - 1); diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c index cfb1e2eb9d..1b03bb5b1b 100644 --- a/cpukit/libnetworking/libc/res_send.c +++ b/cpukit/libnetworking/libc/res_send.c @@ -99,12 +99,14 @@ static char rcsid[] = "$Id$"; #include "res_config.h" +#if !defined(__rtems__) #ifdef NOPOLL /* libc_r doesn't wrap poll yet() */ static int use_poll = 0; #else static int use_poll = 1; /* adapt to poll() syscall availability */ /* 0 = not present, 1 = try it, 2 = exists */ #endif +#endif static int s = -1; /* socket used for communications */ static int connected = 0; /* is the socket connected */ @@ -375,7 +377,9 @@ res_send(buf, buflen, ans, anssiz) if (v_circuit) { int truncated; +#if !defined(__rtems__) struct iovec iov[2]; +#endif u_short len; u_char *cp; @@ -411,7 +415,7 @@ res_send(buf, buflen, ans, anssiz) * Send length & message */ putshort((u_short)buflen, (u_char*)&len); -#if 0 +#if !defined(__rtems__) iov[0].iov_base = (caddr_t)&len; iov[0].iov_len = INT16SZ; iov[1].iov_base = (caddr_t)buf; @@ -536,8 +540,10 @@ read_len: int msec; #endif struct timeval timeout; +#ifndef NOSELECT fd_set dsmask, *dsmaskp; int dsmasklen; +#endif struct sockaddr_in from; int fromlen; diff --git a/cpukit/libnetworking/libc/res_update.c b/cpukit/libnetworking/libc/res_update.c index 1c5f20abd7..ef591e0674 100644 --- a/cpukit/libnetworking/libc/res_update.c +++ b/cpukit/libnetworking/libc/res_update.c @@ -1,6 +1,8 @@ +#if !defined(__rtems__) #if !defined(lint) && !defined(SABER) static char rcsid[] = "$Id$"; #endif /* not lint */ +#endif /* not rtems */ /* * Copyright (c) 1996 by Internet Software Consortium. diff --git a/cpukit/libnetworking/libc/strsep.c b/cpukit/libnetworking/libc/strsep.c index 33115f0e41..1d6e9ff79f 100644 --- a/cpukit/libnetworking/libc/strsep.c +++ b/cpukit/libnetworking/libc/strsep.c @@ -31,8 +31,6 @@ * SUCH DAMAGE. */ -#include "config.h" - #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -- cgit v1.2.3