From 671a9314ecdbd7683d00f6edaa70713553c9a4b6 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Thu, 5 Jul 2001 16:13:08 +0000 Subject: [PATCH] util-warnings-cleanup-20010705 get rid of more warnings --- src/util/dirpath.c | 6 ++++-- src/util/hostparse.c | 18 +++++++++++++----- src/util/sys.c | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/util/dirpath.c b/src/util/dirpath.c index 1f8b14da1..496cd67de 100644 --- a/src/util/dirpath.c +++ b/src/util/dirpath.c @@ -100,10 +100,12 @@ unsigned int initAFSDirPath(void) */ static void initDirPathArray(void) { - char *buf, *pathp; - int status; + char *pathp; #ifdef AFS_NT40_ENV + char *buf; + int status; + /* get the afs server software installation dir from the registry */ if (afssw_GetServerInstallDir(&buf)) { /* failed; server not installed; use temp directory */ diff --git a/src/util/hostparse.c b/src/util/hostparse.c index b9b8e2fc4..2ba60eb4c 100644 --- a/src/util/hostparse.c +++ b/src/util/hostparse.c @@ -18,15 +18,23 @@ #else /* UKERNEL */ #include #include +#include #ifdef AFS_NT40_ENV #include -#include #include #else #include #include #include #include +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif #endif #include #include "afsutil.h" @@ -47,7 +55,7 @@ register char *ahost; { tc = *ahost; /* look at the first char */ if (tc >= '0' && tc <= '9') { numeric = 1; - while (tc = *ptr++) { + while ((tc = *ptr++)) { if (tc == '.') { if (dots >= 3) { numeric = 0; @@ -66,7 +74,7 @@ register char *ahost; { tval = 0; dots = 0; bzero(addr, sizeof(addr)); - while (tc = *ahost++) { + while ((tc = *ahost++)) { if (tc == '.') { if (dots >= 3) return (struct hostent *) 0; /* too many dots */ addr[dots++] = tval; @@ -118,8 +126,8 @@ char *hostutil_GetNameByINet(addr) } else { addr = ntohl(addr); sprintf(tbuffer, "%d.%d.%d.%d", - ((addr>>24) & 0xff), ((addr>>16) & 0xff), - ((addr>>8) & 0xff), ( addr & 0xff)); + (int)((addr>>24) & 0xff), (int)((addr>>16) & 0xff), + (int)((addr>>8) & 0xff), (int)( addr & 0xff)); } return tbuffer; diff --git a/src/util/sys.c b/src/util/sys.c index 15c2cd9c8..8c356113e 100644 --- a/src/util/sys.c +++ b/src/util/sys.c @@ -8,6 +8,7 @@ */ #include +#include #include "AFS_component_version_number.c" -- 2.39.5