misc-build-cleanup-20010917
authorWalter Wong <wcw@cmu.edu>
Mon, 17 Sep 2001 22:37:21 +0000 (22:37 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 17 Sep 2001 22:37:21 +0000 (22:37 +0000)
1) Removal of unused variables
2) some NT ifdef cleanup
3) use of size_t rather than int to store the result of strlen()
4) some bugs that really only occured when errors occured.
5) some functions were implicitly declared as 'int' but doing a
   "return;" Some I declared as 'void' and prototyped them; some I
   just returned a value.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

put symbol in an ifndef for winnt

====================

change erroneous void to int

====================

technically the cmdprocs return int

====================

update function to be void

52 files changed:
src/WINNT/afsd/cm_config.c
src/auth/authcon.c
src/auth/cellconfig.c
src/auth/userok.c
src/bozo/bos.c
src/bozo/bosoprocs.c
src/bozo/bosserver.c
src/bozo/cronbnodeops.c
src/bozo/fsbnodeops.c
src/cmd/cmd.c
src/dir/buffer.c
src/dir/salvage.c
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/kaauxdb.c
src/kauth/kaprocs.c
src/kauth/krb_udp.c
src/kauth/rebuild.c
src/kauth/token.c
src/libacl/aclprocs.c
src/ptserver/db_verify.c
src/ptserver/display.c
src/ptserver/ptprocs.c
src/ptserver/ptserver.c
src/ptserver/readgroup.c
src/ptserver/utils.c
src/rx/rx_pthread.c
src/rxgen/rpc_main.c
src/rxgen/rpc_parse.c
src/rxkad/rxkad_server.c
src/sys/pioctl_nt.c
src/ubik/beacon.c
src/ubik/disk.c
src/ubik/lock.c
src/ubik/remote.c
src/ubik/vote.c
src/vlserver/vlclient.c
src/vlserver/vldb_check.c
src/vlserver/vlprocs.c
src/vlserver/vlutils.c
src/vol/clone.c
src/vol/partition.c
src/vol/vnode.c
src/vol/vol-salvage.c
src/vol/vutil.c
src/volser/common.c
src/volser/dumpstuff.c
src/volser/lockprocs.c
src/volser/volprocs.c
src/volser/vos.c
src/volser/vsprocs.c
src/volser/vsutils.c

index 2e1261b..a3ef82f 100644 (file)
@@ -113,8 +113,8 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
         int foundCell;
         long code;
        int tracking = 1, partial = 0;
-        long ip_addr;
 #if defined(DJGPP) || defined(AFS_WIN95_ENV)
+       long ip_addr;
         int c1, c2, c3, c4;
         char aname[256];
 #endif
