add-missing-return-values-20031207
authorJeffrey Altman <jaltman@grand.central.org>
Mon, 8 Dec 2003 01:45:23 +0000 (01:45 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 8 Dec 2003 01:45:23 +0000 (01:45 +0000)
Add missing return values producing warnings on Windows

22 files changed:
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/smb.c
src/bucoord/commands.c
src/bucoord/main.c
src/budb/server.c
src/budb/struct_ops.c
src/butc/dump.c
src/butc/lwps.c
src/butc/tcudbprocs.c
src/dir/buffer.c
src/ptserver/db_verify.c
src/ptserver/ptuser.c
src/ubik/disk.c
src/ubik/recovery.c
src/ubik/vote.c
src/viced/afsfileprocs.c
src/viced/callback.c
src/viced/host.c
src/viced/physio.c
src/volser/vsprocs.c

index 5a89ffa..84346f2 100644 (file)
@@ -1441,5 +1441,6 @@ int cm_DumpBufHashTable(FILE *outputFile, char *cookie)
     WriteFile(outputFile, output, strlen(output), &zilch, NULL);
 
     lock_ReleaseRead(&buf_globalLock);
+    return 0;
 }
 
index 41b0e5d..37ed889 100644 (file)
@@ -565,7 +565,8 @@ long cm_CloseCellFile(cm_configFile_t *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 closeCode;
         
        /* add trailing backslash, if required */
         tlen = strlen(wdir);
@@ -599,7 +600,8 @@ long cm_CloseCellFile(cm_configFile_t *filep)
         
         code = rename(sdir, wdir);     /* do the rename */
         
-        if (code) code = errno;
+        if (code) 
+         code = errno;
         
         return code;
 }
index d308122..1547f3a 100644 (file)
@@ -229,10 +229,11 @@ void cm_InitFakeRootDir() {
 
 int cm_FakeRootFid(cm_fid_t *fidp)
 {
-  fidp->cell = 0x1;            /* root cell */
-       fidp->volume = 0x20000001;   /* root.afs ? */
-       fidp->vnode = 0x1;
-       fidp->unique = 0x1;
+      fidp->cell = 0x1;            /* root cell */
+      fidp->volume = 0x20000001;   /* root.afs ? */
+      fidp->vnode = 0x1;
+      fidp->unique = 0x1;
+      return 0;
 }
   
 int cm_getLocalMountPointChange() {
@@ -332,6 +333,7 @@ int cm_reInitLocalMountPoints() {
        lock_ReleaseMutex(&cm_Freelance_Lock);
 
        printf("----- reinit complete -----\n\n");
+       return 0;
 }
 
 
index ccfaca9..063c43d 100644 (file)
@@ -6639,6 +6639,7 @@ int smb_DumpVCP(FILE *outputFile, char *cookie)
     }       
   
     lock_ReleaseRead(&smb_rctLock);
+    return 0;
 }
 
 
index 06179b4..423de31 100644 (file)
@@ -194,6 +194,7 @@ randSPEntries(serverlist, avols)
        }
        free(ss);
     }
+    return 0;
 }
 
 int
index db9cd4f..069433a 100644 (file)
@@ -468,6 +468,7 @@ bc_interactCmd(as, arock)
      char *arock;
 {
     interact = 1;
+    return 0;
 }
 
 static void
index 95be539..2e80753 100644 (file)
@@ -550,6 +550,7 @@ LogDebug(level, a, b, c, d, e, f, g, h, i)
            fclose(globalConfPtr->log);
        }
     }
+    return 0;
 }
 
 static char *
@@ -578,6 +579,7 @@ Log(a, b, c, d, e, f, g, h, i)
        fflush(globalConfPtr->log);
        fclose(globalConfPtr->log);
     }
+    return 0;
 }
 
  /*VARARGS*/
@@ -600,6 +602,7 @@ LogError(code, a, b, c, d, e, f, g, h, i)
        fflush(globalConfPtr->log);
        fclose(globalConfPtr->log);
     }
+    return 0;
 }
 
 
