From d82e9c851c4d8ad765a0a81b9d5f290d184b7b07 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Sun, 26 Jul 2009 22:28:29 -0400 Subject: [PATCH 1/1] Unused variable cleanup Eliminate some warnings for unused variables. In most cases the variables are not used at all and are removed; in a few cases the declarations need to be ifdef'ed to follow the code that uses them. For a typical build here this removes 24 warnings. Reviewed-on: http://gerrit.openafs.org/232 Reviewed-by: Jeffrey Altman Tested-by: Simon Wilkinson Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- src/afs/afs_fetchstore.c | 1 - src/aklog/aklog_main.c | 4 +++- src/bucoord/commands.c | 3 ++- src/kauth/read_passwd.c | 1 - src/libadmin/pts/afs_ptsAdmin.c | 1 - src/rx/rx.c | 1 - src/rx/rx_pthread.c | 1 - src/uss/uss_ptserver.c | 2 ++ src/uss/uss_vol.c | 2 ++ src/viced/afsfileprocs.c | 1 - src/viced/host.c | 1 - src/viced/viced.c | 2 +- src/volser/volmain.c | 2 +- 13 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index b8b7032..0f189af 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -71,7 +71,6 @@ afs_int32 rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset, afs_uint32 tlen, afs_uint32 *got) { - afs_int32 code; struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r; *got = afs_osi_Read(tfile, -1, v->tbuffer, tlen); diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index 6cbeedb..7fe2cb2 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -624,9 +624,11 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) */ if (! do524) { - char *p; char k4name[ANAME_SZ], k4inst[INST_SZ], k4realm[REALM_SZ]; +#ifdef HAVE_NO_KRB5_524 + char *p; int len; +#endif if (dflag) printf("Using Kerberos V5 ticket natively\n"); diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index d7f2d99..32d83fa 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -426,7 +426,6 @@ EvalVolumeSet1(struct bc_config *aconfig, struct ubik_client *uclient) { /*EvalVolumeSet1 */ afs_int32 code; /*Result of various calls */ - char *errm; struct bc_volumeDump *tvd; /*Ptr to new dump instance */ struct bc_volumeEntry *tve, *ctve; /*Ptr to new volume entry instance */ char patt[256]; /*Composite regex; also, target string */ @@ -444,6 +443,8 @@ EvalVolumeSet1(struct bc_config *aconfig, #ifdef HAVE_POSIX_REGEX regex_t re; int need_regfree = 0; +#else + char *errm; #endif *avols = (struct bc_volumeDump *)0; diff --git a/src/kauth/read_passwd.c b/src/kauth/read_passwd.c index 7f52eee..746f693 100644 --- a/src/kauth/read_passwd.c +++ b/src/kauth/read_passwd.c @@ -109,7 +109,6 @@ int read_pw_string(char *s, int max, char *prompt, int verify) { int ok = 0; - int len; /* password length */ #ifdef BSDUNIX jmp_buf old_env; diff --git a/src/libadmin/pts/afs_ptsAdmin.c b/src/libadmin/pts/afs_ptsAdmin.c index e671f95..ef57b81 100644 --- a/src/libadmin/pts/afs_ptsAdmin.c +++ b/src/libadmin/pts/afs_ptsAdmin.c @@ -1795,7 +1795,6 @@ pts_UserCreate(const void *cellHandle, const char *userName, int *newUserId, int rc = 0; afs_status_t tst = 0; afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle; - afs_int32 userId = 0; /* * Validate arguments diff --git a/src/rx/rx.c b/src/rx/rx.c index df2349b..68474cd 100755 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -6697,7 +6697,6 @@ rx_GetServerDebug(osi_socket socket, afs_uint32 remoteAddr, #else afs_int32 rc = 0; struct rx_debugIn in; - afs_int32 *lp = (afs_int32 *) stat; *supportedValues = 0; in.type = htonl(RX_DEBUGI_GETSTATS); diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 5fdfd8d..88e1c03 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -141,7 +141,6 @@ rxi_StartServerProc(void *(*proc) (void *), int stacksize) static void * event_handler(void *argp) { - struct clock rx_pthread_last_event_wait_time = { 0, 0 }; unsigned long rx_pthread_n_event_expired = 0; unsigned long rx_pthread_n_event_waits = 0; long rx_pthread_n_event_woken = 0; diff --git a/src/uss/uss_ptserver.c b/src/uss/uss_ptserver.c index 9fac8fa..10bd652 100644 --- a/src/uss/uss_ptserver.c +++ b/src/uss/uss_ptserver.c @@ -68,7 +68,9 @@ static afs_int32 InitThisModule(void) { /*InitThisModule */ +#ifdef USS_PTSERVER_DB static char rn[] = "uss_ptserver:InitThisModule"; /*Routine name */ +#endif register afs_int32 code; /*Return code */ /* diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c index f93b905..74be94d 100644 --- a/src/uss/uss_vol.c +++ b/src/uss/uss_vol.c @@ -903,7 +903,9 @@ uss_vol_DeleteVol(char *a_volName, afs_int32 a_volID, char *a_servName, afs_int32 a_servID, char *a_partName, afs_int32 a_partID) { /*uss_vol_DeleteVol */ +#ifdef USS_VOL_DB static char rn[] = "uss_vol_DeleteVol"; /*Routine name */ +#endif register afs_int32 code = 0; /*Return code */ /* diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 7ce75c4..04a68b3 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -6299,7 +6299,6 @@ SRXAFS_FlushCPS(struct rx_call * acall, struct ViceIds * vids, afs_int32 *vd, *addr; Error errorCode = 0; /* return code to caller */ struct client *client = 0; - struct rx_connection *tcon = rx_ConnectionOf(acall); ViceLog(1, ("SRXAFS_FlushCPS\n")); FS_LOCK; diff --git a/src/viced/host.c b/src/viced/host.c index f4ec5e1..877c3f6 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -1210,7 +1210,6 @@ h_AddHostToAddrHashTable_r(afs_uint32 addr, afs_uint16 port, struct host *host) { int index; struct h_AddrHashChain *chain; - int found = 0; char hoststr[16], hoststr2[16]; /* hash into proper bucket */ diff --git a/src/viced/viced.c b/src/viced/viced.c index 720d9d1..339f326 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -385,9 +385,9 @@ int viced_syscall(afs_uint32 a3, afs_uint32 a4, void *a5) { afs_uint32 rcode; +#ifndef AFS_LINUX20_ENV void (*old) (int); -#ifndef AFS_LINUX20_ENV old = (void (*)(int))signal(SIGSYS, SIG_IGN); #endif rcode = syscall(AFS_SYSCALL, 28 /* AFSCALL_CALL */ , a3, a4, a5); diff --git a/src/volser/volmain.c b/src/volser/volmain.c index ee75860..b17e783 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -206,9 +206,9 @@ int volser_syscall(afs_uint32 a3, afs_uint32 a4, void *a5) { afs_uint32 rcode; +#ifndef AFS_LINUX20_ENV void (*old) (int); -#ifndef AFS_LINUX20_ENV old = signal(SIGSYS, SIG_IGN); #endif rcode = -- 1.9.4