index 2799139..f990f0c 100644 (file)
@@ -99,9 +99,7 @@ rxkad_level enclevel; {
     struct rx_securityClass *tclass;
     afs_int32 kvno;
     afs_int32 ticketLen;
-    struct timeval tv;
-    Key_schedule schedule;
-    register afs_int32 i, code;
+    register afs_int32 code;
     
     /* first, find the right key and kvno to use */
     code = afsconf_GetLatestKey(adir, &kvno, &key);
index 97e0b20..cd4c38d 100644 (file)
@@ -191,10 +191,15 @@ register struct afsconf_dir *adir; {
 static afsconf_Touch(adir)
 register struct afsconf_dir *adir; {
     char tbuffer[256];
+#ifndef AFS_NT40_ENV
     struct timeval tvp[2];
+#endif
+
+    adir->timeRead = 0;        /* just in case */
 
 #ifdef AFS_NT40_ENV
     /* NT client CellServDB has different file name than NT server or Unix */
+
     if (IsClientConfigDirectory(adir->name)) {
        strcompose(tbuffer, 256,
                   adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
@@ -202,14 +207,11 @@ register struct afsconf_dir *adir; {
        strcompose(tbuffer, 256,
                   adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
     }
-#else
-    strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
-#endif /* AFS_NT40_ENV */
 
-    adir->timeRead = 0;        /* just in case */
-#ifdef AFS_NT40_ENV
     return _utime(tbuffer, NULL);
+
 #else
+    strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL);
     gettimeofday(&tvp[0], NULL);
     tvp[1] = tvp[0];
     return utimes(tbuffer, tvp);
@@ -238,7 +240,7 @@ register char *adir; {
            /* The "AFSCONF" environment (or contents of "/.AFSCONF") will be typically set to something like "/afs/<cell>/common/etc" where, by convention, the default files for "ThisCell" and "CellServDB" will reside; note that a major drawback is that a given afs client on that cell may NOT contain the same contents... */
            char *home_dir;
            FILE *fp;
-           int len;
+           size_t len;
 
            if (!(home_dir = getenv("HOME"))) {
                /* Our last chance is the "/.AFSCONF" file */
@@ -557,7 +559,8 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
     struct afsconf_cell *acellInfo;
 {
     afs_int32 code;
-    int tservice, len, i;
+    int tservice, i;
+    size_t len;
     unsigned char answer[1024];
     unsigned char *p;
     char host[256];
@@ -654,7 +657,8 @@ struct afsconf_cell *acellInfo; {
     register afs_int32 i;
     int tservice;
     char *tcell;
-    int cnLen, ambig;
+    size_t cnLen;
+    int ambig;
     char tbuffer[64];
 
     LOCK_GLOBAL_MUTEX
index 7094daa..1ea0854 100644 (file)
@@ -231,7 +231,6 @@ register char *auser; {
     char tbuffer[256];
     register bufio_p bp;
     char tname[64];
-    register char *tp;
     register int flag;
     register afs_int32 code;
     int rc;
index ce0d0a3..e9bc640 100644 (file)
@@ -387,6 +387,7 @@ register struct cmd_syndesc *as; {
            printf("\n");
        }
     }
+    return 0;
 }
 
 static UnInstall(as)
index c3aa5d5..8e5f867 100644 (file)
@@ -147,7 +147,6 @@ BOZO_GetDates(acall, aname, atime, abakTime, aoldTime)
 struct rx_call *acall;
 char *aname;
 afs_int32 *atime, *abakTime, *aoldTime; {
-    register afs_int32 code;
     struct stat tstat;
     char *strp;
     char tbuffer[AFSDIR_PATH_MAX];
@@ -1191,6 +1190,7 @@ int initBosEntryStats()
   bozo_bosEntryStats[7].path = AFSDIR_SERVER_KEY_FILEPATH;
   bozo_bosEntryStats[8].path = AFSDIR_SERVER_ULIST_FILEPATH;
 
+  return 0;
 }
 /* StatEachEntry - If it's not there, it is okay.  If anything else goes wrong
  * complain.  Otherwise check permissions: shouldn't allow write or (usually)
index e6a9aea..59a1a19 100644 (file)
@@ -52,6 +52,9 @@ extern int BOZO_ExecuteRequest();
 extern int RXSTATS_ExecuteRequest();
 extern int afsconf_GetKey();
 extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops;
+
+void bozo_Log();
+
 struct afsconf_dir *bozo_confdir = 0;  /* bozo configuration dir */
 static char *bozo_pid;
 struct rx_securityClass *bozo_rxsc[3];
@@ -666,7 +669,6 @@ char **envp;
     int noAuth = 0;
     struct ktc_encryptionKey tkey;
     int i;
-    pid_t      newSessionID;
     char namebuf[AFSDIR_PATH_MAX];
 
 #ifdef AFS_AIX32_ENV
@@ -919,6 +921,7 @@ char **envp;
     rx_StartServer(1);     /* donate this process */
 }
 
+void
 bozo_Log(a,b,c,d,e,f)
 char *a, *b, *c, *d, *e, *f; {
     char tdate[26];
index b410c3e..c5f8c83 100644 (file)
@@ -120,6 +120,7 @@ register struct cronbnode *abnode; {
        if (temp < 1) temp = 1; /* temp is when to start dude */
        bnode_SetTimeout(abnode, temp);
     }
+    return 0;
 }
 
 static int cron_restartp (abnode)
index 26670d5..8df3178 100644 (file)
@@ -397,6 +397,7 @@ struct fsbnode *abnode; {
         }
     }
     SetNeedsClock(abnode);
+    return 0;
 }
 
 static int fs_getstat(abnode, astatus)
index 529a99f..906a348 100644 (file)
@@ -68,7 +68,7 @@ static int FindType(as, aname)
 register struct cmd_syndesc *as;
 register char *aname; {
     register int i;
-    int cmdlen;
+    size_t cmdlen;
     int ambig;
     int best;
 
@@ -95,7 +95,7 @@ int *aambig;
 char *aname; {
     register struct cmd_syndesc *ts;
     struct cmd_syndesc *best;
-    int cmdLen;
+    size_t cmdLen;
     int ambig;
 
     cmdLen = strlen(aname);
@@ -199,7 +199,7 @@ void PrintFlagHelp(as)
 register struct cmd_syndesc *as; {
     register int i;
     register struct cmd_parmdesc *tp;
-    int flag_width;
+    size_t flag_width;
     char *flag_prefix;
 
     /* find flag name length */
index 5d00736..376ba81 100644 (file)
@@ -75,6 +75,7 @@ int DStat (abuffers, acalls, aios)
     {*abuffers = nbuffers;
     *acalls = calls;
     *aios = ios;
+    return 0;
     }
 
 int DInit (abuffers)
@@ -215,7 +216,7 @@ struct buffer *newslot (afid, apage, lp)
      register struct buffer *lp;   /* pointer to a fairly-old buffer */
     {/* Find a usable buffer slot */
     register afs_int32 i;
-    afs_int32 lt,pt;
+    afs_int32 lt;
     register struct buffer **tbp;
 
     if (lp && (lp->lockers == 0)) {
@@ -263,6 +264,7 @@ struct buffer *newslot (afid, apage, lp)
     return lp;
     }
 
+void
 DRelease (bp,flag)
     register struct buffer *bp;
     int flag;
index 83468d6..0c074dc 100644 (file)
@@ -393,7 +393,7 @@ int DirSalvage (fromFile, toFile, vn, vu, pvn, pvu)
     afs_int32 dot[3], dotdot[3], lfid[3], code, usedPages;
     char tname[256];
     register int i;
-    register char *tp, tc;
+    register char *tp;
     struct DirHeader *dhp;
     struct DirEntry *ep;
     int entry;
index 8675c8d..b250875 100644 (file)
@@ -1449,9 +1449,10 @@ static ForgetTicket (
   char *arock)
 {
     afs_int32 code;
-    struct ktc_principal server;
 
 #ifdef notdef
+    struct ktc_principal server;
+
     if (as->parms[0].items) {
        char *name = as->parms[0].items->data;
        code = ka_ParseLoginName
index e92abfb..704595a 100644 (file)
@@ -637,7 +637,6 @@ afs_int32 ka_GetToken (
     des_key_schedule schedule;
     int   version;
     afs_int32  pwexpires;
-    char bob[KA_TIMESTR_LEN];
 
     LOCK_GLOBAL_MUTEX
     aticket.SeqLen = auth_token->ticketLen;
index dc39366..d1275e3 100644 (file)
@@ -165,7 +165,6 @@ int kaux_islocked(
     unsigned int nfailures, myshare;
     afs_uint32 lasttime;
     struct ubik_debug beaconinfo;
-    afs_uint32 now;
 
     /* if attempts is 0, that means there's no limit, so the id
     * can't ever be locked...
index e17f317..0279fc5 100644 (file)
@@ -707,7 +707,6 @@ impose_reuse_limits ( password, tentry )
   int code;
   Date now;
   int i;
-  int reuse_p;
   extern int MinHours;
   afs_uint32 newsum;
 
@@ -1277,8 +1276,7 @@ afs_int32 kamSetFields (call, aname, ainstance, aflags,
     afs_int32  caller;
     afs_int32  tentry_offset;          /* offset of entry */
     struct kaentry tentry;
-    unsigned char newvals[4], oldvals[4];
-    int i;
+    unsigned char newvals[4];
 
     COUNT_REQ (SetFields);
 
@@ -1953,13 +1951,16 @@ afs_int32 kamGetPassword (call, name, password)
   struct rx_call *call;
   char          *name;
   EncryptionKey  *password;
-{   int  code = KANOAUTH;
+{   
+  int  code = KANOAUTH;
+  COUNT_REQ (GetPassword);
+  
+#ifdef GETPASSWORD
+  {
     afs_int32 to;
     struct ubik_trans *tt;
     struct kaentry tentry;
 
-    COUNT_REQ (GetPassword);
-#ifdef GETPASSWORD
     if (!name_instance_legal (name, "")) return KABADNAME;
     /* only requests from this host work */
     if (rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))) != htonl(INADDR_LOOPBACK))
@@ -1968,9 +1969,12 @@ afs_int32 kamGetPassword (call, name, password)
 
     /* this isn't likely to be used because of string to key problems, so since
        this is a temporary thing anyway, we'll use it here. */
-    {   extern char udpAuthPrincipal[256];
+    {   
+      extern char udpAuthPrincipal[256];
+
        save_principal (udpAuthPrincipal, name, 0, 0);
     }
+
     get_time (0,0,0);                  /* update random value */
     code = FindBlock(tt, name, "", &to, &tentry);
     if (code) goto abort;
@@ -1984,6 +1988,7 @@ afs_int32 kamGetPassword (call, name, password)
 
     memcpy(password, &tentry.key, sizeof (*password));
     code = ubik_EndTrans (tt);
+  }
 #endif
     return code;
 }
index 2d13747..816ebd4 100644 (file)
@@ -100,7 +100,6 @@ int fiveminutes=300;
 
 static FiveMinuteCheckLWP()
 {
-       struct timeval time;
 
        printf("start 5 min check lwp\n");
 
@@ -554,7 +553,7 @@ fail:
     return code;
 }
  
-static err_packet (ksoc, pkt, code, reason)
+static int err_packet (ksoc, pkt, code, reason)
   int ksoc;
   struct packet *pkt;
   afs_int32  code;
@@ -576,7 +575,7 @@ static err_packet (ksoc, pkt, code, reason)
        3/* nulls */ + (2 * sizeof(afs_int32)) + strlen (buf) + 1;
     if (ans.len > sizeof(ans.data)) {
        printf ("Answer packet too long\n");
-       return;
+       return -1;
     }
 
     *answer++ = (unsigned char) KRB_PROT_VERSION;
@@ -601,8 +600,10 @@ static err_packet (ksoc, pkt, code, reason)
                    code, ans.len);
        else perror ("err_packet: sendto");
     }
+    return 0;
 }
 
+int
 process_udp_auth (ksoc, pkt)
   int ksoc;
   struct packet *pkt;
@@ -632,7 +633,7 @@ process_udp_auth (ksoc, pkt)
     if ((strlen(realm) > 0) && (strcmp (realm, lrealm) != 0)) {
        err_packet (ksoc, pkt, KERB_ERR_NONNULL_REALM,
                    "null realm name not allowed");
-       return;
+       return -1;
     }
     memcpy(&startTime, packet, sizeof(startTime));
     packet += sizeof(startTime);
@@ -644,13 +645,13 @@ process_udp_auth (ksoc, pkt)
     if (code < 0) {
        err_packet (ksoc, pkt, KERB_ERR_BAD_LIFETIME,
                    "requested ticket lifetime invalid");
-       return;
+       return -1;
     }
     getstr (sname);
     getstr (sinst);
     if ((packet - pkt->data) != pkt->len) {
        err_packet (ksoc, pkt, KERB_ERR_PKT_LENGTH, "packet length inconsistent");
-       return;
+       return -1;
     }
     pkt->rest = packet;
     code = UDP_Authenticate (ksoc, &pkt->from, name, inst,
@@ -665,9 +666,10 @@ process_udp_auth (ksoc, pkt)
        } else 
            err_packet (ksoc, pkt, code, (char *)error_message (code));
     }
-    return;
+    return 0;
 }
 
+int
 process_udp_appl (ksoc, pkt)
   int ksoc;
   struct packet *pkt;
@@ -689,13 +691,13 @@ process_udp_appl (ksoc, pkt)
     authLen = *(unsigned char *)packet++;
     if (ticketLen > sizeof(ticket)) {
        err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "ticket too long");
-       return;
+       return -1;
     }
     memcpy(ticket, packet, ticketLen);
     packet += ticketLen;
     if (authLen > sizeof(auth)) {
        err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "authenticator too long");
-       return;
+       return -1;
     }
     memcpy(auth, packet, authLen);
     pkt->rest = packet + authLen;
@@ -703,10 +705,12 @@ process_udp_appl (ksoc, pkt)
     if (code) {
        if (code == KANOENT) code = KERB_ERR_PRINCIPAL_UNKNOWN;
        err_packet (ksoc, pkt, code, (char*)error_message (code));
-       return;
+       return -1;
     }
+    return 0;
 }
 
+void
 process_udp_request (ksoc, pkt)
   int ksoc;
   struct packet *pkt;
index 38432c5..e25f2a6 100644 (file)
@@ -41,6 +41,8 @@ char *whoami = "kadb_check";
 int fd;
 FILE *out;
 
+void badEntry();
+
 int listuheader, listkheader, listentries, verbose;
 
 int readUbikHeader()
@@ -82,6 +84,7 @@ int readUbikHeader()
   return(0);
 }
 
+void
 PrintHeader(header)
   struct kaheader *header;
 {
@@ -100,6 +103,7 @@ PrintHeader(header)
   printf("stats.cpw commands     = %d\n", header->stats.cpws);
 }
 
+void
 PrintEntry(index, entry)
   afs_int32 index;
   struct kaentry *entry;
@@ -221,6 +225,7 @@ char *EntryName(entryp)
   return(principal);
 }
 
+void
 RebuildEntry(entryp)
   struct kaentry *entryp;
 {
@@ -365,7 +370,6 @@ WorkerBee (as, arock)
   char *arock;
 {
     afs_int32 code;
-    int a;
     char *dbFile;
     char *outFile;
     afs_int32 index;
@@ -556,6 +560,7 @@ WorkerBee (as, arock)
     exit (code != 0);
 }
 
+void
 badEntry(e, i)
   afs_int32 e, i;
 {
@@ -585,7 +590,6 @@ main (argc, argv)
   char *argv[];
 {
   struct cmd_syndesc *ts;
-  struct cmd_item    *ti;
 
   setlinebuf(stdout);
 
index 07fb001..0de5a10 100644 (file)
@@ -320,8 +320,6 @@ afs_int32 ka_VerifyUserToken(
     afs_int32          now = time(0);
     struct ktc_token   token;
     char               cellname[MAXKTCREALMLEN];
-    char               realm[MAXKTCREALMLEN];
-    struct ktc_principal client, server;
     afs_int32 pwexpires;
 
     LOCK_GLOBAL_MUTEX
index 0551480..cb955ea 100644 (file)
@@ -222,7 +222,6 @@ struct acl_accessList **acl;
     register char *nextc;
     register afs_int32 code;
     int p,n;
-    char tbuf[PR_MAXNAMELEN+1];
     namelist lnames;
     idlist lids;
 
@@ -377,6 +376,7 @@ char *version;
 #ifdef AFS_PTHREAD_ENV
     assert(pthread_mutex_init(&acl_list_mutex, NULL) == 0);
 #endif /* AFS_PTHREAD_ENV */
+    return 0;
 }
 
 int acl_IsAMember(aid,cps)
index 5af62db..666df82 100644 (file)
@@ -222,7 +222,6 @@ int PrintEntryError (misc, ea, e, indent)
   struct prentry *e;
   int indent;
 {
-    int i;
 
     pr_PrintEntry (stderr, /*net order*/0, ea, e, indent);
     return 0;
@@ -1045,9 +1044,6 @@ WorkerBee (as, arock)
     char *recreateFile;
     struct misc_data misc;             /* info & statistics */
 
-    int   a;
-    char  arg[100];
-
     initialize_pt_error_table();
     initialize_u_error_table();
     
@@ -1099,7 +1095,6 @@ main (argc, argv)
   char *argv[];
 {
   struct cmd_syndesc *ts;
-  struct cmd_item    *ti;
 
   setlinebuf(stdout);
 
index 45e8287..2806331 100644 (file)
@@ -32,7 +32,6 @@ static char *pr_TimeToString (time_t clock)
 {   struct tm *tm;
     static char buffer[32];
     static int this_year = 0;
-    char year[6];
 
     if (clock == 0) return "time-not-set  ";
     if (!this_year) {
index ae5bdc7..ac984c8 100644 (file)
@@ -1194,7 +1194,7 @@ afs_int32 listEntries(call, flag, startindex, bulkentries, nextstartindex)
   afs_int32 code;
   struct ubik_trans *tt;
   afs_int32 cid;
-  afs_int32 temp, i, eof, pos, maxentries, f;
+  afs_int32 i, eof, pos, maxentries, f;
   struct prentry tentry;
   afs_int32 pollcount=0;
 
index bbf5785..b05ff9a 100644 (file)
@@ -81,7 +81,6 @@ void main (argc, argv)
 #endif
     struct afsconf_cell info;
     int kerberosKeys;                  /* set if found some keys */
-    afs_int32 i,j;
     int lwps = 3;
     char clones[MAXHOSTSPERCELL];
 
@@ -157,8 +156,6 @@ void main (argc, argv)
        }
 #endif
        else if (*arg == '-') {
-         usage:
-
                /* hack in help flag support */
 
 #ifndef AFS_NT40_ENV
index 92bf208..4129c87 100644 (file)
@@ -27,7 +27,9 @@ RCSID("$Header$");
 #include "pterror.h"
 
 int verbose = 0;
+void skip();
 
+void
 report_error (code, name, gname)
   afs_int32 code;
   char *name;
@@ -66,7 +68,6 @@ char **argv;
     char buf[3000];
     FILE *fp;
     char *ptr;
-    char *aptr;
     char *tmp;
     char *cellname;
     namelist lnames;
@@ -195,6 +196,7 @@ char **argv;
     }
 }
 
+void
 skip(s)
 char **s;
 {
index 1be4793..50464d8 100644 (file)
@@ -402,7 +402,6 @@ register struct ubik_trans *at;
 char aname[PR_MAXNAMELEN];
 afs_int32 *aid;
 {
-    register afs_int32 code;
     afs_int32 temp;
     struct prentry tentry;
 
index 6042ec6..a2b7297 100644 (file)
@@ -207,12 +207,6 @@ struct rx_call **newcallp;
     u_long host;
     u_short port;
     register struct rx_packet *p = (struct rx_packet *)0;
-    unsigned long rfds;
-    register unsigned long rrfds;
-    struct clock cv;
-    long nextPollTime;         /* time to next poll FD before sleeping */
-    int lastPollWorked, doingPoll;     /* true iff last poll was useful */
-    struct timeval tv, *tvp;
 
     assert(pthread_mutex_lock(&listener_mutex)==0);
     while (!listeners_started) {
@@ -378,6 +372,7 @@ rxi_Listen(sock)
        exit(1);
     }
     AFS_SIGSET_RESTORE();
+    return 0;
 }
 
 
@@ -415,4 +410,5 @@ rxi_Sendmsg(socket, msg_p, flags)
        printf("rxi_sendmsg failed, error %d\n", errno);
        fflush(stdout);
     }
+    return 0;
 }
index 4cede5c..0b003b8 100644 (file)
@@ -334,9 +334,7 @@ open_input(infile, define)
        char *infile;
        char *define;
 {
-        char *exec_args[MAXCPPARGS+10];
        int nargs = 0;
-       char **args;
        char cpp_cmdline[MAXCMDLINE];
 
        int i;
index b072ab1..7b1d8e4 100644 (file)
@@ -1451,11 +1451,6 @@ ss_ProcProto_setup(defp, somefrees)
 definition *defp;
 int *somefrees;
 {
-    proc1_list *plist, *plist1;
-    list *listp;
-    definition *defp1;
-    int preserve_flag = 0;
-
        f_print(fout, "#ifndef KERNEL\n");
        f_print(fout, "\tafs_int32 %s%s%s%s();\n", prefix, ServerPrefix, 
                PackagePrefix[PackageIndex], defp->pc.proc_name);
index d3908d1..84b949b 100644 (file)
@@ -180,7 +180,6 @@ rxs_return_t rxkad_GetChallenge (aobj, aconn, apacket)
   IN struct rx_packet *apacket;
   IN struct rx_connection *aconn;
 {   struct rxkad_sconn *sconn;
-    afs_int32 temp;
     char *challenge;
     int challengeSize;
     struct rxkad_v2Challenge  c_v2;   /* version 2 */
index 366fd96..0794d3c 100644 (file)
@@ -87,7 +87,6 @@ static long GetIoctlHandle(char *fileNamep, HANDLE *handlep)
        HKEY parmKey;
        DWORD dummyLen;
        long code;
-        int hostsize;
 
         if (fileNamep) {
              drivep = strchr(fileNamep, ':');
@@ -116,11 +115,14 @@ nogateway:
 #ifndef AFS_WIN95_ENV
                gethostname(hostName, sizeof(hostName));
 #else
+               {
+                 int hostsize;
                 /* DJGPP version of gethostname gets the NetBIOS
                    name of the machine, so that is what we are using for
                    the AFS server name instead of the DNS name. */
                 hostsize = sizeof(hostName);
                 GetComputerName(hostName, &hostsize);
+               }
 #endif /* AFS_WIN95_ENV */
 
 havehost:
index ed18876..3fc756c 100644 (file)
@@ -447,7 +447,7 @@ static verifyInterfaceAddress(ame, info, aservers)
     afs_uint32 aservers[];     /* list of all possible server addresses */
 {
     afs_uint32 myAddr[UBIK_MAX_INTERFACE_ADDR], *servList, tmpAddr;
-    int        count, index, found, i, j, totalServers, start, end;
+    int        count, found, i, j, totalServers, start, end;
 
     if (info)
         totalServers = info->numServers;
@@ -574,7 +574,7 @@ int
 updateUbikNetworkAddress(ubik_host)
 afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR];
 {
-    int                        j, count, found, index, code = 0;
+    int                        j, count, code = 0;
     UbikInterfaceAddr   inAddr, outAddr;
     struct rx_connection *conns[MAXSERVERS];
     struct ubik_server         *ts, *server[MAXSERVERS];
index e35dce4..bf9785b 100644 (file)
@@ -236,11 +236,11 @@ static int DInit (abuffers)
 }
 
 /* Take a buffer and mark it as the least recently used buffer */
-static int Dlru(abuf)
+static void Dlru(abuf)
   struct buffer *abuf;
 {
   if (LruBuffer == abuf)
-     return 0;
+     return;
 
   /* Unthread from where it is in the list */
   abuf->lru_next->lru_prev = abuf->lru_prev;
@@ -256,12 +256,12 @@ static int Dlru(abuf)
 }
 
 /* Take a buffer and mark it as the most recently used buffer */
-static int Dmru(abuf)
+static void Dmru(abuf)
      struct buffer *abuf;
 {
   if (LruBuffer == abuf) {
      LruBuffer = LruBuffer->lru_next;
-     return 0;
+     return;
   }
 
   /* Unthread from where it is in the list */
@@ -273,7 +273,6 @@ static int Dmru(abuf)
   abuf->lru_prev = LruBuffer->lru_prev;
   LruBuffer->lru_prev->lru_next = abuf;
   LruBuffer->lru_prev = abuf;
-
 }
 
 /* get a pointer to a particular buffer */
@@ -283,7 +282,7 @@ static char *DRead(dbase, fid, page)
     int page; {
     /* Read a page from the disk. */
     struct buffer *tb, *lastbuffer;
-    afs_int32 trys, code;
+    afs_int32 code;
 
     calls++;
     lastbuffer = LruBuffer->lru_prev;
@@ -469,7 +468,7 @@ static struct buffer *newslot (adbase, afid, apage)
 }
 
 /* Release a buffer, specifying whether or not the buffer has been modified by the locker. */
-static DRelease (ap,flag)
+static void DRelease (ap,flag)
     char *ap;
     int flag; {
     int index;
@@ -480,7 +479,7 @@ static DRelease (ap,flag)
     bp = &(Buffers[index]);
     bp->lockers--;
     if (flag) bp->dirty=1;
-    return 0;
+    return;
 }
 
 /* flush all modified buffers, leaves dirty bits set (they're cleared
index 2e5bd7c..e5d8a5b 100644 (file)
@@ -62,7 +62,6 @@ ulock_getLock(atrans, atype, await)
   struct ubik_trans *atrans;
   int               atype, await;
 {
-  struct ubik_trans *tt;
   struct ubik_dbase *dbase=atrans->dbase;
 
   /* On first pass, initialize the lock */
@@ -118,6 +117,7 @@ ulock_getLock(atrans, atype, await)
 }
 
 /* Release the transaction lock */
+int
 ulock_relLock(atrans)
   struct ubik_trans *atrans;
 {
index c09508d..6f0d943 100644 (file)
@@ -28,6 +28,7 @@ RCSID("$Header$");
 #include "ubik_int.h"
 int (*ubik_CheckRXSecurityProc)();
 char *ubik_CheckRXSecurityRock;
+void printServerInfo();
 
 /* routines for handling requests remotely-submitted by the sync site.  These are
     only write transactions (we don't propagate read trans), and there is at most one
@@ -453,7 +454,7 @@ SDISK_SendFile(rxcall, file, length, avers)
     register afs_int32 code;
     register struct ubik_dbase *dbase;
     char tbuffer[256];
-    afs_int32 offset, t;
+    afs_int32 offset;
     struct ubik_version tversion;
     register int tlen;
     struct rx_peer *tpeer;
@@ -614,6 +615,7 @@ UbikInterfaceAddr   *inAddr, *outAddr;
     return 0;
 }
 
+void
 printServerInfo()
 {
     struct ubik_server *ts;
index abe9e8f..1a94ae3 100644 (file)
@@ -430,7 +430,7 @@ SVOTE_SDebugOld(rxcall, awhich, aparm)
     afs_int32 awhich;
     register struct ubik_sdebug_old *aparm; {
     register struct ubik_server *ts;
-    register int i;
+
     for(ts=ubik_servers; ts; ts=ts->next) {
        if (awhich-- == 0) {
            /* we're done */
@@ -453,7 +453,7 @@ SVOTE_SDebugOld(rxcall, awhich, aparm)
 SVOTE_DebugOld(rxcall, aparm)
     struct rx_call *rxcall;
     register struct ubik_debug_old *aparm; {
-    int  i;
+
     /* fill in the basic debug structure.  Note the the RPC protocol transfers,
      * integers in host order. */
     
index cdd049f..3046244 100644 (file)
@@ -51,6 +51,16 @@ RCSID("$Header$");
 #include "vlserver.h"
 #include "vlclient.h"
 
+void fill_listattributes_entry();
+void display_listattributes_entry();
+void display_entry();
+void display_entryN();
+void display_update_entry();
+void dump_stats();
+void GetArgs();
+void print_usage();
+void fill_entry();
+void fill_update_entry();
 
 extern int VL_GetAddrsU(), VL_RegisterAddrs();
 #define        VL_NUMBER_OPCODESX      34
@@ -253,7 +263,7 @@ static handleit(as)
 {
     register struct cmd_item *ti;
     register afs_int32 code, server = 0, sawserver=0;
-    afs_int32 i, id, voltype;
+    afs_int32 id, voltype;
     struct vldbentry entry;    
     char *cmd = 0, *cellp=0;
     struct VldbUpdateEntry updateentry;
@@ -395,7 +405,6 @@ static handleit(as)
            } else if (!strcmp(oper,"checkhash")) {
                 int index, count, num=0, num1=0, num2 = 0, num3=0, num31=0, num4=0, num41=0, next_index;
                 struct vldbentry tentry;    
-                struct Vlent *vl1;    
 
                 VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent));
                 if (VL == NULL) {
@@ -448,7 +457,6 @@ static handleit(as)
            } else if (!strcmp(oper,"fixhash")) {
                 int index, count, num=0, num1=0, num2 = 0, next_index, x=0;
                 struct vldbentry tentry;    
-                struct Vlent *vl1;    
 
                 VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent));
                 if (VL == NULL) {
@@ -700,7 +708,6 @@ static handleit(as)
                int nentries, i;
                afs_uint32 *addrp;
                bulkaddrs addrs;
-               struct vldbentry *entry;
                struct VLCallBack vlcb;
 
                addrs.bulkaddrs_val = 0;
@@ -775,7 +782,6 @@ static handleit(as)
               int nentries1, nentries2, i, j, x, y, unique, found;
               afs_uint32 *addrp1, *addrp2;
               bulkaddrs addrs1, addrs2;
-              struct vldbentry *entry;
               struct VLCallBack vlcb;
               ListAddrByAttributes attrs;
               afsUUID uuid;
@@ -870,7 +876,6 @@ static handleit(as)
                int i;
                afs_uint32 *addrp, tad;
                bulkaddrs addrs;
-               struct vldbentry *entry;
                afsUUID uuid;
 
                memset(&uuid, 0, sizeof(uuid));
@@ -899,7 +904,6 @@ static handleit(as)
               extern struct hostent *hostutil_GetHostByName();
               struct hostent *h1, *h2;
               afs_uint32 a1, a2;
-              unsigned char n1[80], n2[80];
 
               printf("changing %s", *argp);
               h1 = hostutil_GetHostByName(&(*argp)[0]);
@@ -926,7 +930,6 @@ static handleit(as)
               }
             } else if (!strcmp(oper,"caid")) {
               afs_uint32 a1, a2;
-              unsigned char n1[80], n2[80];
 
               sscanf(&(*argp)[0], "%d", &a1);
               printf("changing %d (0x%x)", a1, a1);
@@ -972,6 +975,7 @@ main(argc, argv)
 }
 
 
+void
 fill_entry(entry, argp, nargs)
 struct vldbentry *entry;
 char **argp;
@@ -1008,7 +1012,7 @@ int nargs;
     sscanf(&(*argp)[0], "%d", &entry->cloneId);
 }
 
-
+void
 fill_update_entry(entry, argp, nargs)
 struct VldbUpdateEntry *entry;
 char **argp;
@@ -1076,7 +1080,7 @@ int nargs;
     }
  }
 
-
+void
 fill_listattributes_entry(entry, argp, nargs)
     struct VldbListByAttributes *entry;
     char **argp;
@@ -1109,6 +1113,7 @@ fill_listattributes_entry(entry, argp, nargs)
        entry->Mask |= VLLIST_FLAG;
  }
 
+void
 display_listattributes_entry(entry, error)
 struct VldbListByAttributes *entry;
 int                        error;
@@ -1130,6 +1135,7 @@ int                           error;
 
 #define        volumetype_string(type) (type == RWVOL? "read/write":type == ROVOL? "readonly":type == BACKVOL? "backup":"unknown")
 
+void
 display_entry(entry, error)
 struct vldbentry    *entry;
 int                error;
@@ -1145,6 +1151,7 @@ int                   error;
        printf("%12u\t%10d\t%10x\n", entry->serverNumber[i], entry->serverPartition[i], entry->serverFlags[i]);
 }
 
+void
 display_entryN(entry, error)
     struct nvldbentry *entry;
     int                      error;
@@ -1172,7 +1179,7 @@ display_entryN(entry, error)
      }
 }
 
-
+void
 display_update_entry(entry, error)
 struct VldbUpdateEntry *entry;
 int                    error;
@@ -1212,6 +1219,7 @@ int                       error;
     }
 }
 
