[OpenAFS-devel] [PATCH] unused variables cleanup

Joe Buehler jbuehler@hekimian.com
Fri, 14 Nov 2003 13:54:23 -0500


This patch eliminates about 320 compiler warnings from MSVC++ 6
regarding unused variables.  There are one or two places where
this patch overlaps in minor ways patches I previously posted.

--- ./src/WINNT/afsd/cm_config.c.~1~	2002-11-04 15:43:50.000000000 -0500
+++ ./src/WINNT/afsd/cm_config.c	2003-11-14 10:50:28.000000000 -0500
@@ -378,7 +378,6 @@
          long code;
          long tlen;
          FILE *tfilep;
-        char *afsconf_path;

  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
  	code = GetWindowsDirectory(wdir, sizeof(wdir));
@@ -391,7 +390,7 @@
  #ifdef DJGPP
          strcpy(wdir,cm_confDir);
  #else
-        afsconf_path = getenv("AFSCONF");
+        char *afsconf_path = getenv("AFSCONF");
          if (!afsconf_path)
            strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
          else
@@ -546,13 +545,11 @@
          long code;
          long closeCode;
          int tlen;
-        char *afsconf_path;
-
-	closeCode = fclose((FILE *)filep);

  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
  	code = GetWindowsDirectory(wdir, sizeof(wdir));
-        if (code == 0 || code > sizeof(wdir)) return NULL;
+        if (code == 0 || code > sizeof(wdir))
+			return 0;

  	/* add trailing backslash, if required */
          tlen = strlen(wdir);
@@ -561,7 +558,7 @@
  #ifdef DJGPP
          strcpy(wdir,cm_confDir);
  #else
-        afsconf_path = getenv("AFSCONF");
+        char *afsconf_path = getenv("AFSCONF");
          if (!afsconf_path)
            strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
          else
@@ -572,6 +569,7 @@

          strcpy(sdir, wdir);

