util-warnings-cleanup-20010705
authorNathan Neulinger <nneul@umr.edu>
Thu, 5 Jul 2001 16:13:08 +0000 (16:13 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 5 Jul 2001 16:13:08 +0000 (16:13 +0000)
get rid of more warnings

src/util/dirpath.c
src/util/hostparse.c
src/util/sys.c

index 1f8b14d..496cd67 100644 (file)
@@ -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 */
index b9b8e2f..2ba60eb 100644 (file)
 #else /* UKERNEL */
 #include <stdio.h>
 #include <sys/types.h>
+#include <stdlib.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
-#include <stdlib.h>
 #include <direct.h>
 #else
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netdb.h>
+#include <ctype.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
 #include <errno.h>
 #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;
index 15c2cd9..8c35611 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <stdio.h>
 
 #include "AFS_component_version_number.c"