+void
 dump_stats(stats, vital_header)
 vldstats       *stats;
 vital_vlheader *vital_header;
@@ -1230,6 +1238,7 @@ vital_vlheader    *vital_header;
        printf("total %s entries=%d\n", volumetype_string(i), ntohl(vital_header->totalEntries[i]));
 }
 
+void
 GetArgs(line,args, nargs)
     register char *line;
     register char **args;
@@ -1250,6 +1259,7 @@ GetArgs(line,args, nargs)
     }
 }
 
+void
 print_usage()
 {
     printf("Valid Commands:\n");
index 4cb26d5..f87d019 100644 (file)
@@ -135,7 +135,6 @@ afs_int32 NameHash(volname)
    char *volname;
 {
    unsigned int hash;
-   int i;
    char *vchar;
 
    hash = 0;
@@ -155,7 +154,7 @@ int InvalidVolname(volname)
   char *volname;
 {
   char *map;
-  int slen;
+  size_t slen;
 
   map = LEGALCHARS;
   slen = strlen(volname);
@@ -310,6 +309,7 @@ readentry(addr, vlentryp, type)
   }
 }
 
+void
 readSIT(base, addr)
   int base;
   int addr;
@@ -366,6 +366,7 @@ readSIT(base, addr)
  * Record what type of entry it is and its address in the record array.
  * Remember what the maximum volume id we found is and check against the header.
  */
+void
 ReadAllEntries(header)
   struct vlheader *header;
 {
@@ -572,10 +573,10 @@ FollowIdHash(header)
 FollowFreeChain(header)
   struct vlheader *header;
 {
-  int count=0;
+  afs_int32 count=0;
   struct nvlentry vlentry;
   afs_uint32 addr;
-  afs_int32 i, type, rindex;
+  afs_int32 type, rindex;
 
   /* Now follow the Free Chain */
   if (verbose)
@@ -584,7 +585,7 @@ FollowFreeChain(header)
      readentry(addr, &vlentry, &type);
      if (type != FR) {
         printf("Free Chain %d: Bad entry at %u: Not a valid free vlentry (0x%x)\n",
-              i, addr, type);
+              count, addr, type);
        continue;
      }
 
@@ -625,8 +626,6 @@ CheckIpAddrs(header)
   struct vlheader *header;
 {
   int mhblocks=0;
-  struct nvlentry vlentry;
-  afs_uint32 addr;
   afs_int32 i, j, m, rindex;
   afs_int32 mhentries, regentries;
   afs_int32 caddrs[VL_MAX_ADDREXTBLKS];
@@ -676,7 +675,7 @@ CheckIpAddrs(header)
                  record[rindex].addr, caddrs[i], rindex);
        }
        if (record[rindex].type & FRC) {
-          printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, addr);
+          printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, record[rindex].addr);
           break;
        }
        record[rindex].type |= MHC;
