From 3dc648d7610641a530b06ecaddac6f6e576e1b74 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 8 Dec 2003 01:45:23 +0000 Subject: [PATCH] add-missing-return-values-20031207 Add missing return values producing warnings on Windows --- src/WINNT/afsd/cm_buf.c | 1 + src/WINNT/afsd/cm_config.c | 6 ++++-- src/WINNT/afsd/cm_freelance.c | 10 ++++++---- src/WINNT/afsd/smb.c | 1 + src/bucoord/commands.c | 1 + src/bucoord/main.c | 1 + src/budb/server.c | 4 ++++ src/budb/struct_ops.c | 24 ++++++++++++++++++++++++ src/butc/dump.c | 5 +++++ src/butc/lwps.c | 2 ++ src/butc/tcudbprocs.c | 2 ++ src/dir/buffer.c | 1 + src/ptserver/db_verify.c | 1 + src/ptserver/ptuser.c | 2 ++ src/ubik/disk.c | 2 ++ src/ubik/recovery.c | 1 + src/ubik/vote.c | 2 ++ src/viced/afsfileprocs.c | 2 +- src/viced/callback.c | 1 + src/viced/host.c | 1 + src/viced/physio.c | 1 + src/volser/vsprocs.c | 1 + 22 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 5a89ffa62..84346f295 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -1441,5 +1441,6 @@ int cm_DumpBufHashTable(FILE *outputFile, char *cookie) WriteFile(outputFile, output, strlen(output), &zilch, NULL); lock_ReleaseRead(&buf_globalLock); + return 0; } diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index 41b0e5df8..37ed8897b 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -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; } diff --git a/src/WINNT/afsd/cm_freelance.c b/src/WINNT/afsd/cm_freelance.c index d3081229d..1547f3a42 100644 --- a/src/WINNT/afsd/cm_freelance.c +++ b/src/WINNT/afsd/cm_freelance.c @@ -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; } diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index ccfaca931..063c43db9 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -6639,6 +6639,7 @@ int smb_DumpVCP(FILE *outputFile, char *cookie) } lock_ReleaseRead(&smb_rctLock); + return 0; } diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 06179b4a6..423de31bd 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -194,6 +194,7 @@ randSPEntries(serverlist, avols) } free(ss); } + return 0; } int diff --git a/src/bucoord/main.c b/src/bucoord/main.c index db9cd4fb9..069433a63 100644 --- a/src/bucoord/main.c +++ b/src/bucoord/main.c @@ -468,6 +468,7 @@ bc_interactCmd(as, arock) char *arock; { interact = 1; + return 0; } static void diff --git a/src/budb/server.c b/src/budb/server.c index 95be53975..2e80753c8 100644 --- a/src/budb/server.c +++ b/src/budb/server.c @@ -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; } diff --git a/src/budb/struct_ops.c b/src/budb/struct_ops.c index 75c3aca6b..5d6c0109f 100644 --- a/src/budb/struct_ops.c +++ b/src/budb/struct_ops.c @@ -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) diff --git a/src/butc/dump.c b/src/butc/dump.c index 6c37af34d..19363f2a9 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -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 */ diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 6eb2ee37c..1ce9e4120 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -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) diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 42f8a672e..7a902ef60 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -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 diff --git a/src/dir/buffer.c b/src/dir/buffer.c index 7863ced22..02b98a655 100644 --- a/src/dir/buffer.c +++ b/src/dir/buffer.c @@ -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 * diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index e2ee4a8a5..6fd341e78 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -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 diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index daae04fa6..8df66fd80 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -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; } diff --git a/src/ubik/disk.c b/src/ubik/disk.c index 02a482aec..89b830389 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -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 */ diff --git a/src/ubik/recovery.c b/src/ubik/recovery.c index fcf4ee175..cbcaae9d5 100644 --- a/src/ubik/recovery.c +++ b/src/ubik/recovery.c @@ -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 diff --git a/src/ubik/vote.c b/src/ubik/vote.c index 45cbfc07a..0a1f4f230 100644 --- a/src/ubik/vote.c +++ b/src/ubik/vote.c @@ -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 */ diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 5171305b5..1b271dc13 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1898,7 +1898,7 @@ RXGetVolumeStatus(AFSFetchVolumeStatus * status, char **name, char **offMsg, } strcpy(*motd, V_motd(volptr)); #endif /* FS_STATS_DETAILED */ - + return 0; } /*RXGetVolumeStatus */ diff --git a/src/viced/callback.c b/src/viced/callback.c index 09ac9ff98..65e3be289 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -1489,6 +1489,7 @@ CleanupTimedOutCallBacks(void) H_LOCK; CleanupTimedOutCallBacks_r(); H_UNLOCK; + return 0; } int diff --git a/src/viced/host.c b/src/viced/host.c index 0fba00f29..1f2651dd6 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -832,6 +832,7 @@ h_FreeConnection(struct rx_connection *tcon) client->tcon = (struct rx_connection *)0; H_UNLOCK; } + return 0; } /*h_FreeConnection */ diff --git a/src/viced/physio.c b/src/viced/physio.c index eba5d2c3b..b3a6a16ff 100644 --- a/src/viced/physio.c +++ b/src/viced/physio.c @@ -202,4 +202,5 @@ FidCpy(DirHandle * tofile, DirHandle * fromfile) { *tofile = *fromfile; IH_COPY(tofile->dirh_handle, fromfile->dirh_handle); + return 0; } diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 2fad506a6..fe03d06a0 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -415,6 +415,7 @@ UV_SetSecurity(register struct rx_securityClass *as, afs_int32 aindex) { uvindex = aindex; uvclass = as; + return 0; } /* bind to volser on */ -- 2.39.5