Fix warnings in butc, tbutc, and butm
authorAndrew Deason <adeason@sinenomine.net>
Fri, 9 Oct 2009 15:17:43 +0000 (10:17 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Wed, 14 Oct 2009 01:34:05 +0000 (18:34 -0700)
tbutc:
 - Ignore warnings for dump.c

butc/dump.c:
 - butm_WriteFileData takes a char*, no need to cast buffer

 - volumeHeader_hton takes a struct volumeHeader*, though, need to cast
   buffer there

 - Ignore strict prototypes

butc/recoverDb.c:
 - scanVolData takes a uint*, not an int*

 - Initialize nbytes to 0

 - Remove warning inhibition

butc/tcmain.c:
 - atocl takes an int*, not a uint*

 - Ignore implicit function declaration warnings

butc/tcudbprocs.c:
 - Ignore implicit function declaration warnings (ubik stuff)

butm/file_tm.c:
 - Include sys/wait.h for the waitpid() prototype

Reviewed-on: http://gerrit.openafs.org/635
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/butc/Makefile.in
src/butc/dump.c
src/butc/recoverDb.c
src/butc/tcmain.c
src/butc/tcudbprocs.c
src/butm/file_tm.c
src/tbutc/Makefile.in

index 4ede693..025caf5 100644 (file)
@@ -76,7 +76,6 @@ lwps.o: lwps.c ${INCLS}
        $(CC) $(CFLAGS) -c $<
 list.o: list.c ${INCLS}
 recoverDb.o: recoverDb.c ${INCLS}
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
 tcudbprocs.o: tcudbprocs.c ${INCLS}
        $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
 dump.o: dump.c ${INCLS}
index 5a1228c..1b104e3 100644 (file)
@@ -10,6 +10,9 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wstrict-prototypes"
+#endif
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -301,7 +304,7 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
        hostVolumeHeader.contd = ((fragmentNumber == 1) ? 0 : TC_VOLCONTD);
        volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)buffer);
 
-       rc = butm_WriteFileData(tapeInfoPtr, (struct volumeHeader *)buffer, 1,
+       rc = butm_WriteFileData(tapeInfoPtr, buffer, 1,
                                sizeof(hostVolumeHeader));
        if (rc) {
            ErrorLog(1, taskId, rc, tapeInfoPtr->error,
@@ -393,7 +396,7 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
                hostVolumeHeader.contd = (endofvolume ? 0 : TC_VOLCONTD);
                hostVolumeHeader.magic = TC_VOLENDMAGIC;
                hostVolumeHeader.endTime = (endofvolume ? time(0) : 0);
-               volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]);
+               volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)&buffer[bytesread]);
                bytesread += sizeof(hostVolumeHeader);
            }
 
index 67df0b2..83e6e30 100644 (file)
@@ -338,7 +338,8 @@ readDump(afs_uint32 taskId, struct butm_tapeInfo *tapeInfoPtr,
         struct tapeScanInfo *scanInfoPtr)
 {
     int moreTapes = 1;
-    afs_int32 nbytes, flags, seq;
+    afs_int32 flags, seq;
+    afs_uint32 nbytes = 0;
     int newDump = 1, newTape = 1;
     afs_int32 tapePosition;
     afs_int32 code = 0, tcode;
index 1b48536..87672bf 100644 (file)
@@ -10,6 +10,9 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -325,8 +328,8 @@ GetDeviceConfig(char *filename, struct tapeConfig *config, afs_int32 portOffset)
     char devName[LINESIZE], tcapacity[LINESIZE], tfmsize[LINESIZE],
        trest[LINESIZE];
     afs_int32 aport;
-    afs_uint32 capacity;
-    afs_uint32 fmSize;
+    afs_int32 capacity;
+    afs_int32 fmSize;
     afs_int32 code = 0, count;
 
     /* Initialize the config struct */
index 3b285ae..b358194 100644 (file)
@@ -10,6 +10,9 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
+#endif
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
index 7a84d17..c85a11b 100644 (file)
@@ -17,6 +17,7 @@
 #include <netinet/in.h>
 #endif
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <limits.h>
index 43f36c9..f979772 100644 (file)
@@ -102,7 +102,7 @@ tcudbprocs.o: ${BUTC}/tcudbprocs.c ${BUTCINCLS}
        ${CC} ${CFLAGS} -c ${BUTC}/tcudbprocs.c
 
 dump.o: ${BUTC}/dump.c ${BUTCINCLS}
-       ${CC} ${CFLAGS} -c ${BUTC}/dump.c
+       ${CC} ${CFLAGS} @CFLAGS_NOERROR@ -c ${BUTC}/dump.c
 
 tcstatus.o: ${BUTC}/tcstatus.c ${BUTCINCLS}
        ${CC} ${CFLAGS} -c ${BUTC}/tcstatus.c