@@ -794,6 +793,7 @@ CheckIpAddrs(header)
 
 }
 
+int
 WorkerBee(as, arock)
   struct cmd_syndesc *as;
   char *arock;
@@ -921,7 +921,6 @@ main(argc, argv)
   char **argv;
 {
   struct cmd_syndesc *ts;
-  struct cmd_item    *ti;
 
   setlinebuf(stdout);
 
index 730cff5..da59961 100644 (file)
@@ -298,8 +298,7 @@ VL_ChangeAddr(rxcall, ip1, ip2)
   struct rx_call       *rxcall;
   afs_int32 ip1, ip2;
 {   struct ubik_trans  *trans;
-    afs_int32          errorcode, blockindex;
-    struct nvlentry    tentry;
+    afs_int32          errorcode;
 
     COUNT_REQ (VLCHANGEADDR);
     if (!afsconf_SuperUser(vldb_confdir, rxcall, (char *)0)) {
@@ -1040,8 +1039,7 @@ bulkentries                   *vldbentries;
     VldbentryLast = VldbentryFirst + allocCount;
     /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
     if (attributes->Mask & VLLIST_VOLUMEID) {
-       afs_int32       blockindex, chain;
-       struct nvlentry tempentry;
+       afs_int32       blockindex;
 
        blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
        if (blockindex == 0) {
@@ -1148,8 +1146,7 @@ nbulkentries                  *vldbentries;
     VldbentryLast = VldbentryFirst + allocCount;
     /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
     if (attributes->Mask & VLLIST_VOLUMEID) {
-       afs_int32       blockindex, chain;
-       struct nvlentry tempentry;
+       afs_int32       blockindex;
 
        blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
        if (blockindex == 0) {
@@ -1247,7 +1244,7 @@ VL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries,
   int                  errorcode=0, maxCount=VLDBALLOCCOUNT;
   struct ubik_trans    *trans;
   struct nvlentry      tentry;
-  struct nvldbentry    *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0, tVldbentry;
+  struct nvldbentry    *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0;
   afs_int32                    blockindex=0, count=0, k, match, matchindex;
   int                   serverindex=-1; /* no server found */
   int                   findserver=0, findpartition=0, findflag=0, findname=0;
@@ -1760,11 +1757,11 @@ VL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
 {
   afs_int32 code;
   struct ubik_trans *trans;
-  int cnt, h, i, j, k, m, hostslot, base, index;
+  int cnt, h, i, j, k, m, base, index;
   struct extentaddr *exp = 0, *tex;
   afsUUID tuuid;
   afs_uint32 addrs[VL_MAXIPADDRS_PERMH];
-  afs_int32 fbase, findex;
+  afs_int32 fbase;
   int count, willChangeEntry, foundUuidEntry, willReplaceCnt;
   int WillReplaceEntry, WillChange[MAXSERVERID+1], FoundUuid, ReplaceEntry;
   int srvidx, mhidx;
@@ -2102,9 +2099,9 @@ struct ListAddrByAttributes *attributes;
 afsUUID *uuidpo;
 afs_int32  *uniquifier, *nentries;
 bulkaddrs                  *addrsp;
-{   register afs_int32   errorcode, index=-1, op, offset;
+{   register afs_int32   errorcode, index=-1, offset;
     struct ubik_trans  *trans;
-    int nservers, i, j, k, base=0;
+    int nservers, i, j, base=0;
     struct extentaddr *exp=0;
     afsUUID tuuid;
     afs_uint32 *taddrp, taddr;
@@ -2794,7 +2791,7 @@ register afs_uint32       ipaddr1, ipaddr2;
     int base, index, mhidx;
     afsUUID tuuid;
     afs_int32 blockindex, count;
-    int   pollcount;
+    int   pollcount = 0;
     struct nvlentry tentry;
 
     if (!atrans)
index 2dda162..42bdea7 100644 (file)
@@ -89,7 +89,7 @@ struct ubik_trans   *trans;
 afs_int32                  offset;
 char               *buffer;
 afs_int32                  length; {
-    struct vlentry oentry, *oep;
+    struct vlentry oentry;
     struct nvlentry nentry, *nep;
     char *bufp;
     register afs_int32 i;
@@ -138,7 +138,7 @@ struct ubik_trans   *trans;
 afs_int32                  offset;
 char               *buffer;
 afs_int32                  length; {
-    struct vlentry *oep, *obufp, tentry;
+    struct vlentry *oep, tentry;
     struct nvlentry *nep, *nbufp;
     char *bufp = (char *)&tentry;
     register afs_int32 i;
@@ -475,7 +475,6 @@ afs_int32 FindExtentBlock(trans, uuidp, createit, hostslot, expp, basep)
                    *expp = exp;
                    *basep = base;
                    if (vldbversion != VLDBVERSION_4) {
-                       vldbversion != VLDBVERSION_4;
                        cheader.vital_header.vldbversion = htonl(VLDBVERSION_4);
                        code = write_vital_vlheader(trans);
                        if (code) ERROR_EXIT(VL_IO);
@@ -628,6 +627,7 @@ int             hashindex;
        VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0],
              tentry.nextIdHash[0], tentry.nextNameHash, tentry.name));
     }
+    return 0;
 }
 
 
@@ -645,6 +645,7 @@ int             hashindex;
        VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0],
              tentry.nextIdHash[0],  tentry.nextNameHash, tentry.name));
     }
+    return 0;
 }
 
 
index 3645353..1294a1a 100644 (file)
@@ -76,6 +76,9 @@ struct clone_head {
     struct clone_items *last;
 };
 
+void CloneVolume();
+void CloneVolume_r();
+
 static ci_AddItem(ah, aino)
 Inode aino;
 struct clone_head *ah; {
@@ -349,6 +352,7 @@ afs_int32 DoCloneIndex(rwvp, clvp, class, reclone)
    return error;
 }
 
+void
 CloneVolume(error, original, new, old)
     Error *error;
     Volume *original, *new, *old;
@@ -358,6 +362,7 @@ CloneVolume(error, original, new, old)
     VOL_UNLOCK
 }
 
+void
 CloneVolume_r(rerror, original, new, old)
     Error *rerror;
     Volume *original, *new, *old;
index fc8703a..2717722 100644 (file)
@@ -803,7 +803,6 @@ void VResetDiskUsage(void)
 
 void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBlocks)
 {
-    afs_int32 rem, minavail;
     *ec = 0;
     /* why blocks instead of checkBlocks in the check below?  Otherwise, any check
        for less than BlocksSpare would skip the error-checking path, and we
@@ -811,6 +810,8 @@ void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 check
        blocks. */
     if (blocks > 0) {
 #ifdef AFS_AIX32_ENV
+        afs_int32 rem, minavail;
+
        if ((rem = vp->partition->free - checkBlocks) < 
            (minavail = (vp->partition->totalUsable * aixlow_water) / 100))
 #else
@@ -833,9 +834,10 @@ void VAdjustDiskUsage(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBl
 
 int VDiskUsage_r(Volume *vp, afs_int32 blocks)
 {
-    afs_int32 rem, minavail;
     if (blocks > 0) {
 #ifdef AFS_AIX32_ENV
+        afs_int32 rem, minavail;
+
        if ((rem = vp->partition->free - blocks) < 
            (minavail = (vp->partition->totalUsable * aixlow_water) / 100))
 #else
index 4ab8859..bad05c4 100644 (file)
@@ -60,6 +60,8 @@ RCSID("$Header$");
 struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES];
 
 private int moveHash();
+void StickOnLruChain_r();
+void VPutVnode_r();
 
 #define BAD_IGET       -1000
 
@@ -183,7 +185,7 @@ VInitVnodes(class,nVnodes)
     }
 
     if (nVnodes == 0)
-           return;
+           return 0;
 
     va = (byte *) calloc(nVnodes,vcp->residentSize);
     assert (va != NULL);
@@ -214,6 +216,7 @@ VInitVnodes(class,nVnodes)
        }
        va += vcp->residentSize;
     }
+    return 0;
 }
 
 
@@ -360,7 +363,7 @@ Vnode *VAllocVnode_r(ec,vp,type)
        LWP_CurrentProcess(&vnp->writer);
 #endif /* AFS_PTHREAD_ENV */
        /* Sanity check:  is this vnode really not in use? */
-        { int n;
+        { 
          int size;
          IHandle_t *ihP = vp->vnodeIndex[class].handle;
          FdHandle_t *fdP;
@@ -653,7 +656,7 @@ Vnode *VGetVnode_r(ec,vp,vnodeNumber,locktype)
 int  TrustVnodeCacheEntry = 1;
 /* This variable is bogus--when it's set to 0, the hash chains fill
    up with multiple versions of the same vnode.  Should fix this!! */
-
+void
 VPutVnode(ec,vnp)
     Error *ec;
     register Vnode *vnp;
@@ -663,6 +666,7 @@ VPutVnode(ec,vnp)
     VOL_UNLOCK
 }
 
+void
 VPutVnode_r(ec,vnp)
     Error *ec;
     register Vnode *vnp;
@@ -911,8 +915,10 @@ static int moveHash(vnp, newHash)
     vnp->hashNext = VnodeHashTable[newHash];
     VnodeHashTable[newHash] = vnp;
     vnp->hashIndex = newHash;
+    return 0;
 }
 
+void
 StickOnLruChain_r(vnp,vcp)
     register Vnode *vnp;
     register struct VnodeClassInfo *vcp;
index 9d4ab5f..eed39e5 100644 (file)
@@ -1424,7 +1424,7 @@ int OnlyOneVolume(inodeinfo, singleVolumeNumber)
 int GetInodeSummary(char *path, VolumeId singleVolumeNumber)
 {
     struct stat status;
-    int summaryFd, forceSal, err;
+    int forceSal, err;
     struct ViceInodeInfo *ip;
     struct InodeSummary summary;
     char summaryFileName[50];
@@ -2920,7 +2920,6 @@ void DistilVnodeEssence(VolumeId rwVId, VnodeClass class, Inode ino,
     struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
     char buf[SIZEOF_LARGEDISKVNODE];
     struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
-    int code;
     int size;
     StreamHandle_t *file;
     int vnodeIndex;
@@ -3444,7 +3443,7 @@ int CopyInode(Device device, Inode inode1, Inode inode2, int rwvolume)
     char buf[4096];
     IHandle_t *srcH, *destH;
     FdHandle_t *srcFdP, *destFdP;
-    register int n;
+    register int n = 0;
 
     IH_INIT(srcH, device, rwvolume, inode1);
     srcFdP = IH_OPEN(srcH);
index b2fafa1..b4d5434 100644 (file)
@@ -64,6 +64,11 @@ RCSID("$Header$");
 #include <strings.h>
 #endif
 
+void AssignVolumeName();
+void AssignVolumeName_r();
+void ClearVolumeStats();
+void ClearVolumeStats_r();
+
 
 #define nFILES (sizeof (stuff)/sizeof(struct stuff))
 
@@ -110,19 +115,15 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId)
                           no parent */
 {
     VolumeDiskData vol;
-    int fd, fd1, i;
+    int fd, i;
     char headerName[32], volumePath[64];
-    struct stat status;
     Device device;
     struct DiskPartition *partition;
     struct VolumeDiskHeader diskHeader;
-    int code;
     IHandle_t *handle;
     FdHandle_t *fdP;
     Inode nearInode=0; 
 
-    
-
     *ec = 0;
     memset(&vol, 0, sizeof (vol));
     vol.id = volumeId;
@@ -279,6 +280,7 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId)
 }
 
 
+void
 AssignVolumeName(vol, name, ext)
     register VolumeDiskData *vol;
     char *name,*ext;
@@ -288,6 +290,7 @@ AssignVolumeName(vol, name, ext)
     VOL_UNLOCK
 }
 