@@ -622,4 +625,5 @@ LogNetDump(dumpPtr)
        printDump(globalConfPtr->log, &hostDump);
        fclose(globalConfPtr->log);
     }
+    return 0;
 }
index 75c3aca..5d6c010 100644 (file)
@@ -122,6 +122,7 @@ printHashTable(fid, htptr)
 /* printMemoryHashTable
  *     print the hash table structure, i.e. the header structure.
  */
+int
 printMemoryHashTable(fid, mhtptr)
      FILE *fid;
      struct memoryHashTable *mhtptr;
@@ -131,24 +132,30 @@ printMemoryHashTable(fid, mhtptr)
     fprintf(fid, "progress = %d\n", mhtptr->progress);
     fprintf(fid, "size = %d\n", mhtptr->size);
     fprintf(fid, "oldsize = %d\n", mhtptr->oldSize);
+    return 0;
 }
 
+int
 printPrincipal(ptr)
      struct ktc_principal *ptr;
 {
     printf("name = %s\n", ptr->name);
     printf("instance = %s\n", ptr->instance);
     printf("cell = %s\n", ptr->cell);
+    return 0;
 }
 
+int
 printStructDumpHeader(ptr)
      struct structDumpHeader *ptr;
 {
     printf("type = %d\n", ptr->type);
     printf("structure version = %d\n", ptr->structversion);
     printf("size = %d bytes\n", ptr->size);
+    return 0;
 }
 
+int
 printTape(fid, tptr)
      FILE *fid;
      struct tape *tptr;
@@ -167,8 +174,10 @@ printTape(fid, tptr)
     fprintf(fid, "firstVol = %d\n", tptr->firstVol);
     fprintf(fid, "labelPos = %d\n", tptr->labelpos);
     fprintf(fid, "useCount = %d\n", tptr->useCount);
+    return 0;
 }
 
+int
 printTapeEntry(teptr)
      struct budb_tapeEntry *teptr;
 {
@@ -198,8 +207,10 @@ printTapeEntry(teptr)
     printf("labelPos = %d\n", teptr->labelpos);
     printf("useCount = %d\n", teptr->useCount);
     printf("dump = %d\n", teptr->dump);
+    return 0;
 }
 
+int
 printTapeSet(tsptr, nss)
      struct budb_tapeSet *tsptr;
      afs_int32 nss;            /* is the tapeserver name an accurate name */
@@ -212,8 +223,10 @@ printTapeSet(tsptr, nss)
 /*  printf("a  = %d\n",tsptr->a ); */
 /*  printf("b = %d\n",tsptr->b);   */
     printf("Start Tape Seq = %d\n", tsptr->b);
+    return 0;
 }
 
+int
 printVolumeEntry(veptr)
      struct budb_volumeEntry *veptr;
 {
@@ -245,8 +258,10 @@ printVolumeEntry(veptr)
 
     printf("dump = %d\n", veptr->dump);
     printf("tape = %s\n", veptr->tape);
+    return 0;
 }
 
+int
 printVolFragment(fid, vfptr)
      FILE *fid;
      struct volFragment *vfptr;
@@ -262,8 +277,10 @@ printVolFragment(fid, vfptr)
     fprintf(fid, "nBytes = %d\n", vfptr->nBytes);
     fprintf(fid, "flags = %d\n", vfptr->flags);
     fprintf(fid, "sequence = %d\n", vfptr->sequence);
+    return 0;
 }
 
+int
 printVolInfo(fid, viptr)
      FILE *fid;
      struct volInfo *viptr;
@@ -278,6 +295,7 @@ printVolInfo(fid, viptr)
     fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain);
     fprintf(fid, "firstFragment = %d\n", viptr->firstFragment);
     fprintf(fid, "nFrags = %d\n", viptr->nFrags);
+    return 0;
 }
 
 
@@ -401,6 +419,7 @@ principal_hton(hostptr, netptr)
     strcpy(netptr->name, hostptr->name);
     strcpy(netptr->instance, hostptr->instance);
     strcpy(netptr->cell, hostptr->cell);
