Unused variable cleanup
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 27 Jul 2009 02:28:29 +0000 (22:28 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 27 Jul 2009 14:56:07 +0000 (07:56 -0700)
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 <jaltman@openafs.org>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 files changed:
src/afs/afs_fetchstore.c
src/aklog/aklog_main.c
src/bucoord/commands.c
src/kauth/read_passwd.c
src/libadmin/pts/afs_ptsAdmin.c
src/rx/rx.c
src/rx/rx_pthread.c
src/uss/uss_ptserver.c
src/uss/uss_vol.c
src/viced/afsfileprocs.c
src/viced/host.c
src/viced/viced.c
src/volser/volmain.c

index b8b7032..0f189af 100644 (file)
@@ -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);
index 6cbeedb..7fe2cb2 100644 (file)
@@ -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");
index d7f2d99..32d83fa 100644 (file)
@@ -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;
index 7f52eee..746f693 100644 (file)
@@ -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;
index e671f95..ef57b81 100644 (file)
@@ -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
index df2349b..68474cd 100755 (executable)
@@ -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);
index 5fdfd8d..88e1c03 100644 (file)
@@ -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;
index 9fac8fa..10bd652 100644 (file)
@@ -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 */
 
     /*
index f93b905..74be94d 100644 (file)
@@ -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 */
 
     /*
index 7ce75c4..04a68b3 100644 (file)
@@ -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;
index f4ec5e1..877c3f6 100644 (file)
@@ -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 */
index 720d9d1..339f326 100644 (file)
@@ -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);
index ee75860..b17e783 100644 (file)
@@ -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 =