+void
 AssignVolumeName_r(vol, name, ext)
     register VolumeDiskData *vol;
     char *name,*ext;
@@ -338,6 +341,7 @@ afs_int32 CopyVolumeHeader(from, to)
     return(code);
 }
 
+void
 ClearVolumeStats(vol)
     register VolumeDiskData *vol;
 {
@@ -346,6 +350,7 @@ ClearVolumeStats(vol)
     VOL_UNLOCK
 }
 
+void
 ClearVolumeStats_r(vol)
     register VolumeDiskData *vol;
 {
index f8d5ec6..9de0f30 100644 (file)
@@ -36,6 +36,7 @@ char *s;
     abort();
 }
 
+void
 InitErrTabs()
 {
     initialize_ka_error_table();
index 9714b7d..1d97559 100644 (file)
@@ -417,7 +417,7 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP)
 {
     int   code = 0, lcode = 0, error = 0;
     afs_int32 pad = 0, offset;
-    int   n, nbytes, howMany;
+    int   n, nbytes, howMany, howBig;
     byte  *p;
     struct stat status;
     int size;
@@ -427,9 +427,13 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP)
 #endif
 
 #ifdef AFS_NT40_ENV
-    howMany = 4096; /* Page size */
+    howBig = _filelength(handleP->fd_fd);
+    howMany = 4096;
+
 #else
     fstat(handleP->fd_fd, &status);