+    return 0;
 }
 
 principal_ntoh(netptr, hostptr)
@@ -409,6 +428,7 @@ principal_ntoh(netptr, hostptr)
     strcpy(hostptr->name, netptr->name);
     strcpy(hostptr->instance, netptr->instance);
     strcpy(hostptr->cell, netptr->cell);
+    return 0;
 }
 
 structDumpHeader_hton(hostPtr, netPtr)
@@ -445,6 +465,7 @@ tapeEntry_ntoh(netptr, hostptr)
     hostptr->dump = ntohl(netptr->dump);
 }
 
+int
 tapeSet_hton(hostptr, netptr)
      struct budb_tapeSet *hostptr, *netptr;
 {
@@ -454,8 +475,10 @@ tapeSet_hton(hostptr, netptr)
     netptr->maxTapes = htonl(hostptr->maxTapes);
     netptr->a = htonl(hostptr->a);
     netptr->b = htonl(hostptr->b);
+    return 0;
 }
 
+int
 tapeSet_ntoh(netptr, hostptr)
      struct budb_tapeSet *netptr, *hostptr;
 {
@@ -465,6 +488,7 @@ tapeSet_ntoh(netptr, hostptr)
     hostptr->maxTapes = ntohl(netptr->maxTapes);
     hostptr->a = ntohl(netptr->a);
     hostptr->b = ntohl(netptr->b);
+    return 0;
 }
 
 textBlock_hton(hostptr, netptr)
index 6c37af3..19363f2 100644 (file)
@@ -106,6 +106,7 @@ int
 localtime_r(time_t * t, struct tm *tm)
 {
     memcpy(tm, localtime(t), sizeof(struct tm));
+    return 0;
 }
 #endif
 
@@ -821,6 +822,8 @@ xbsaDumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
   abort_exit:
     dparamsPtr->curVolumeStatus = DUMP_FAILED;
     ERROR_EXIT(code);
+#else
+    return 0;
 #endif
 }
 
@@ -1459,6 +1462,7 @@ printTapeLabel(struct butm_tapeLabel *tl)
     printf("   pName          = %s\n", tl->pName);
     printf("   size           = %u\n", tl->size);
     printf("   dumpPath       = %s\n", tl->dumpPath);
+    return 0;
 }
 
 /* getXBSATape
@@ -1900,6 +1904,7 @@ volumeHeader_hton(struct volumeHeader *hostPtr, struct volumeHeader *netPtr)
     volHdr.cloneDate = htonl(hostPtr->cloneDate);
 
     memcpy(netPtr, &volHdr, sizeof(struct volumeHeader));
+    return 0;
 }
 
 /* database related routines */
index 6eb2ee3..1ce9e41 100644 (file)
@@ -1443,6 +1443,7 @@ SkipTape(Restore, size, index, tapename, tapeid, taskid)
            SkipVolume(Restore, size, i, Restore[i].origVid, taskid);
        }
     }
+    return 0;
 }
 
 /* SkipVolume
@@ -1468,6 +1469,7 @@ SkipVolume(Restore, size, index, volid, taskid)
            }
        }
     }
+    return 0;
 }
 
 xbsaRestoreVolume(taskId, restoreInfo, rparamsPtr)
index 42f8a67..7a902ef 100644 (file)
@@ -528,6 +528,7 @@ makeDbDumpEntry(tapeEntPtr, dumpEntryPtr)
     strcat(dumpEntryPtr->tapes.format, ".%d");
     dumpEntryPtr->tapes.b = tapeEntPtr->seq;
     dumpEntryPtr->tapes.maxTapes = 0;
+    return 0;
 }
 
 /* readDbTape
@@ -780,6 +781,7 @@ KeepAlive()
        if (code || done)
            break;
     }
+    return 0;
 }
 
 #define BIGCHUNK 102400
index 7863ced..02b98a6 100644 (file)
@@ -219,6 +219,7 @@ FixupBucket(ap)
     ap->hashIndex = i;         /* remember where we are for deletion */
     ap->hashNext = phTable[i]; /* add us to the list */
     phTable[i] = ap;           /* at the front, since it's LRU */
