From 8314001bdb305204467adfb27b3dfa2e6890a3b1 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 7 Oct 2009 15:57:04 -0500 Subject: [PATCH] Reduce warnings in vos.c 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 Tested-by: Derrick Brashear --- README.WARNINGS | 2 +- src/ubik/ubik.p.h | 4 ++-- src/ubik/uinit.c | 2 +- src/volser/Makefile.in | 2 +- src/volser/volser.p.h | 2 +- src/volser/vos.c | 9 ++++++--- src/volser/vsutils.c | 2 +- src/volser/vsutils_prototypes.h | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.WARNINGS b/README.WARNINGS index ee7754b..60b2114 100644 --- a/README.WARNINGS +++ b/README.WARNINGS @@ -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 diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 90e256f..5173c52 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -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), diff --git a/src/ubik/uinit.c b/src/ubik/uinit.c index 622d624..22f0131 100644 --- a/src/ubik/uinit.c +++ b/src/ubik/uinit.c @@ -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, diff --git a/src/volser/Makefile.in b/src/volser/Makefile.in index a915dc6..cde0703 100644 --- a/src/volser/Makefile.in +++ b/src/volser/Makefile.in @@ -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 diff --git a/src/volser/volser.p.h b/src/volser/volser.p.h index c9013ef..19121e6 100644 --- a/src/volser/volser.p.h +++ b/src/volser/volser.p.h @@ -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)); diff --git a/src/volser/vos.c b/src/volser/vos.c index f002c54..8d56340 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -10,6 +10,9 @@ #include #include +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wimplicit-function-declaration" +#endif #include #include @@ -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; diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index e9bc557..2060c06 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -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)) { diff --git a/src/volser/vsutils_prototypes.h b/src/volser/vsutils_prototypes.h index 54d085b..2460077 100644 --- a/src/volser/vsutils_prototypes.h +++ b/src/volser/vsutils_prototypes.h @@ -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); -- 1.9.4