+    howBig = status.st_size;
+
 #ifdef AFS_AIX_ENV
     /* Unfortunately in AIX valuable fields such as st_blksize are 
      * gone from the stat structure.
@@ -438,9 +442,10 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP)
     howMany = tstatfs.f_bsize;
 #else
     howMany = status.st_blksize;
-#endif
+#endif /* AFS_AIX_ENV */
 #endif /* AFS_NT40_ENV */
 
+
     size = FDH_SIZE(handleP);
     code = DumpInt32(iodp, tag, size);
     if (code) {
@@ -490,7 +495,7 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP)
            */
           memset(p+n, 0, howMany-n);
           if (!pad)
-             offset = (status.st_size - nbytes) + n;
+             offset = (howBig - nbytes) + n;
           pad += (howMany-n);
           
           /* Now seek over the data we could not get. An error here means we
@@ -631,7 +636,6 @@ static int DumpVnodeIndex(register struct iod *iodp, Volume *vp,
     char buf[SIZEOF_LARGEDISKVNODE];
     struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
     StreamHandle_t *file;
-    IHandle_t *handle;
     FdHandle_t *fdP;
     int size;
     int flag;
index e4a372f..b52f3e8 100644 (file)
@@ -71,6 +71,7 @@ int FindIndex(entry, server, part, type)
 }
 
 /* Changes the rw site only */