+    return 0;
 }
 
 struct buffer *
index e2ee4a8..6fd341e 100644 (file)
@@ -87,6 +87,7 @@ printheader(h)
 /* printf("Sub/super Count   = %d\n", ntohl(h->instcount));    NYI */
     printf("Name Hash         = %d buckets\n", HASHSIZE);
     printf("ID   Hash         = %d buckets\n", HASHSIZE);
+    return 0;
 }
 
 static afs_int32
index daae04f..8df66fd 100644 (file)
@@ -779,6 +779,7 @@ pr_SetFieldsEntry(id, mask, flags, ngroups, nusers)
 }
 
 
+int
 stolower(s)
      char *s;
 {
@@ -787,4 +788,5 @@ stolower(s)
            *s = tolower(*s);
        s++;
     }
+    return 0;
 }
index 02a482a..89b8303 100644 (file)
@@ -103,6 +103,7 @@ udisk_Debug(struct ubik_debug *aparm)
                aparm->writeLockedPages++;
        }
     }
+    return 0;
 }
 
 /* log format is defined here, and implicitly in recovery.c
@@ -472,6 +473,7 @@ FixupBucket(struct buffer *ap)
     ap->hashIndex = i;         /* remember where we are for deletion */
     ap->hashNext = phTable[i]; /* add us to the list */
     phTable[i] = ap;
+    return 0;
 }
 
 /* create a new slot for a particular dbase page */
index fcf4ee1..cbcaae9 100644 (file)
@@ -164,6 +164,7 @@ urecovery_CheckTid(register struct ubik_tid *atid)
            ubik_currentTrans = (struct ubik_trans *)0;
        }
     }
+    return;
 }
 
 /* log format is defined here, and implicitly in disk.c
index 45cbfc0..0a1f4f2 100644 (file)
@@ -546,6 +546,7 @@ ubik_dprint(char *a, char *b, char *c, char *d, char *e, char *f, char *g,
            char *h)
 {
     ViceLog(5, (a, b, c, d, e, f, g, h));
+    return 0;
 }
 
 int
@@ -553,6 +554,7 @@ ubik_print(char *a, char *b, char *c, char *d, char *e, char *f, char *g,
           char *h)
 {
     ViceLog(0, (a, b, c, d, e, f, g, h));
+    return 0;
 }
 
 /* called once/run to init the vote module */
index 5171305..1b271dc 100644 (file)
@@ -1898,7 +1898,7 @@ RXGetVolumeStatus(AFSFetchVolumeStatus * status, char **name, char **offMsg,
     }
     strcpy(*motd, V_motd(volptr));
 #endif /* FS_STATS_DETAILED */
-
+    return 0;
 }                              /*RXGetVolumeStatus */
 
 
index 09ac9ff..65e3be2 100644 (file)
@@ -1489,6 +1489,7 @@ CleanupTimedOutCallBacks(void)
     H_LOCK;
     CleanupTimedOutCallBacks_r();
     H_UNLOCK;
+    return 0;
 }
 
 int
index 0fba00f..1f2651d 100644 (file)
@@ -832,6 +832,7 @@ h_FreeConnection(struct rx_connection *tcon)
            client->tcon = (struct rx_connection *)0;
        H_UNLOCK;
     }
+    return 0;
 }                              /*h_FreeConnection */
 
 
index eba5d2c..b3a6a16 100644 (file)
@@ -202,4 +202,5 @@ FidCpy(DirHandle * tofile, DirHandle * fromfile)
 {
     *tofile = *fromfile;
     IH_COPY(tofile->dirh_handle, fromfile->dirh_handle);
+    return 0;
 }
index 2fad506..fe03d06 100644 (file)
@@ -415,6 +415,7 @@ UV_SetSecurity(register struct rx_securityClass *as, afs_int32 aindex)
 {
     uvindex = aindex;
     uvclass = as;
+    return 0;
 }
 
 /* bind to volser on <port> <aserver> */