+	closeCode = fclose((FILE *)filep);
  	if (closeCode != 0) {
  		/* something went wrong, preserve original database */
                  strcat(wdir, "afsdcel2.ini");
@@ -594,7 +592,6 @@
  void cm_GetConfigDir(char *dir)
  {
  	char wdir[256];
-     char *afsconf_path;
       int code;
       int tlen;

@@ -609,7 +606,7 @@
  #ifdef DJGPP
          strcpy(wdir,cm_confDir);
  #else
-        afsconf_path = getenv("AFSCONF");
+        char *afsconf_path = getenv("AFSCONF");
          if (!afsconf_path)
            strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
          else
--- ./src/WINNT/afsd/cm_conn.c.~1~	2003-08-12 00:06:39.000000000 -0400
+++ ./src/WINNT/afsd/cm_conn.c	2003-11-14 12:36:33.000000000 -0500
@@ -170,8 +170,6 @@
  	/* special codes:  missing volumes */
  	if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE
  	    || errorCode == VSALVAGE || errorCode == VNOSERVICE) {
-		long oldSum, newSum;
-		int same;

  		/* Log server being offline for this volume */
  		osi_Log4(afsd_logp, "cm_Analyze found server %d.%d.%d.%d marked offline for a volume",
--- ./src/WINNT/afsd/cm_dns.c.~1~	2001-10-09 00:56:00.000000000 -0400
+++ ./src/WINNT/afsd/cm_dns.c	2003-11-14 10:47:31.000000000 -0500
@@ -41,7 +41,6 @@
    char configpath[100];
    int len;
    int code;
-  char *path;
    char *addr;

    if (!enabled) { fprintf(stderr, "DNS support disabled\n"); cm_dnsEnabled = 0; return 0; }
@@ -55,7 +54,7 @@
  #ifdef DJGPP
      strcpy(configpath, cm_confDir);
  #elif defined(AFS_WIN95_ENV)
-    path = getenv("AFSCONF");
+    char *path = getenv("AFSCONF");
      if (path) strcpy(configpath, path);
      else strcpy(configpath, "c:\\afscli");
  #else  /* nt */
@@ -250,7 +249,7 @@
    /*static char buffer[BUFSIZE];*/

    int         addrLen = sizeof(SOCKADDR_IN);
-  int         res;
+  /*int         res;*/
    int size;

  #ifndef WIN32_LEAN_AND_MEAN
@@ -548,7 +547,6 @@
  {
    u_char *ptr = (u_char *) replyBuff;
    int    answerCount = ntohs((replyBuff)->rr_count);
-  u_char i;
    PDNS_A_RR_HDR
           rrPtr;

@@ -656,7 +654,6 @@
    SOCKADDR_IN sockAddr;
    char buffer[BUFSIZE];

-  int     i;
    u_char *addr;
    u_long *aPtr;
    int rc;
--- ./src/WINNT/afsd/cm_freelance.c.~1~	2001-11-02 16:00:41.000000000 -0500
+++ ./src/WINNT/afsd/cm_freelance.c	2003-11-14 12:38:47.000000000 -0500
@@ -49,10 +49,9 @@
  /* to be called while holding freelance lock unless during init. */
  void cm_InitFakeRootDir() {
  	
-	int i, j, t1, t2;
+	int i, t1, t2;
  	char* currentPos;
  	int noChunks;
-	char mask;
  	

  	// allocate space for the fake info
@@ -255,7 +254,7 @@

  int cm_reInitLocalMountPoints() {
  	cm_fid_t aFid;
-	int i, j, hash;
+	int i, hash;
  	cm_scache_t *scp, **lscpp, *tscp;

  	
@@ -343,7 +342,7 @@
  	
  	FILE *fp;
  	char line[200];
-	int n, i;
+	int i;
  	char* t;
  	cm_localMountPoint_t* aLocalMountPoint;
  	char hdir[120];
@@ -484,13 +483,12 @@

  long cm_FreelanceRemoveMount(char *toremove)
  {
-     int i, n, t1, t2;
+     int i, n;
       char* cp;
       char line[200];
       char shortname[200];
       char hfile[120], hfile2[120];
       FILE *fp1, *fp2;
-     char cmd[200];
       int found=0;

      lock_ObtainMutex(&cm_Freelance_Lock);
--- ./src/WINNT/afsd/cm_ioctl.c.~1~	2003-03-14 15:07:45.000000000 -0500
+++ ./src/WINNT/afsd/cm_ioctl.c	2003-11-14 12:37:46.000000000 -0500
@@ -112,7 +112,9 @@
   */
  void TranslateExtendedChars(char *str)
  {
+#ifdef DJGPP
    char *p;
+#endif

          if (!str || !*str)
                  return;
@@ -1292,8 +1294,6 @@
  	cm_scache_t *dscp;
  	cm_scache_t *scp;
  	char *cp;
-	cm_space_t *spacep;
-	cm_scache_t *newRootScp;
  	cm_req_t req;

  	cm_InitReq(&req);
--- ./src/WINNT/afsd/smb.c.~2~	2003-11-13 17:58:11.000000000 -0500
+++ ./src/WINNT/afsd/smb.c	2003-11-14 12:36:54.000000000 -0500
@@ -1095,9 +1095,9 @@
                    smb_localNamep, this_share, (print_afs ? "/afs" : "\0"),
                    pathName);
            num_shares++;
-          while (*this_share != NULL) this_share++;  /* find next NULL */
+          while (*this_share != 0) this_share++;  /* find next NULL */
            this_share++;   /* skip past the NULL */
-        } while (*this_share != NULL);  /* stop at final NULL */
+        } while (*this_share != 0);  /* stop at final NULL */

          return num_shares;
  }
@@ -6269,11 +6269,8 @@
  	thread_t phandle;
          int lpid;
          int i;
-        long code;
          int len;
-        NCB *ncbp;
  	struct tm myTime;
-	char s[100];
  #ifdef DJGPP
          int npar, seg, sel;
          dos_ptr rawBuf;
--- ./src/WINNT/afsd/smb3.c.~1~	2003-07-10 22:12:46.000000000 -0400
+++ ./src/WINNT/afsd/smb3.c	2003-11-14 12:37:09.000000000 -0500
@@ -113,7 +113,7 @@
  {
      char *tp;
      char *usern, *pwd, *pwdx;
-    smb_user_t *uidp, *dead_uidp;
+    smb_user_t *uidp;
      unsigned short newUid;
      unsigned long caps;
      cm_user_t *userp;
@@ -4110,7 +4110,6 @@

  cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
  {
-    cm_user_t *userp;
      /*int newUid;*/
      smb_username_t *unp;

--- ./src/WINNT/client_exp/afs_shl_ext.cpp.~1~	2002-11-26 22:30:19.000000000 -0500
+++ ./src/WINNT/client_exp/afs_shl_ext.cpp	2003-11-14 12:39:05.000000000 -0500
@@ -89,14 +89,11 @@
  // by exporting DllRegisterServer, you can use regsvr.exe
  STDAPI DllRegisterServer(void)
  {
-	int      i;
  	HKEY     hKey;
  	LRESULT  lResult;
  	DWORD    dwDisp;
  	TCHAR    szSubKey[MAX_PATH];
  	TCHAR    szCLSID[MAX_PATH];
-	TCHAR    szModule[MAX_PATH];
-	LPWSTR   pwsz;
  	AFX_MANAGE_STATE(AfxGetStaticModuleState());
  	COleObjectFactory::UpdateRegistryAll();
  	wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE);
--- ./src/WINNT/client_osi/osilog.c.~1~	2003-03-09 20:59:15.000000000 -0500
+++ ./src/WINNT/client_osi/osilog.c	2003-11-14 12:35:50.000000000 -0500
@@ -353,7 +353,8 @@
  #define MAXBUF_ 131
  void osi_LogEvent0(char *a,char *b)
  {
-	HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+	HANDLE h;
+	char *ptbuf[1];
  	if (!ISLOGONTRACE(osi_TraceOption))
  		return;
  	h = RegisterEventSource(NULL, a);
--- ./src/auth/cellconfig.c.~2~	2003-11-14 09:38:07.000000000 -0500
+++ ./src/auth/cellconfig.c	2003-11-14 10:51:05.000000000 -0500
@@ -786,8 +786,6 @@
      register afs_int32 i;
      int tservice;
      struct afsconf_entry DNSce;
-    char *DNStmpStrp;		/* a temp string pointer */
-    struct hostent *thp;
      afs_int32 cellHosts[AFSMAXCELLHOSTS];
      int numServers;
      int rc;
--- ./src/bucoord/commands.c.~2~	2003-11-13 17:58:12.000000000 -0500
+++ ./src/bucoord/commands.c	2003-11-14 11:51:15.000000000 -0500
@@ -80,7 +80,6 @@
       struct ubik_client *uclient;
  {				/*bc_EvalVolumeSet */
      int code;
-    int a, b, c;
      static afs_int32 use = 2;

      if (use == 2) {		/* Use EvalVolumeSet2() */
@@ -166,7 +165,7 @@
       struct serversort *serverlist;
       struct bc_volumeDump **avols;
  {
-    struct serversort *ss, **pss, *tss;
+    struct serversort *ss, **pss;
      struct partitionsort *ps, **pps;
      afs_int32 r;
      afs_int32 scount, pcount;
@@ -220,8 +219,8 @@
      struct bc_volumeDump *tvd;
      afs_int32 code = 0, tcode;
      afs_int32 count = 0;
-    struct serversort *servers = 0, *lastserver = 0, *ss = 0, *nss;
-    struct partitionsort *ps = 0, *nps;
+    struct serversort *servers = 0, *lastserver = 0, *ss = 0;
+    struct partitionsort *ps = 0;

      *avols = (struct bc_volumeDump *)0;
      bulkentries.nbulkentries_len = 0;
@@ -833,7 +832,6 @@
       char *arock;
  {
      afs_int32 code;
-    afs_int32 index, dumpID;
      struct rx_connection *tconn;
      afs_int32 portOffset = 0;

@@ -902,8 +900,6 @@
      int usefulJobRunning = 1;

      extern dlqlinkT statusHead;
-    statusP ptr;
-    dlqlinkP dptr;

      com_err(whoami, 0, "waiting for job termination");

@@ -933,9 +929,7 @@
       struct cmd_syndesc *as;
       char *arock;
  {
-    int i;
      afs_int32 prevTime;
-    struct bc_dumpTask *td;
      dlqlinkP ptr;
      statusP statusPtr;
      char ds[50];
@@ -1056,7 +1050,6 @@
      struct bc_dumpTask *td;
      char *tp;
      char tbuffer[256];
-    afs_int32 code;

      dlqlinkP ptr;
      statusP statusPtr;
@@ -1151,7 +1144,7 @@
      int oldFlag;
      afs_int32 fromDate;
      char *newExt, *timeString;
-    afs_int32 i, portRemain;
+    afs_int32 i;
      afs_int32 *ports = NULL;
      afs_int32 portCount = 0;
      int dontExecute;
@@ -1618,7 +1611,6 @@
      struct bc_volumeSet *tvs;	/*Ptr to list of generated volume info */
      struct bc_dumpSchedule *tds, *baseds;	/*Ptr to dump schedule node */
      struct bc_volumeDump *tve, *volsToDump;	/*Ptr to individual vols to be dumped */
-    struct bc_volumeDump *ntve, *tves, *ptves, *rtves;
      struct budb_dumpEntry dumpEntry, de, fde;	/* dump entry */
      afs_uint32 d;

@@ -1635,11 +1627,7 @@
      afs_int32 code;		/* Return code */
      int loadfile;		/* whether to load a file or not */

-    struct bc_dumpTask *dumpTaskPtr;	/* for dump thread */
-    afs_int32 dumpTaskSlot;
-    char *junk;
      statusP statusPtr;
-    int r, nservers, ns, serverfound;

      extern struct bc_dumpTask bc_dumpTasks[];
      extern afs_int32 bcdb_FindLastVolClone();
@@ -2443,7 +2431,6 @@
      budb_dumpsList dumps, flags;
      int i;
      afs_int32 port = -1, dbonly = 0, force;
-    afs_uint32 taskid;

      /* Must specify at least one of -dumpid, -from, or -to */
      if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items
@@ -2885,7 +2872,6 @@
      budb_volumeList vl;
      afs_int32 last, next, dbTime;
      afs_int32 tapedumpid;
-    afs_int32 numTapes;

      int tapeNumber;
      int i;
--- ./src/bucoord/config.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/config.c	2003-11-14 11:47:39.000000000 -0500
@@ -71,7 +71,6 @@
       char *apath;
  {
      register struct bc_config *tb;
-    register struct bc_hostEntry *the;

      /* initialize global config structure */
      tb = (struct bc_config *)malloc(sizeof(struct bc_config));
--- ./src/bucoord/dsvs.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/dsvs.c	2003-11-14 11:51:34.000000000 -0500
@@ -390,7 +390,7 @@
       afs_int32 expDate;
       afs_int32 expType;
  {
-    register struct bc_dumpSchedule **tlast, *tdump;
+    register struct bc_dumpSchedule *tdump;
      struct bc_dumpSchedule *parent, *node;
      afs_int32 code;

@@ -517,7 +517,7 @@
  bc_ProcessDumpSchedule(aconfig)
       register struct bc_config *aconfig;
  {
-    register struct bc_dumpSchedule *tds, *uds;
+    register struct bc_dumpSchedule *tds;
      struct bc_dumpSchedule *parentptr, *nodeptr;
      int retval;

--- ./src/bucoord/dump.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/dump.c	2003-11-14 11:52:09.000000000 -0500
@@ -68,10 +68,8 @@
  bc_Dumper(aindex)
  {
      struct rx_connection *tconn;
-    struct tc_dumpStat dumpStat;
      register struct bc_volumeDump *tde;
      afs_int32 count, port;
-    struct timeval tv;
      struct tc_dumpDesc *volDesc = 0;
      struct tc_dumpArray volArray;
      char *baseNamePtr;
@@ -268,8 +266,6 @@
      register int i;
      register afs_int32 code;
      char *junk;
-    int doit;
-    struct bc_volumeDump *tvol, *temp;

      for (i = 0; i < BC_MAXSIMDUMPS; i++)
  	if (!(bc_dumpTasks[i].flags & BC_DI_INUSE))
--- ./src/bucoord/dump_sched.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/dump_sched.c	2003-11-14 11:52:32.000000000 -0500
@@ -64,10 +64,9 @@
       char *arock;
  {
      register char *dname;	/* dump schedule name */
-    char *dateString;		/* expiration date */
      register afs_int32 code;
      afs_int32 expType, expDate;
-    register struct cmd_item *ti, *expItem;
+    register struct cmd_item *ti;
      udbClientTextP ctPtr;

      afs_int32 bc_ParseExpiration();
--- ./src/bucoord/main.c.~2~	2003-11-14 09:41:20.000000000 -0500
+++ ./src/bucoord/main.c	2003-11-14 11:47:25.000000000 -0500
@@ -333,7 +333,6 @@
  MyBeforeProc(as)
       register struct cmd_syndesc *as;
  {
-    char *rock;
      afs_int32 code;

      /* Handling the command line opcode */
@@ -492,7 +491,6 @@
      char *targv[MAXV];		/*Ptr to parsed argv stuff */
      afs_int32 targc;		/*Num parsed arguments */
      afs_int32 code;		/*Return code */
-    char *tp;			/*Result of gets() */
      register struct cmd_syndesc *ts;	/*Ptr to parsed command line */
      int i;

--- ./src/bucoord/restore.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/restore.c	2003-11-14 11:52:18.000000000 -0500
@@ -192,7 +192,7 @@

      struct dumpinfo *dumpinfolist = NULL;
      struct dumpinfo *pdi, *ndi, *di, dlevels[BC_MAXLEVELS];
-    struct volinfo *pvi, *nvi, *vi;
+    struct volinfo *nvi, *vi;
      afs_int32 lvl, lv;

      afs_int32 serverAll;	/* The server to which all volumes are to be restore to */
--- ./src/bucoord/ubik_db_if.c.~2~	2003-11-13 17:58:12.000000000 -0500
+++ ./src/bucoord/ubik_db_if.c	2003-11-14 11:47:08.000000000 -0500
@@ -511,7 +511,7 @@
  bcdb_GetTextFile(register udbClientTextP ctPtr)
  {
      afs_int32 bufferSize;
-    afs_int32 offset, nextOffset, chunkSize;
+    afs_int32 offset, nextOffset;
      charListT charList;
      afs_int32 code = 0;

@@ -965,8 +965,6 @@
       int localauth;
       char *cellName;
  {
-    afs_int32 serverList[MAXSERVERS];
-    char hostname[256];
      struct ktc_principal principal;
      struct ktc_token token;
      struct afsconf_cell info;
--- ./src/bucoord/vol_sets.c.~1~	2003-07-15 19:14:47.000000000 -0400
+++ ./src/bucoord/vol_sets.c	2003-11-14 11:53:20.000000000 -0500
@@ -65,7 +65,6 @@
      char *volSetName, *serverName, *partitionName, *volRegExp;
      udbClientTextP ctPtr;
      struct bc_volumeSet *tset;
-    afs_int32 flags;

      volSetName = as->parms[0].items->data;
      serverName = as->parms[1].items->data;
@@ -396,11 +395,8 @@

  bc_ClearVolumeSets()
  {
-    udbClientTextP ctPtr;
      struct udbHandleS *uhptr = &udbHandle;
      struct bc_volumeSet *vsPtr, *vsNextPtr, **vsPrev;
-    struct bc_volumeEntry *vePtr, *veNextPtr;
-    afs_int32 code;

      extern struct bc_config *bc_globalConfig;

@@ -673,7 +669,6 @@
  afs_int32
  bc_UpdateVolumeSet()
  {
-    struct bc_dumpSchedule *dumpPtr, *nextDumpPtr;
      struct udbHandleS *uhptr = &udbHandle;
      udbClientTextP ctPtr;
      afs_int32 code;
--- ./src/budb/db_hash.c.~2~	2003-11-13 17:58:12.000000000 -0500
+++ ./src/budb/db_hash.c	2003-11-14 10:56:05.000000000 -0500
@@ -1219,7 +1219,6 @@
      int tableLength;		/* # entries */
      int blockLength;		/* # blocks */
      int hashIndex;
-    int blockIndex, entryIndex;
      int old;
      int i;
      afs_int32 code = 0;
--- ./src/budb/ol_verify.c.~1~	2003-07-15 19:14:48.000000000 -0400
+++ ./src/budb/ol_verify.c	2003-11-14 10:56:48.000000000 -0500
@@ -561,9 +561,8 @@
       struct volInfo *volInfo;
  {
      int volCount = 0, ccheck = 1;
-    int nFrags;
      afs_int32 volFragAddr;
-    int blockIndex, entryIndex, bindex, eindex;
+    int blockIndex, entryIndex;
      struct volFragment volFragment;
      afs_int32 code = 0, tcode;

@@ -1268,7 +1267,7 @@
       FILE *recreateFile;	/* not used */
  {
      afs_int32 eof;
-    int j, bmsize;
+    int bmsize;
      afs_int32 code = 0, tcode;

      extern int nBlocks;		/* no. blocks in database */
--- ./src/budb/procs.c.~2~	2003-11-13 17:58:12.000000000 -0500
+++ ./src/budb/procs.c	2003-11-14 10:57:46.000000000 -0500
@@ -899,7 +899,6 @@
      struct dump dump;
      struct tape tape;
      dumpId dumpid;
-    int firstdump;
      afs_int32 eval, code = 0;
      int partialDel;

@@ -1611,8 +1610,7 @@
      dbadr dbAddr, dbAppAddr;

      afs_int32 eval, code = 0;
-    int old, hash, length, entrySize, j, k, count = 0;
-    afs_uint32 toList, toFlag;
+    int old, hash, length, entrySize, count = 0;

      if (!callPermitted(call))
  	return BUDB_NOTPERMITTED;
@@ -1912,7 +1910,7 @@
       afs_int32 *clonetime;
  {
      struct ubik_trans *ut;
-    dbadr da, ta, hvia, via, vfa;
+    dbadr da, hvia, via, vfa;
      struct dump d;
      struct tape t;
      struct volFragment vf;
--- ./src/butc/dump.c.~2~	2003-11-13 17:58:12.000000000 -0500
+++ ./src/butc/dump.c	2003-11-14 12:35:04.000000000 -0500
@@ -1130,7 +1130,6 @@
      afs_int32 code = 0;

      /* for volume setup */
-    struct tc_dumpDesc *dumpDescPtr;
      int i;
      int failedvolumes = 0;
      int dumpedvolumes = 0;
@@ -1520,11 +1519,10 @@
      struct budb_dumpEntry dumpEntry;
      struct budb_tapeEntry tapeEntry;
      struct budb_volumeEntry volEntry;
-    Date oldTapeExpiration, expir;
-    afs_int32 curTime;
+    Date expir;
      afs_int32 doAppend;
      afs_int32 code = 0;
-    int askForTape, opcode;
+    int askForTape;
      int tapecount = 1;
      char strlevel[5];
      afs_int32 tapepos, lastpos;
@@ -1644,10 +1642,9 @@
  	} else {		/* not appending */

  	    afs_uint32 tapeid;
-	    afs_uint32 dmp, parent;
+	    afs_uint32 dmp;
  	    struct budb_dumpEntry de, de2;

-
  	    /* Check if tape name is not what expected - null tapes are acceptable
  	     * Don't do check if the tape has a user defined label.
  	     */
--- ./src/butc/lwps.c.~2~	2003-11-13 17:58:13.000000000 -0500
+++ ./src/butc/lwps.c	2003-11-14 12:01:02.000000000 -0500
@@ -437,8 +437,6 @@
       afs_uint32 dbDumpId;
       int tapecount;
  {
-    afs_int32 count;
-
      afs_int32 code = 0;
      int pid;

@@ -552,7 +550,6 @@
       struct butm_tapeInfo *tapeInfoPtr;
  {
      afs_int32 code;
-    afs_int32 wcode;
      int cpid, status, rcpid;

      code = butm_Dismount(tapeInfoPtr);
@@ -1245,8 +1242,7 @@
  {
      afs_int32 curChunk;
      afs_uint32 totalWritten = 0;
-    afs_uint32 tapeID;
-    afs_int32 code, tcode;
+    afs_int32 code;
      afs_int32 headBytes, tailBytes, w;
      afs_int32 taskId;
      afs_int32 nbytes;		/* # bytes data in last tape block read */
@@ -1478,8 +1474,9 @@
       struct tc_restoreDesc *restoreInfo;
       struct restoreParams *rparamsPtr;
  {
-    afs_int32 code = 0, rc;
+    afs_int32 code = 0;
  #ifdef xbsa
+    afs_int32 rc;
      afs_int32 newServer, newPart, newVolId;
      char *newVolName;
      int restoreflags, havetrans = 0, startread = 0;
@@ -1675,7 +1672,6 @@
      int restoreflags;
      afs_uint32 tapeID;
      struct butm_tapeInfo *tapeInfoPtr = rparamsPtr->tapeInfoPtr;
-    struct budb_dumpEntry dumpEntry;

      /* Check if we need a tape and prompt for one if so */
      tapeID =
@@ -1745,15 +1741,13 @@
  Restorer(newNode)
       struct dumpNode *newNode;
  {
-    afs_int32 code = 0, tcode, rc;
+    afs_int32 code = 0, tcode;
      afs_uint32 taskId;
-    afs_uint32 dumpID;
      char *newVolName;
      struct butm_tapeInfo tapeInfo;
      struct tc_restoreDesc *Restore;
      struct tc_restoreDesc *RestoreDesc;
      struct restoreParams rparams;
-    int restoreflags;
      afs_int32 allocbufferSize;
      time_t startTime, endTime;
      afs_int32 goodrestore = 0;
@@ -1870,7 +1864,7 @@
  	unmountTape(taskId, &tapeInfo);
      } else {
  #ifdef xbsa
-	rc = InitToServer(taskId, &butxInfo, 0);	/* Return to original server */
+    /* afs_int32 rc = */ InitToServer(taskId, &butxInfo, 0);	/* Return to original server */
  #endif
      }

@@ -2001,7 +1995,6 @@
       afs_int32 *dSize;		/* dataSize */
  {
      afs_int32 offset, s;
-    afs_int32 code;
      int found;

      *dSize = size;
--- ./src/butc/recoverDb.c.~1~	2003-07-15 19:14:49.000000000 -0400
+++ ./src/butc/recoverDb.c	2003-11-14 12:01:25.000000000 -0500
@@ -533,13 +533,12 @@
      int moreTapes = 1;
      afs_int32 nbytes, flags, seq;
      int newDump = 1, newTape = 1;
-    afs_int32 tapePosition, c;
+    afs_int32 tapePosition;
      afs_int32 code = 0, tcode;
-    int interactiveFlag, badscan;
+    int badscan;

      struct volumeHeader volHeader, volTrailer;

-    int good;
      struct budb_tapeEntry tapeEntry;
      struct budb_volumeEntry volEntry;

--- ./src/butc/tcmain.c.~1~	2003-08-08 17:54:36.000000000 -0400
+++ ./src/butc/tcmain.c	2003-11-14 12:06:55.000000000 -0500
@@ -268,7 +268,6 @@
       char *name;
  {
      char *pos;
-    int i;
      char buffer[256];

      pos = strrchr(name, '/');
@@ -855,7 +854,6 @@
       struct cmd_syndesc *as;
       char *arock;
  {
-    char *pid;
      register afs_int32 code;
      struct rx_securityClass *(securityObjects[3]);
      struct rx_service *service;
@@ -864,7 +862,6 @@
      int localauth;
      /*process arguments */
      afs_int32 portOffset = 0;
-    afs_int32 logIOName;
  #ifdef AFS_PTHREAD_ENV
      pthread_t dbWatcherPid;
      pthread_attr_t tattr;
@@ -978,7 +975,9 @@
      if (centralLogFile) {
  	struct stat sbuf;
  	afs_int32 statcode;
+#ifndef AFS_NT40_ENV
  	char path[AFSDIR_PATH_MAX];
+#endif

  	statcode = stat(centralLogFile, &sbuf);
  	centralLogIO = fopen(centralLogFile, "a");
--- ./src/butc/tcprocs.c.~1~	2003-07-15 19:14:49.000000000 -0400
+++ ./src/butc/tcprocs.c	2003-11-14 11:56:19.000000000 -0500
@@ -46,19 +46,6 @@
  callPermitted(call)
       struct rx_call *call;
  {
-    afs_int32 code;
-
-    struct rx_connection *tconn;
-    rxkad_level level;
-    Date expiration;
-    char name[MAXKTCNAMELEN];
-    char inst[MAXKTCNAMELEN];
-    char celn[MAXKTCREALMLEN];
-    afs_int32 kvno;
-
-    char *cell;
-    afs_int32 flag;
-
      /* before this code can be used, the rx connection, on the bucoord side, must */
      /* be changed so that it will set up for token passing instead of using  a    */
      /* simple rx connection that, below, returns a value of 0 from rx_SecurityClassOf */
@@ -83,7 +70,6 @@
  #else
      PROCESS pid;
  #endif
-    struct tc_tapeLabel *mylabel;
      struct labelTapeIf *ptr;
      statusP statusPtr;
      afs_int32 code;
@@ -627,6 +613,7 @@
      struct deleteDumpIf *ptr = 0;
      statusP statusPtr = 0;
      afs_int32 code = TC_BADTASK;	/* If not compiled -Dxbsa then fail */
+#ifdef xbsa
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
      pthread_attr_t tattr;
@@ -634,6 +621,7 @@
  #else
      PROCESS pid;
  #endif
+#endif
      extern afs_int32 DeleteDump();
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
--- ./src/butc/tcudbprocs.c.~1~	2003-07-15 19:14:49.000000000 -0400
+++ ./src/butc/tcudbprocs.c	2003-11-14 12:03:20.000000000 -0500
@@ -110,7 +110,6 @@
      int interactiveFlag;
      char tapeName[BU_MAXTAPELEN];
      char strlevel[5];
-    afs_int32 i;
      struct timeval tp;
      struct timezone tzp;
      afs_int32 curTime;
@@ -377,14 +376,11 @@
      afs_int32 code = 0;
      afs_int32 i;
      int wroteLabel;
-    afs_int32 new;
      afs_uint32 taskId;
      Date expires;

      struct butm_tapeInfo tapeInfo;
      struct budb_dumpEntry dumpEntry;
-    struct tapeEntryList *next;
-    struct budb_dumpEntry de;

      extern struct deviceSyncNode *deviceLatch;
      extern struct tapeConfig globalTapeConfig;
@@ -512,8 +508,6 @@
       struct budb_tapeEntry *tapeEntPtr;
       struct budb_dumpEntry *dumpEntryPtr;
  {
-    afs_int32 code;
-
      memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));

      dumpEntryPtr->id = tapeEntPtr->dump;
@@ -548,7 +542,7 @@
  {
      afs_int32 code = 0;
      int interactiveFlag;
-    afs_int32 taskId, i;
+    afs_int32 taskId;
      struct butm_tapeLabel oldTapeLabel;
      char AFStapeName[BU_MAXTAPELEN], tapeName[BU_MAXTAPELEN];
      struct tapeEntryList *endList;
@@ -667,8 +661,7 @@
       afs_uint32 taskId;
  {
      afs_int32 code = 0;
-    afs_int32 new, i;
-    struct dumpNode *node;
+    afs_int32 i;
      struct butm_tapeInfo tapeInfo;
      struct rstTapeInfo rstTapeInfo;
      struct budb_dumpEntry dumpEntry;
@@ -820,7 +813,7 @@
      afs_int32 chunksize = 0;
      afs_int32 tc_EndMargin, tc_KEndMargin, kRemaining;
      int sequence;
-    int wroteLabel, new;
+    int wroteLabel;
      int firstcall;
  #ifdef AFS_PTHREAD_ENV
      pthread_t alivePid;
@@ -1208,9 +1201,9 @@
      struct budb_tapeEntry netTapeEntry, hostTapeEntry;
      struct budb_volumeEntry netVolumeEntry, hostVolumeEntry;
      struct structDumpHeader netItemHeader;
-    afs_int32 newTape, taskId;
+    afs_int32 taskId;
      int restoreThisDump = 1;
-    afs_int32 code = 0, tcode;
+    afs_int32 code = 0;

      extern struct udbHandleS udbHandle;

@@ -1545,9 +1538,8 @@
       char *buffer;
       afs_int32 requestedBytes;
  {
-    afs_int32 taskId, transferBytes, new;
+    afs_int32 taskId, transferBytes;
      afs_int32 code = 0;
-    afs_uint32 dumpid;

      taskId = rstTapeInfoPtr->taskId;

--- ./src/butm/file_tm.c.~2~	2003-11-13 17:58:13.000000000 -0500
+++ ./src/butm/file_tm.c	2003-11-14 11:01:55.000000000 -0500
@@ -652,8 +652,6 @@
       usd_handle_t fid;
       afs_uint32 dataSize;
  {
-    afs_hyper_t off;
-
      /* Add this to the amount of data written to the tape */
      incSize(info, dataSize);

@@ -663,6 +661,7 @@
  	info->posCount = 0;
  #if (defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) || defined(AFS_LINUX24_ENV))
  	if (!isafile) {
+	    afs_hyper_t off;
  	    hset64(off, 0, 0);
  	    USD_IOCTL(fid, USD_IOCTL_SETSIZE, &off);
  	}
@@ -728,8 +727,6 @@
       int count;
  {
      afs_int32 code = 0;
-    afs_int32 fcode;
-    int cpid, status, rcpid, stat;
      struct progress *p;
      afs_int32 error = 0;

@@ -972,9 +969,7 @@
       struct butm_tapeInfo *info;
  {
      struct progress *p;
-    int cpid, status, rcpid, stat;
      afs_int32 code = 0;
-    afs_int32 rwcode;
      afs_int32 error;

      p = (struct progress *)info->tmRock;
@@ -1013,7 +1008,7 @@
      struct progress *p;
      char filename[64];
      usd_handle_t fid;
-    int cpid, status, rcpid, xflags;
+    int xflags;
      afs_int32 code = 0, error = 0, rc = 0;

      if (info->debug)
@@ -1096,11 +1091,7 @@
       struct butm_tapeInfo *info;
  {
      struct progress *p;
-    int cpid, status, rcpid, stat;
-    afs_int32 code = 0, error = 0, cd;
-    afs_int32 clcode;
-    int fd[2];
-    char c;
+    afs_int32 code = 0, error = 0;

      if (info->debug)
  	printf("butm: Unmount tape drive\n");
@@ -1356,7 +1347,6 @@
  file_ReadFileBegin(info)
       struct butm_tapeInfo *info;
  {
-    struct fileMark mark;
      afs_int32 code = 0;
      afs_int32 blockType;

@@ -1539,7 +1529,6 @@
  file_ReadFileEnd(info)
       struct butm_tapeInfo *info;
  {
-    struct fileMark mark;
      afs_int32 code = 0;
      afs_int32 blockType;

@@ -1666,7 +1655,6 @@
       struct butm_tapeInfo *info;
       afs_int32 position;
  {
-    struct fileMark mark;
      afs_int32 code = 0;
      afs_int32 blockType;
      afs_int32 w;
--- ./src/config/util_cr.c.~1~	2003-07-15 19:14:56.000000000 -0400
+++ ./src/config/util_cr.c	2003-11-14 10:33:37.000000000 -0500
@@ -308,7 +308,6 @@
  int
  isequal(char *msg1, char *msg2, char *disp)
  {
-    int x;
      strlwr(msg1);
      strlwr(msg2);
      if (strcmp(msg1, msg2) != 0)
@@ -320,7 +319,6 @@
  int
  SetSysEnv(int argc, char *argv[])
  {
-    long ret;
      DWORD dwResult;
      printf("assignment %s %s\n", argv[2], argv[3]);
      Addkey("HKEY_LOCAL_MACHINE",
--- ./src/kauth/admin_tools.c.~2~	2003-11-13 17:58:13.000000000 -0500
+++ ./src/kauth/admin_tools.c	2003-11-14 10:55:29.000000000 -0500
@@ -1287,7 +1287,6 @@
  MyBeforeProc(struct cmd_syndesc *as, char *arock)
  {
      extern struct passwd *getpwuid();
-    struct passwd *pw;
      struct ktc_encryptionKey key;
      struct ktc_principal auth_server, auth_token, client;
      char realm[MAXKTCREALMLEN];
@@ -1349,7 +1348,7 @@
  	    }
  #else
  	    /* No explicit name provided: use Unix uid. */
-	    pw = getpwuid(getuid());
+	    struct passwd *pw = getpwuid(getuid());
  	    if (pw == 0) {
  		printf("Can't figure out your name from your user id.\n");
  		return KABADCMD;
--- ./src/kauth/kadatabase.c.~2~	2003-11-13 17:58:13.000000000 -0500
+++ ./src/kauth/kadatabase.c	2003-11-14 10:53:55.000000000 -0500
@@ -611,7 +611,7 @@
       afs_int32 tentryaddr;
       struct kaentry *tentry;
  {
-    int code, i;
+    int code;
      struct kaOldKeys okeys;	/* old keys block */
      afs_int32 okeysaddr, nextaddr;	/* offset of old keys block */
      afs_int32 prevptr = 0;
@@ -682,7 +682,6 @@
  	if (keyCache[i].used) {
  	    if (info->kcUsed < KADEBUGKCINFOSIZE) {
  		int j = info->kcUsed;
-		int k;
  		char principal[sizeof(keyCache[0].name) +
  			       sizeof(keyCache[0].inst)];

@@ -692,8 +691,11 @@
  		    (keyCache[i].superseded == NEVERDATE);
  		info->kcInfo[j].keycksum = 0;
  #if DEBUG_KEY_CACHE
+		{
+		int k;
  		for (k = 0; k < sizeof(struct ktc_encryptionKey); k++)
  		    info->kcInfo[j].keycksum += ((char *)&keyCache[i].key)[k];
+		}
  #endif
  		strcpy(principal, keyCache[i].name);
  		strcat(principal, ".");
--- ./src/kauth/kaprocs.c.~1~	2003-07-15 19:15:16.000000000 -0400
+++ ./src/kauth/kaprocs.c	2003-11-14 10:54:25.000000000 -0500
@@ -1114,7 +1114,6 @@
      struct ktc_encryptionKey tgskey;	/* service key for encrypting ticket */
      Date now;
      afs_uint32 pwexpires;
-    afs_uint32 lasttime;

      COUNT_REQ(Authenticate);
      if (!name_instance_legal(aname, ainstance))
--- ./src/lwp/iomgr.c.~1~	2002-08-22 14:45:16.000000000 -0400
+++ ./src/lwp/iomgr.c	2003-11-14 10:35:29.000000000 -0500
@@ -292,7 +292,7 @@
   */
  static void FDSetSet(int nfds, fd_set *fd_set1, fd_set *fd_set2)
  {
-    unsigned int i, n;
+    unsigned int i;

      if (fd_set1 == (fd_set*)0 || fd_set2 == (fd_set*)0)
  	return;
@@ -307,8 +307,7 @@
      if (nfds == 0)
  	return;

-    n = INTS_PER_FDS(nfds);
-    for (i=0; i<n; i++) {
+    for (i=INTS_PER_FDS(nfds)-1; i>=0; --i) {
  	fd_set1->FDS_BITS[i] |= fd_set2->FDS_BITS[i];
      }
  #endif
--- ./src/ptserver/ptprocs.c.~1~	2003-08-11 18:22:02.000000000 -0400
+++ ./src/ptserver/ptprocs.c	2003-11-14 10:51:37.000000000 -0500
@@ -952,8 +952,8 @@
      struct ubik_trans *tt;
      afs_int32 cid;
      struct prentry tentry;
-    afs_int32 loc, nptr;
-    int count, id = 0;
+    afs_int32 loc;
+    int id = 0;

      code = Initdb();
      if (code)
--- ./src/ptserver/testpt.c.~2~	2003-11-13 17:58:14.000000000 -0500
+++ ./src/ptserver/testpt.c	2003-11-14 10:52:49.000000000 -0500
@@ -600,7 +600,7 @@
      for (u = 0; u < number; u++) {
  	afs_int32 ui = users[u];
  	if (ui) {
-	    int i, j;
+	    int i;
  	    int ng;		/* number groups */
  	    int (*proc) ();	/* membership listing procedure */
  	    int over;
@@ -933,7 +933,6 @@
       struct cmd_syndesc *as;
       char *arock;
  {
-    afs_int32 code;
      if (strlen(tmp_conf_file))
  	unlink(tmp_conf_file);
      if (strlen(tmp_cell_file))
--- ./src/util/pthread_nosigs.h.~1~	2003-07-15 19:17:16.000000000 -0400
+++ ./src/util/pthread_nosigs.h	2003-11-14 12:19:49.000000000 -0500
@@ -17,9 +17,9 @@

  #ifdef AFS_NT40_ENV
  /* Compilers complain about empty declaration unless at end of decl's */
-#define AFS_SIGSET_DECL int i_junk
-#define AFS_SIGSET_CLEAR()
-#define AFS_SIGSET_RESTORE()
+#define AFS_SIGSET_DECL int i_junk = 0
+#define AFS_SIGSET_CLEAR() ++i_junk
+#define AFS_SIGSET_RESTORE() --i_junk
  #else
  #define AFS_SIGSET_DECL sigset_t i_tset, i_oset
  #ifdef AFS_AIX42_ENV
--- ./src/viced/afsfileprocs.c.~2~	2003-11-13 17:58:15.000000000 -0500
+++ ./src/viced/afsfileprocs.c	2003-11-14 12:31:15.000000000 -0500
@@ -574,7 +574,9 @@
  {
      extern prlist SystemAnyUserCPS;
      afs_int32 hrights = 0;
+#ifndef AFS_PTHREAD_ENV
      int code;
+#endif

      if (acl_CheckRights(ACL, &SystemAnyUserCPS, anyrights) != 0) {

@@ -1035,7 +1037,6 @@
      int wrlen;
      register afs_fsize_t size;
      register int length;
-    int ifd, ofd;
      char *buff;
      int rc;			/* return code */
      IHandle_t *newH;		/* Use until finished copying, then cp to vnode. */
@@ -4202,7 +4203,7 @@
      DirHandle dir;		/* Handle for dir package I/O */
      Volume *volptr = 0;		/* pointer to the volume header */
      struct client *client;	/* pointer to client structure */
-    afs_int32 rights, anyrights, fd;	/* rights for this and any user */
+    afs_int32 rights, anyrights;	/* rights for this and any user */
      struct client *t_client;	/* tmp ptr to client data */
      struct in_addr logHostAddr;	/* host ip holder for inet_ntoa */
      FdHandle_t *fdP;
@@ -5946,7 +5947,6 @@
  SRXAFS_GetCapabilities(struct rx_call * acall, Capabilities * capabilities)
  {
      afs_int32 *dataBuffP;
-    afs_int32 *dataP;
      afs_int32 dataBytes;

      dataBytes = 1 * sizeof(afs_int32);
@@ -6391,15 +6391,20 @@
  afs_int32
  SRXAFS_GetRootVolume(struct rx_call * acall, char **VolumeName)
  {
+#ifdef notdef
      int fd;
      int len;
      char *temp;
-    int errorCode = 0;		/* error code */
      struct rx_connection *tcon;
+#endif
+    int errorCode = 0;		/* error code */
  #if FS_STATS_DETAILED
      struct fs_stats_opTimingData *opP;	/* Ptr to this op's timing struct */
-    struct timeval opStartTime, opStopTime;	/* Start/stop times for RPC op */
+    struct timeval opStartTime;	/* Start/stop times for RPC op */
+#ifdef notdef
+    struct timeval opStopTime;	/* Start/stop times for RPC op */
      struct timeval elapsedTime;	/* Transfer time */
+#endif

      /*
       * Set our stats pointer, remember when the RPC operation started, and
@@ -6616,7 +6621,6 @@
  {
      struct timeval StartTime, StopTime;	/* used to calculate file  transfer rates */
      int errorCode = 0;		/* Returned error code to caller */
-    int code;
      IHandle_t *ihP;
      FdHandle_t *fdP;
  #ifdef AFS_NT40_ENV
@@ -6627,10 +6631,6 @@
  #endif /* AFS_NT40_ENV */
      afs_sfsize_t tlen;
      afs_int32 optSize;
-    struct afs_stat tstat;
-#ifdef	AFS_AIX_ENV
-    struct statfs tstatfs;
-#endif

  #if FS_STATS_DETAILED
      /*
@@ -6845,7 +6845,6 @@
      afs_fsize_t NewLength;	/* size after this store completes */
      afs_sfsize_t adjustSize;	/* bytes to call VAdjust... with */
      int linkCount;		/* link count on inode */
-    int code;
      FdHandle_t *fdP;
      struct in_addr logHostAddr;	/* host ip holder for inet_ntoa */

--- ./src/viced/callback.c.~1~	2003-09-24 14:54:10.000000000 -0400
+++ ./src/viced/callback.c	2003-11-14 12:33:22.000000000 -0500
@@ -766,7 +766,6 @@
  {
      int i, j;
      struct rx_connection *conns[MAX_CB_HOSTS];
-    int opt_TO;			/* secs, but internal adaptive parms are in ms */
      static struct AFSCBs tc = { 0, 0 };

      assert(ncbas <= MAX_CB_HOSTS);
@@ -878,7 +877,6 @@
      struct CallBack *cb, *nextcb;
      struct cbstruct cba[MAX_CB_HOSTS];
      int ncbas;
-    struct rx_connection *conns[MAX_CB_HOSTS];
      struct AFSCBFids tf;
      int hostindex;
      char hoststr[16];
@@ -1073,7 +1071,6 @@
      u_byte thead[AFSCBMAX];	/* This should match thead in struct Callback */
      int cbi, first, nfids;
      struct CallBack *cb;
-    struct interfaceAddr interf;
      int code;
      char hoststr[16];

@@ -1611,7 +1608,6 @@
  static int
  ClearHostCallbacks_r(struct host *hp, int locked)
  {
-    struct interfaceAddr interf;
      int code;
      int held = 0;
      char hoststr[16];
--- ./src/viced/host.c.~2~	2003-11-13 17:58:15.000000000 -0500
+++ ./src/viced/host.c	2003-11-14 12:32:25.000000000 -0500
@@ -534,7 +534,6 @@
  struct host *
  h_Alloc_r(register struct rx_connection *r_con)
  {
-    register int code;
      struct servent *serverentry;
      register index = h_HashIndex(rxr_HostOf(r_con));
      register struct host *host;
@@ -944,7 +943,6 @@
      struct Identity *identP = NULL;
      afs_int32 haddr;
      afs_int32 hport;
-    int i, j, count;
      char hoststr[16], hoststr2[16];
      Capabilities caps;

@@ -1832,7 +1830,6 @@
  void
  h_GetWorkStats(int *nump, int *activep, int *delp, afs_int32 cutofftime)
  {
-    register int i;
      register struct host *host;
      register int num = 0, active = 0, del = 0;

@@ -1894,9 +1891,6 @@
  		  afs_int32 * a_diffNetworkP)
  {				/*h_ClassifyAddress */

-    register int i;		/*Iterator thru host hash table */
-    register struct host *hostP;	/*Ptr to current host entry */
-    register afs_uint32 currHostAddr;	/*Current host address */
      afs_uint32 targetNet;
      afs_uint32 targetSubnet;
      afs_uint32 candNet;
@@ -2323,7 +2317,6 @@
  hashDelete_r(afs_int32 addr, struct host *host)
  {
      int flag;
-    int index;
      register struct h_hashChain **hp, *th;

      for (hp = &hostHashTable[h_HashIndex(addr)]; (th = *hp);) {
--- ./src/viced/viced.c.~1~	2003-09-24 14:54:10.000000000 -0400
+++ ./src/viced/viced.c	2003-11-14 12:23:15.000000000 -0500
@@ -639,7 +639,6 @@
  ShutDownAndCore(int dopanic)
  {
      time_t now = time(0);
-    char *tstr;
      char tbuffer[32];

      ViceLog(0,
@@ -1306,7 +1305,7 @@
  afs_int32
  WriteSysIdFile()
  {
-    afs_int32 fd, nentries, i;
+    afs_int32 fd, i;
      struct versionStamp vsn;
      struct afs_stat status;
      afsUUID uuid;
@@ -1413,9 +1412,7 @@
  afs_int32
  InitVL()
  {
-    int (*old) ();
      afs_int32 code;
-    afs_int32 cnt, i;
      extern int rxi_numNetAddrs;
      extern afs_uint32 rxi_NetAddrs[];

@@ -1476,14 +1473,12 @@
  int
  main(int argc, char *argv[])
  {
-    int i;
      afs_int32 code;
-    FILE *file;
      char tbuffer[32];
      struct rx_securityClass *sc[4];
      struct rx_service *tservice;
  #ifdef AFS_PTHREAD_ENV
-    pthread_t parentPid, serverPid;
+    pthread_t serverPid;
      pthread_attr_t tattr;
  #else /* AFS_PTHREAD_ENV */
      PROCESS parentPid, serverPid;
--- ./src/vol/ihandle.c.~1~	2003-08-08 16:40:45.000000000 -0400
+++ ./src/vol/ihandle.c	2003-11-14 11:34:40.000000000 -0500
@@ -350,7 +350,6 @@
  int
  fd_close(FdHandle_t * fdP)
  {
-    FD_t closeFd;
      IHandle_t *ihP;

      if (!fdP)
--- ./src/vol/nuke.c.~1~	2003-08-08 16:40:45.000000000 -0400
+++ ./src/vol/nuke.c	2003-11-14 11:34:09.000000000 -0500
@@ -115,8 +115,7 @@
      struct afs_stat tstat;
      struct ilist *ti, *ni;
      register afs_int32 code;
-    char *tfile;
-    int i, j, forceSal;
+    int i, forceSal;
      char devName[64], wpath[100];
      char *lastDevComp;
  #ifdef AFS_NAMEI_ENV
@@ -144,12 +143,14 @@
      lastDevComp = &aname[strlen(aname) - 1];
      *lastDevComp = toupper(*lastDevComp);
  #else
-    tfile = vol_DevName(tstat.st_dev, wpath);
+    {
+    char *tfile = vol_DevName(tstat.st_dev, wpath);
      if (!tfile) {
  	printf("volnuke: can't find %s's device.\n", aname);
  	return 1;
      }
      strcpy(devName, tfile);	/* save this from the static buffer */
+    }
      /* aim lastDevComp at the 'foo' of '/dev/foo' */
      lastDevComp = strrchr(devName, '/');
      /* either points at slash, or there is no slash; adjust appropriately */
@@ -200,10 +201,13 @@
  		}
  #else /* AFS_NAMEI_ENV */
  		IH_INIT(fileH, (int)tstat.st_dev, avolid, ti->inode[i]);
+		{
+		int j;
  		for (j = 0; j < ti->count[i]; j++) {
  		    code = IH_DEC(fileH, ti->inode[i], avolid);
  		}
  		IH_RELEASE(fileH);
+		}
  #endif /* AFS_NAMEI_ENV */
  	    }
  	    ni = ti->next;
--- ./src/vol/vol-salvage.c.~1~	2003-08-08 16:40:45.000000000 -0400
+++ ./src/vol/vol-salvage.c	2003-11-14 11:35:25.000000000 -0500
@@ -507,7 +507,7 @@
  {
      register struct cmd_item *ti;
      char pname[100], *temp;
-    afs_int32 seenpart = 0, seenvol = 0, vid = 0, seenany = 0, i;
+    afs_int32 seenpart = 0, seenvol = 0, vid = 0, seenany = 0;
      struct DiskPartition *partP;

  #ifdef AFS_SGI_VNODE_GLUE
@@ -519,12 +519,15 @@
  #endif

  #ifdef FAST_RESTART
+    {
+    afs_int32 i;
      for (i = 0; i < CMD_MAXPARMS; i++) {
  	if (as->parms[i].items) {
  	    seenany = 1;
  	    break;
  	}
      }
+    }
      if (!seenany) {
  	char *msg =
  	    "Exiting immediately without salvage. Look into the FileLog to find volumes which really need to be salvaged!";
--- ./src/volser/dumpstuff.c.~2~	2003-11-13 17:58:15.000000000 -0500
+++ ./src/volser/dumpstuff.c	2003-11-14 11:43:37.000000000 -0500
@@ -1459,7 +1459,7 @@
  	       afs_int32 fromtime, int dumpAllDirs,
  	       register struct volintSize *v_size)
  {
-    struct iod iod;
+/*    struct iod iod; */
      int code = 0;
      register struct iod *iodp = (struct iod *)0;
  /*    iod_Init(iodp, call); */
@@ -1480,7 +1480,7 @@
  {
      int code = 0;
      int UseLatestReadOnlyClone = 1;
-    afs_int32 dumpTimes[2];
+/*    afs_int32 dumpTimes[2]; */
      afs_uint64 addvar;
  /*    iodp->device = vp->device; */
  /*    iodp->parentId = V_parentId(vp); */
--- ./src/volser/volprocs.c.~1~	2003-07-15 19:17:48.000000000 -0400
+++ ./src/volser/volprocs.c	2003-11-14 11:44:08.000000000 -0500
@@ -1261,7 +1261,7 @@
      struct rx_connection **tcons;
      struct rx_call **tcalls;
      struct Volume *vp;
-    int i, nconns, is_incremental;
+    int i, is_incremental;

      if (results)
  	memset(results, 0, sizeof(manyResults));
@@ -1752,7 +1752,6 @@
       struct pIDs *partIds;
  {
      char namehead[9];
-    int code;
      char i;

      strcpy(namehead, "/vicep");	/*7 including null terminator */
@@ -1787,7 +1786,6 @@
       struct rx_call *acid;
       struct partEntries *pEntries;
  {
-    struct stat rbuf, pbuf;
      char namehead[9];
      struct partList partList;
      struct DiskPartition *dp;
--- ./src/volser/vos.c.~2~	2003-11-13 17:58:15.000000000 -0500
+++ ./src/volser/vos.c	2003-11-14 11:46:42.000000000 -0500
@@ -1174,7 +1174,6 @@
       afs_int32 server, part;
  {
      int totalOK, totalNotOK, totalBusy;
-    afs_int32 vcode, vcode2;

      DisplayFormat(pntr, server, part, &totalOK, &totalNotOK, &totalBusy, 0, 1,
  		  1);
@@ -2109,9 +2108,6 @@

      afs_int32 buvolid, buserver, bupart, butype;
      struct nvldbentry buentry;
-    struct rx_connection *conn;
-    volEntries volInfo;
-    struct nvldbentry store;

      avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
      if (avolid == 0) {
@@ -3897,7 +3893,6 @@
      afs_int32 totalFail = 0;
      int previdx = -1, error, same;
      int comp = 0;
-    char compstr[50];
      struct cmd_item *ti;
      char *ccode;
      int match;
@@ -4445,7 +4440,6 @@
  {
      afs_int32 vcode;
      afs_int32 i, j;
-    struct VLCallBack unused;
      afs_int32 *addrp;
      bulkaddrs m_addrs;
      ListAddrByAttributes m_attrs;
@@ -4530,14 +4524,12 @@
       register struct cmd_syndesc *as;
  {
      afs_int32 vcode;
-    afs_int32 i, j, noresolve = 0, printuuid = 0;
-    struct VLCallBack unused;
-    afs_int32 nentries, *addrp;
-    bulkaddrs addrs, m_addrs;
+    afs_int32 i, noresolve = 0, printuuid = 0;
+    afs_int32 nentries;
+    bulkaddrs m_addrs;
      ListAddrByAttributes m_attrs;
      afsUUID m_uuid, askuuid;
-    afs_int32 m_unique, m_nentries, *m_addrp;
-    afs_int32 base, index;
+    afs_int32 m_unique, m_nentries;

      memset(&m_attrs, 0, sizeof(struct ListAddrByAttributes));
      m_attrs.Mask = VLADDR_INDEX;
--- ./src/volser/vsprocs.c.~2~	2003-11-13 17:58:15.000000000 -0500
+++ ./src/volser/vsprocs.c	2003-11-14 11:37:11.000000000 -0500
@@ -1977,10 +1977,8 @@
      struct destServer destination;

      struct nvldbentry entry, newentry, storeEntry;
-    int i, islocked, pntg;
+    int islocked, pntg;
      afs_int32 error;
-    char in, lf;		/* for test code */
-    int same;
      int justclone = 0;

      islocked = 0;
-- 
Joe Buehler