+void
 SetAValue (entry, oserver, opart, nserver, npart, type)
      struct nvldbentry *entry;
      afs_int32             oserver, opart, nserver, npart, type;
index 9810a6a..93bce59 100644 (file)
@@ -1584,13 +1584,15 @@ afs_int32 VolListPartitions (acid, partIds)
 struct rx_call *acid;
 struct pIDs *partIds;
 {   
-    struct stat rbuf, pbuf;
     char namehead[9];
+    struct stat rbuf, pbuf;
     int code;
     char i;
+
+    strcpy(namehead, "/vicep");        /*7 including null terminator*/
+
 #ifdef AFS_NT40_ENV
     /* Just return attached partitions. */
-    strcpy(namehead, "/vicep");
     namehead[7] = '\0';
     for (i=0; i<26; i++) {
        namehead[6] = i + 'a';
@@ -1598,9 +1600,8 @@ struct pIDs *partIds;
            partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1;
     }
 #else
-    strcpy(namehead, "/vicep");        /*7 including null terminator*/
-    code = stat("/",&rbuf);    /*interested in buf->st_dev*/
     
+    (void) stat("/",&rbuf);    /*interested in buf->st_dev*/
    
     for(i = 0 ; i < 26 ; i++){
        
@@ -1613,8 +1614,6 @@ struct pIDs *partIds;
            else  partIds->partIds[i ] = -1;
        }
        else partIds->partIds[i ] = -1;
-       
-       
     }
 #endif   
     return 0;
