]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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 b8b7032b08fdf70b0aa2503bd75bfa9db0a91b1e..0f189aff1757a94780590a14ce62e040aa6d9b26 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 6cbeedba1140ed7d0960b7748ba05ba9cac5bd04..7fe2cb21d20a6e551997ebd217c951704277d4da 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 d7f2d99d2e8cc8e198b020e89d58fbb644f2394c..32d83fa086d52240fc0f04b640bb666ad00def0d 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 7f52eee95b89541999ff283d4549a288d04148bd..746f693808c632cf52b33c15a2c008e7c644da52 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 e671f95d32a3efee808b983e7f6d7bb0c7d8e155..ef57b812e27bbda1a8f55de66d132597622c00a8 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 df2349b7d8608f830e9cd989f7f2e7d6e8cfedad..68474cdb6a10ce01a812cda1d08a1babeab99769 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 5fdfd8d28e7022bc0786b352dccd16ac792b80fd..88e1c0344e92e0d9905042b0770d0a1cd9269887 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 9fac8fa57d34b8fdaebbec1692a0a4c52983894b..10bd6522b5875b9cfbb141a5b1c11ef0b31da101 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 f93b9053bd2153c27231ce9528da425fc773879f..74be94d927aafddd2bcac3dd46e25e04504abc43 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 7ce75c4df1211d83265ff72867c8472070658e66..04a68b39015e846c3a793856a5b2468440ae4821 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 f4ec5e18528935301c153d53153dbc100299719f..877c3f6ddbe2dc89d5d32e35a0c12fee3d437437 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 720d9d164be376b1fbdfba7d0ca7c13a424e123a..339f3267306ae860cd80004eb9f99b8e9008a81a 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 ee758607a1683d56001dc67cbfba881a05abb1f4..b17e783fe2b6d93b7ad792dfea12fff461e66483 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 =