From fe8897015c11d8d6b9b3e7e3a3646688ccb45683 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 19 Apr 2011 22:42:12 -0400 Subject: [PATCH] Unused variable warning fixes Fix several simple cases of unused variables. Change-Id: I6e61ea625c6bcef7b0bc70c61909f22d1f8dd9a7 Reviewed-on: http://gerrit.openafs.org/4504 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/libadmin/vos/vsprocs.c | 7 +------ src/update/server.c | 2 -- src/uss/uss_acl.c | 4 ++-- src/util/tabular_output.c | 5 +---- src/venus/fs.c | 6 +----- src/vol/fssync-server.c | 6 ++++-- 6 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/libadmin/vos/vsprocs.c b/src/libadmin/vos/vsprocs.c index 6c01a62..5a857f0 100644 --- a/src/libadmin/vos/vsprocs.c +++ b/src/libadmin/vos/vsprocs.c @@ -393,7 +393,7 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, struct destServer destination; struct nvldbentry entry; - int islocked, pntg; + int islocked; afs_int32 error; int same; afs_int32 store_flags; @@ -411,7 +411,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, clonetid = 0; error = 0; volid = 0; - pntg = 0; backupId = 0; newVol = 0; @@ -459,7 +458,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, */ fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT); fromtid = 0; - pntg = 1; tst = AFSVolTransCreate(fromconn, afromvol, afrompart, ITOffline, @@ -533,7 +531,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, } } - pntg = 1; toconn = UV_Bind(cellHandle, atoserver, AFSCONF_VOLUMEPORT); /* get connections to the servers */ fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT); fromtid = totid = 0; /* initialize to uncreated */ @@ -3514,7 +3511,6 @@ CheckVldb(afs_cell_handle_p cellHandle, struct nvldbentry *entry, int islocked = 0; int pass = 0; afs_int32 modentry = 0; - afs_int32 delentry = 0; if (modified) { *modified = 0; @@ -3578,7 +3574,6 @@ CheckVldb(afs_cell_handle_p cellHandle, struct nvldbentry *entry, if (tst) { goto fail_CheckVldb; } - delentry = 1; } else { /* Replace old entry with our new one */ if (!VLDB_ReplaceEntry diff --git a/src/update/server.c b/src/update/server.c index 3309832..e4846a5 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -234,10 +234,8 @@ main(int argc, char *argv[]) usage: Quit("Usage: upserver [+] [-crypt +] [-clear +] [-auth +] [-rxbind] [-help]\n"); } else { - int dirlen; if (nDirs >= sizeof(dirName) / sizeof(dirName[0])) Quit("Too many dirs"); - dirlen = strlen(argv[a]); if (AddObject(&dirName[nDirs], argv[a])) { printf("%s: Unable to export dir %s. Skipping\n", whoami, argv[a]); diff --git a/src/uss/uss_acl.c b/src/uss/uss_acl.c index f14561f..0ce092c 100644 --- a/src/uss/uss_acl.c +++ b/src/uss/uss_acl.c @@ -667,7 +667,7 @@ uss_acl_SetDiskQuota(char *a_path, int a_q) static char rn[] = "uss_acl_SetDiskQuota"; #endif uss_VolumeStatus_t *status; - char *name, *motd, *offmsg; + char *motd, *offmsg; char *input; char tmp_str[AFS_PIOCTL_MAXSIZE]; @@ -678,7 +678,7 @@ uss_acl_SetDiskQuota(char *a_path, int a_q) status = (uss_VolumeStatus_t *) tmp_str; status->MinQuota = status->MaxQuota = -1; - name = motd = offmsg = NULL; + motd = offmsg = NULL; status->MaxQuota = a_q; input = (char *)status + sizeof(*status); diff --git a/src/util/tabular_output.c b/src/util/tabular_output.c index 7e55e8b..bc8f3e4 100644 --- a/src/util/tabular_output.c +++ b/src/util/tabular_output.c @@ -469,7 +469,7 @@ compareBodyRow(struct util_Table *Table, int RowIndx, struct util_TableRow *aRow /* find correct index for new row by bi-secting the table */ int findRowIndex(struct util_Table* Table, struct util_TableRow *aRow){ - int cmp,best,lower,middle,upper; + int cmp,lower,middle,upper; /* empty Table */ if (Table->numRows == 0) { @@ -486,17 +486,14 @@ findRowIndex(struct util_Table* Table, struct util_TableRow *aRow){ lower = 0; upper= Table->numRows-1; - best=0; do { middle=(upper-lower)/2+lower; cmp=compareBodyRow(Table,middle,aRow); if (cmp > 0) { upper=middle; - best = lower; } if (cmp < 0) { lower=middle; - best = upper; } if (cmp == 0) { return middle; diff --git a/src/venus/fs.c b/src/venus/fs.c index 2056af5..06b3b6d 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2377,10 +2377,8 @@ CallBackRxConnCmd(struct cmd_syndesc *as, void *arock) struct cmd_item *ti; afs_int32 hostAddr; struct hostent *thp; - int setp; ti = as->parms[0].items; - setp = 1; if (ti) { thp = hostutil_GetHostByName(ti->data); if (!thp) { @@ -2390,7 +2388,6 @@ CallBackRxConnCmd(struct cmd_syndesc *as, void *arock) else memcpy(&hostAddr, thp->h_addr, sizeof(afs_int32)); } else { hostAddr = 0; /* means don't set host */ - setp = 0; /* aren't setting host */ } /* now do operation */ @@ -2761,7 +2758,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) afs_int32 code; struct ViceIoctl blob; struct cmd_item *ti; - int export = 0, type = 0, mode = 0, exp = 0, exportcall, pwsync = + int export = 0, type = 0, mode = 0, exportcall, pwsync = 0, smounts = 0, clipags = 0, pagcb = 0; ti = as->parms[0].items; @@ -2783,7 +2780,6 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) fprintf(stderr, "Illegal argument %s\n", ti->data); return 1; } - exp = 1; } if ((ti = as->parms[2].items)) { /* -noconvert */ if (strcmp(ti->data, "on") == 0) diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index 0b50bde..b1f29e7 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -310,14 +310,16 @@ FSYNC_sync(void * args) CallHandler(FSYNC_readfds, nfds, POLLIN|POLLPRI); #else int maxfd; +#ifdef AFS_PTHREAD_ENV struct timeval s_timeout; +#endif GetHandler(&FSYNC_readfds, &maxfd); - s_timeout.tv_sec = SYNC_SELECT_TIMEOUT; - s_timeout.tv_usec = 0; /* Note: check for >= 1 below is essential since IOMGR_select * doesn't have exactly same semantics as select. */ #ifdef AFS_PTHREAD_ENV + s_timeout.tv_sec = SYNC_SELECT_TIMEOUT; + s_timeout.tv_usec = 0; if (select(maxfd + 1, &FSYNC_readfds, NULL, NULL, &s_timeout) >= 1) #else /* AFS_PTHREAD_ENV */ if (IOMGR_Select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1) -- 1.9.4