index 806fd03..3957954 100644 (file)
@@ -3153,7 +3153,7 @@ static ListVLDB(as)
        if (vcode == RXGEN_OPCODE) {
          /* Vlserver not running with ListAttributesN2. Fall back */
          vcode = VLDB_ListAttributes(&attributes, &centries, &arrayEntries);
-         nextindex == -1;
+         nextindex = -1;
        }
        if (vcode) {
          fprintf(STDERR,"Could not access the VLDB for attributes\n");
index 6e79773..1c776d4 100644 (file)
@@ -65,12 +65,16 @@ extern int VL_SetLock();
 extern int VL_ReleaseLock();
 extern int VL_DeleteEntry();
 
+void MapNetworkToHost();
+void MapHostToNetwork();
+
 struct release {
   afs_int32 time;
   afs_int32 vldbEntryIndex;
 };
 
 /*map the partition <partId> into partition name <partName>*/
+void
 MapPartIdIntoName(partId, partName)
 afs_int32 partId;
 char *partName;
@@ -79,14 +83,14 @@ char *partName;
        strcpy(partName,"/vicep");
        partName[6] = partId + 'a';
        partName[7] = '\0';
-       return 0;
+       return;
     } else if (partId < VOLMAXPARTS) {
         strcpy(partName,"/vicep");
        partId -= 26;
        partName[6] = 'a' + (partId/26);
        partName[7] = 'a' + (partId%26);
        partName[8] = '\0';
-       return 0;
+       return;
     }
 }
 
@@ -364,9 +368,6 @@ struct nvldbentry *entry;
 void EnumerateEntry(entry)
 struct nvldbentry *entry;
 {
-    int i;
-    char pname[10];
-    int isMixed = 0;
 
     fprintf(STDOUT,"\n");
     fprintf(STDOUT,"%s \n",entry->name);
@@ -535,9 +536,8 @@ UV_AddVLDBEntry(aserver, apart, aname, aid)
   afs_int32 aid; 
 {
     register struct rx_connection *aconn;
-    register afs_int32 code;
     afs_int32 error;
-    afs_int32 rcode,vcode;
+    afs_int32 vcode;
     struct nvldbentry entry,storeEntry;/*the new vldb entry */
 
     aconn = (struct rx_connection *)0;
@@ -1760,7 +1760,7 @@ static int DelVol (conn, vid, part, flags)
 struct rx_connection *conn;
 afs_int32 vid, part, flags;
 {
-  afs_int32 acode, bcode, ccode, rcode, tid;
+  afs_int32 acode, ccode, rcode, tid;
   ccode = rcode = tid = 0;
 
   acode = AFSVolTransCreate(conn, vid, part, flags, &tid);
@@ -1931,7 +1931,7 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
   afs_int32 cloneVolId, roVolId;
   struct replica *replicas=0;
   struct nvldbentry entry,storeEntry;
-  int i, volcount, k, m, n, fullrelease, vldbindex;
+  int i, volcount, m, fullrelease, vldbindex;
   int failure;
   struct restoreCookie cookie;
   struct rx_connection **toconns=0;
@@ -1943,7 +1943,7 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
   afs_int32 clonetid=0, onlinetid;
   afs_int32 fromtid=0;
   afs_uint32 fromdate, thisdate;
-  int ix, si, s;
+  int s;
   manyDests tr;
   manyResults results;
   int rwindex, roindex, roclone, roexists;
@@ -3491,7 +3491,6 @@ static afs_int32 CheckVolume(volumeinfo, aserver, apart, modentry, maxvolid)
    int   idx, j;
    afs_int32 code, error = 0;
    struct nvldbentry entry, storeEntry;
-   int sameserver;
    char pname[10];
    int pass=0, islocked=0, createentry, addvolume, modified, mod;
    afs_int32 rwvolid;
@@ -4402,10 +4401,9 @@ afs_int32 CheckVldb(entry, modified)
    afs_int32             *modified;
 {
    afs_int32 code, error=0;
-   int idx;
    struct nvldbentry storeEntry;
    int islocked=0, mod, modentry, delentry=0;
-   int foundro, pass=0;
+   int pass=0;
 
    if (modified) *modified = 0;
    if (verbose) {
@@ -4926,6 +4924,7 @@ UV_SetVolume(server, partition, volid, transflag, setflag, sleeptime)
 
 /*maps the host addresses in <old > (present in network byte order) to
  that in< new> (present in host byte order )*/
+void
 MapNetworkToHost(old, new)
 struct nvldbentry *old, *new;
 {
@@ -4947,10 +4946,10 @@ struct nvldbentry *old, *new;
     new->volumeId[BACKVOL] = old->volumeId[BACKVOL];
     new->cloneId = old->cloneId;
     new->flags = old->flags;
-
 }
 
 /*maps the host entries in <entry> which are present in host byte order to network byte order */
+void
 MapHostToNetwork(entry)
 struct nvldbentry *entry;
 {
index 746656e..4160267 100644 (file)
@@ -105,7 +105,7 @@ VLDB_CreateEntry(entryp)
     struct nvldbentry *entryp;
 {
     struct vldbentry oentry;
-    register int code, (*nproc)();
+    register int code;
 
     if (newvlserver == 1) {
 tryold:
@@ -132,7 +132,7 @@ VLDB_GetEntryByID(volid, voltype, entryp)
     struct nvldbentry *entryp;
 {
     struct vldbentry oentry;
-    register int code, (*nproc)();
+    register int code;
 
     if (newvlserver == 1) {
 tryold:
@@ -158,7 +158,7 @@ VLDB_GetEntryByName(namep, entryp)
     struct nvldbentry *entryp;
 {
     struct vldbentry oentry;
-    register int code, (*nproc)();
+    register int code;
 
     if (newvlserver == 1) {
 tryold:
@@ -184,7 +184,7 @@ VLDB_ReplaceEntry(volid, voltype, entryp, releasetype)
     struct nvldbentry *entryp;
 {
     struct vldbentry oentry;
-    register int code, (*nproc)();
+    register int code;
 
     if (newvlserver == 1) {
 tryold:
@@ -270,8 +270,7 @@ extern int VL_GetAddrsU();
 VLDB_IsSameAddrs(serv1, serv2, errorp)
     afs_int32 serv1, serv2, *errorp;
 {
-    struct vldbentry oentry;
-    register int code, (*nproc)();
+    register int code;
     ListAddrByAttributes attrs;
     bulkaddrs addrs;
     afs_uint32 *addrp, nentries,  unique, i, j, f1, f2;
@@ -536,7 +535,7 @@ char *astring; {
     char *str,*ptr, volname[VOLSER_OLDMAXVOLNAME+1];
     int tryname, curval;
     struct nvldbentry entry;
-    afs_int32 vcode;
+    afs_int32 vcode = 0;
     int total;
 
     *errp = 0;