Reduce warnings in vos.c
authorAndrew Deason <adeason@sinenomine.net>
Wed, 7 Oct 2009 20:57:04 +0000 (15:57 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 8 Oct 2009 15:01:05 +0000 (08:01 -0700)
Squash a few miscellaneous that appear when building vos.c:

 -- CreateVolume should use util_GetUInt32 to parse vol ids, since they
    are now unsigned

 -- The m_uuid argument of print_addrs is altered, so do not declare it
    const

 -- Declare the confDir argument of ugen/vsu_ClientInit to be const,
    since it does not change, and vos.c passes a const confDir in
    MyBeforeProc

 -- Ignore implicit function declaration warnings and remove
    CFLAGS_NOERROR from the vos.c build, since the only remaining
    warning is an implicit function declaration

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

README.WARNINGS
src/ubik/ubik.p.h
src/ubik/uinit.c
src/volser/Makefile.in
src/volser/volser.p.h
src/volser/vos.c
src/volser/vsutils.c
src/volser/vsutils_prototypes.h

index ee7754b..60b2114 100644 (file)
@@ -97,7 +97,7 @@ uss/lex.yy.c         : all           : Unused symbols
 viced/fsprobe.c      : all          : ubik_Call
 vlserver/vlserver.c  : all          : GetExtendedCellInfo
 vol/salvager.c       : all           : consts & undefined variable from header
-volser/vos.c         : all           : ubik_Call_New, signedness and const
+volser/vos.c         : implicit-func : ubik_Call_New
 volser/vol-dump.c    : format        : afs_sfsize_t
 volser/vsprocs.c     : format-extra  : The ONERROR macro needs to be rethought
 
index 90e256f..5173c52 100644 (file)
@@ -512,8 +512,8 @@ extern int ubik_ParseServerList(int argc, char **argv, afs_int32 *ahost,
 /* \name uinit.c */
 
 struct rx_securityClass;
-extern afs_int32 ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName,
-                                afs_int32 sauth, 
+extern afs_int32 ugen_ClientInit(int noAuthFlag, const char *confDir,
+                                char *cellName, afs_int32 sauth,
                                 struct ubik_client **uclientp,
                                 int (*secproc) (struct rx_securityClass *sc,
                                                 afs_int32 scIndex), 
index 622d624..22f0131 100644 (file)
@@ -45,7 +45,7 @@
  * \brief Get the appropriate type of ubik client structure out from the system.
  */
 afs_int32
-ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth,
+ugen_ClientInit(int noAuthFlag, const char *confDir, char *cellName, afs_int32 sauth,
               struct ubik_client **uclientp, 
               int (*secproc) (struct rx_securityClass *, afs_int32),
               char *funcName, afs_int32 gen_rxkad_level, 
index a915dc6..cde0703 100644 (file)
@@ -139,7 +139,7 @@ vol_split.o: vol_split.c ${VINCLS} ${INTINCLS} ${RINCLS}
 # Errors
 #
 vos.o: vos.c
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
+       $(CC) $(CFLAGS) -c $<
 
 #
 # Installation targets
index c9013ef..19121e6 100644 (file)
@@ -175,7 +175,7 @@ struct partList {           /*used by the backup system */
 struct ubik_client;
 extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp);
 extern int vsu_ExtractName(char rname[], char name[]);
-extern afs_int32 vsu_ClientInit(int noAuthFlag, char *confDir,
+extern afs_int32 vsu_ClientInit(int noAuthFlag, const char *confDir,
                                char *cellName, afs_int32 sauth,
                                struct ubik_client **uclientp,
                                int (*secproc)(struct rx_securityClass *, afs_int32));
index f002c54..8d56340 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 <string.h>
@@ -1942,7 +1945,7 @@ CreateVolume(register struct cmd_syndesc *as, void *arock)
            return EINVAL;
        }
 
-       code = util_GetInt32(as->parms[4].items->data, &volid);
+       code = util_GetUInt32(as->parms[4].items->data, &volid);
        if (code) {
            fprintf(STDERR, "vos: bad integer specified for volume ID.\n");
            return code;
@@ -1956,7 +1959,7 @@ CreateVolume(register struct cmd_syndesc *as, void *arock)
            return EINVAL;
        }
 
-       code = util_GetInt32(as->parms[5].items->data, &rovolid);
+       code = util_GetUInt32(as->parms[5].items->data, &rovolid);
        if (code) {
            fprintf(STDERR, "vos: bad integer specified for volume ID.\n");
            return code;
@@ -5193,7 +5196,7 @@ ChangeAddr(register struct cmd_syndesc *as, void *arock)
 }
 
 static void
-print_addrs(const bulkaddrs * addrs, const afsUUID * m_uuid, int nentries,
+print_addrs(const bulkaddrs * addrs, afsUUID * m_uuid, int nentries,
            int print)
 {
     afs_int32 vcode;
index e9bc557..2060c06 100644 (file)
@@ -385,7 +385,7 @@ vsu_SetCrypt(int cryptflag)
   Get the appropriate type of ubik client structure out from the system.
 */
 afs_int32
-vsu_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth,
+vsu_ClientInit(int noAuthFlag, const char *confDir, char *cellName, afs_int32 sauth,
                struct ubik_client **uclientp,
               int (*secproc)(struct rx_securityClass *, afs_int32))
 {
index 54d085b..2460077 100644 (file)
@@ -11,7 +11,7 @@ extern int VLDB_ListAttributesN2(VldbListByAttributes *attrp, char *name, afs_in
            afs_int32 *nentriesp, nbulkentries *blkentriesp, afs_int32 *nextindexp);
 extern int VLDB_IsSameAddrs(afs_int32 serv1, afs_int32 serv2, afs_int32 *errorp);
 extern void vsu_SetCrypt(int cryptflag);
-extern afs_int32 vsu_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth,
+extern afs_int32 vsu_ClientInit(int noAuthFlag, const char *confDir, char *cellName, afs_int32 sauth,
                struct ubik_client **uclientp, int (*secproc)(struct rx_securityClass *, afs_int32));
 extern int vsu_ExtractName(char rname[], char name[]);
 extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp);