From: Simon Wilkinson Date: Mon, 27 Oct 2008 23:41:02 +0000 (+0000) Subject: kill-uninitialized-variable-warnings-20081026 X-Git-Tag: openafs-devel-1_5_61~721 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f27165f13796a84cdbc36c31714781509ad25ba0 kill-uninitialized-variable-warnings-20081026 LICENSE IPL10 kill lots of compiler warnings --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 8254940..b786a5f 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -664,7 +664,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) afs_int32 retry; /* handle low-level SGI MP race conditions */ long volStates; /* flags from vol structure */ struct volume *volp = 0; /* volume ptr */ - struct VenusFid dotdot; + struct VenusFid dotdot = {0, 0, 0}; int flagIndex = 0; /* First file with bulk fetch flag set */ int inlinebulk = 0; /* Did we use InlineBulk RPC or not? */ XSTATS_DECLS; diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 8206ef8..a7e598c 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -431,14 +431,15 @@ EvalVolumeSet1(aconfig, avs, avols, uclient) struct bc_volumeDump *tvd; /*Ptr to new dump instance */ struct bc_volumeEntry *tve, *ctve; /*Ptr to new volume entry instance */ char patt[256]; /*Composite regex; also, target string */ - int volType; /*Type of volume that worked */ + int volType = 0; /*Type of volume that worked */ afs_int32 index; /*Current VLDB entry index */ afs_int32 count; /*Needed by VL_ListEntry() */ afs_int32 next_index; /*Next index to list */ struct vldbentry entry; /*VLDB entry */ int srvpartpair; /*Loop counter: server/partition pair */ afs_int32 total = 0; - int found, foundentry; + int found; + int foundentry = 0; struct serversort *servers = 0, *ss = 0; struct partitionsort *ps = 0; @@ -1602,9 +1603,11 @@ int bc_DumpCmd(struct cmd_syndesc *as, void *arock) { /*bc_DumpCmd */ static char rn[] = "bc_DumpCmd"; /*Routine name */ - char *dumpPath, *vsName; /*Ptrs to various names */ - struct bc_volumeSet *tvs; /*Ptr to list of generated volume info */ - struct bc_dumpSchedule *tds, *baseds; /*Ptr to dump schedule node */ + char *dumpPath = NULL; + char *vsName = NULL; /*Ptrs to various names */ + struct bc_volumeSet *tvs = NULL; /*Ptr to list of generated volume info */ + struct bc_dumpSchedule *tds; + struct bc_dumpSchedule *baseds = NULL; /*Ptr to dump schedule node */ struct bc_volumeDump *tve, *volsToDump; /*Ptr to individual vols to be dumped */ struct budb_dumpEntry dumpEntry, de, fde; /* dump entry */ afs_uint32 d; @@ -1618,7 +1621,7 @@ bc_DumpCmd(struct cmd_syndesc *as, void *arock) afs_int32 doAt, atTime; /* Time a timed-dump is to start at */ afs_int32 length; char *timeString; - int doAppend; /* Append the dump to dump set */ + int doAppend = 0; /* Append the dump to dump set */ afs_int32 code; /* Return code */ int loadfile; /* whether to load a file or not */ diff --git a/src/budb/db_hash.c b/src/budb/db_hash.c index d9b9897..f8e08ed 100644 --- a/src/budb/db_hash.c +++ b/src/budb/db_hash.c @@ -266,7 +266,7 @@ ht_GetTableBlock(ut, mht, hash, old, blockP, boP) int n; int i; int length; - dbadr ta; + dbadr ta = NULL; if ((mht == 0) || ((ht = mht->ht) == 0) diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 8c7eb3c..6c5c298 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -1245,7 +1245,7 @@ restoreVolumeData(call, rparamsPtr) { afs_int32 curChunk; afs_uint32 totalWritten = 0; - afs_int32 code; + afs_int32 code = 0; afs_int32 headBytes, tailBytes, w; afs_int32 taskId; afs_int32 nbytes; /* # bytes data in last tape block read */ diff --git a/src/butc/read_tape.c b/src/butc/read_tape.c index 0e12480..036b0ce 100644 --- a/src/butc/read_tape.c +++ b/src/butc/read_tape.c @@ -285,7 +285,8 @@ writeLastBlocks(char *lastblock, char *lastblock2) struct volumeHeader vh; char trailer[12]; struct blockMark *bmark, *bmark2; - char *data, *data2; + char *data; + char *data2 = NULL; int count, count2; int tlen, skip, pos; @@ -396,7 +397,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock) char *data; char *tblock; afs_int32 code; - struct volumeHeader *volheaderPtr; + struct volumeHeader *volheaderPtr = NULL; int eod = 1; int rc; char *nextblock; /* We cycle through three tape blocks so we */ diff --git a/src/butc/tcprocs.c b/src/butc/tcprocs.c index c04ff19..1f07bcc 100644 --- a/src/butc/tcprocs.c +++ b/src/butc/tcprocs.c @@ -572,7 +572,7 @@ STC_ScanDumps(struct rx_call *acid, afs_int32 addDbFlag, afs_uint32 *taskId) PROCESS pid; #endif struct scanTapeIf *ptr; - statusP statusPtr; + statusP statusPtr = NULL; afs_int32 code = 0; extern afs_int32 allocTaskId(); diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index c0070a9..9263d19 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -392,7 +392,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid) char *writeBufPtr; afs_int32 transferSize; - char *readBufPtr; + char *readBufPtr = NULL; afs_int32 maxReadSize; charListT charList; diff --git a/src/kauth/knfs.c b/src/kauth/knfs.c index 24a9b82..a475437 100644 --- a/src/kauth/knfs.c +++ b/src/kauth/knfs.c @@ -103,7 +103,7 @@ GetTokens(ahost, auid) struct ViceIoctl iob; afs_int32 pheader[6]; char tbuffer[1024]; - register afs_int32 code; + afs_int32 code = 0; int index, newIndex; char *stp; /* secret token ptr */ struct ClearToken ct; diff --git a/src/libadmin/cfg/cfgdb.c b/src/libadmin/cfg/cfgdb.c index 9f3f084..52ba126 100644 --- a/src/libadmin/cfg/cfgdb.c +++ b/src/libadmin/cfg/cfgdb.c @@ -233,7 +233,7 @@ cfg_CellServDbEnumerate(const char *fsDbHost, /* fileserver or database host */ void *bosHandle; char dbhostName[MAXHOSTSPERCELL][BOS_MAX_NAME_LEN]; char dbhostCell[BOS_MAX_NAME_LEN]; - int dbhostCount; + int dbhostCount = 0; if (!afsclient_NullCellOpen(&cellHandle, &tst2)) { tst = tst2; @@ -488,7 +488,7 @@ CellServDbUpdate(int updateOp, void *hostHandle, const char *sysControlHost, free(ctrlBlockp); } else { /* fill name blocks, handing each to a worker thread */ - void *nameBlockIter; + void *nameBlockIter = NULL; short workersStarted = 0; if (!NameBlockGetBegin diff --git a/src/libadmin/cfg/cfghost.c b/src/libadmin/cfg/cfghost.c index 610e58e..dee5712 100644 --- a/src/libadmin/cfg/cfghost.c +++ b/src/libadmin/cfg/cfghost.c @@ -502,7 +502,7 @@ cfg_HostSetAfsPrincipal(void *hostHandle, /* host config handle */ if (tst == 0) { kas_identity_t afsIdentity; kas_encryptionKey_t afsKey; - int afsKvno; + int afsKvno = 0; strcpy(afsIdentity.principal, "afs"); afsIdentity.instance[0] = '\0'; diff --git a/src/libadmin/cfg/cfgservers.c b/src/libadmin/cfg/cfgservers.c index 723feb1..fd98aa5 100644 --- a/src/libadmin/cfg/cfgservers.c +++ b/src/libadmin/cfg/cfgservers.c @@ -1938,7 +1938,8 @@ UpdateCommandParse(char *cmdString, short *hasSysPathP, short *hasBinPathP) if (dirp != NULL) { /* check that not a portition of a larger path */ - char oneBefore, oneAfter, twoAfter; + char oneBefore, oneAfter; + char twoAfter = 0; oneBefore = *(dirp - 1); oneAfter = *(dirp + sizeof(AFSDIR_CANONICAL_SERVER_ETC_DIRPATH) - 1); @@ -1962,7 +1963,8 @@ UpdateCommandParse(char *cmdString, short *hasSysPathP, short *hasBinPathP) if (dirp != NULL) { /* check that not a portition of a larger path */ - char oneBefore, oneAfter, twoAfter; + char oneBefore, oneAfter; + char twoAfter = 0; oneBefore = *(dirp - 1); oneAfter = *(dirp + sizeof(AFSDIR_CANONICAL_SERVER_BIN_DIRPATH) - 1); @@ -2041,7 +2043,8 @@ UbikQuorumCheck(cfg_host_p cfg_host, const char *dbInstance, short *hasQuorum, tst = tst2; dbhostDone = 1; } else { - short isSyncSite, isWriteReady; + short isSyncSite = 0; + short isWriteReady = 0; /* ignore errors fetching Ubik vote status; there might be * an unreachable dbserver yet a reachable sync site. diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index f3c23ca..725c26d 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -1835,7 +1835,7 @@ afsclient_AFSServerGetBegin(const void *cellHandle, void **iterationIdP, (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t)); server_get_p serv = (server_get_p) calloc(1, sizeof(server_get_t)); server_get_p serv_cache = NULL; - const char *cellName; + const char *cellName = NULL; void *database_iter; util_databaseServerEntry_t database_entry; void *fileserver_iter; diff --git a/src/libadmin/test/bos.c b/src/libadmin/test/bos.c index bc85cc9..02752a2 100644 --- a/src/libadmin/test/bos.c +++ b/src/libadmin/test/bos.c @@ -88,7 +88,7 @@ static LocalParseLine(char *aline, struct token **alist) { char tbuffer[256]; - register char *tptr; + char *tptr = NULL; int inToken; struct token *first, *last; register struct token *ttok; @@ -481,7 +481,7 @@ DoBosProcessExecutionStateSet(struct cmd_syndesc *as, void *arock) const char *process = NULL; int stop = 0; int run = 0; - bos_ProcessExecutionState_t state; + bos_ProcessExecutionState_t state = 0; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -532,7 +532,7 @@ DoBosProcessExecutionStateSetTemporary(struct cmd_syndesc *as, void *arock) const char *process = NULL; int stop = 0; int run = 0; - bos_ProcessExecutionState_t state; + bos_ProcessExecutionState_t state = 0; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -926,7 +926,7 @@ DoBosAdminCreate(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, ADMIN } DoBosAdminCreate_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *admin; + const char *admin = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -954,7 +954,7 @@ DoBosAdminDelete(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, ADMIN } DoBosAdminDelete_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *admin; + const char *admin = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -1021,7 +1021,7 @@ DoBosKeyCreate(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, VERSIONNUMBER, KEY } DoBosKeyCreate_parm_t; afs_status_t st = 0; void *bos_server = NULL; - int version_number; + int version_number = 0; kas_encryptionKey_t key = { {0, 0, 0, 0, 0, 0, 0, 0} }; const char *cell; @@ -1063,7 +1063,7 @@ DoBosKeyDelete(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, VERSIONNUMBER } DoBosKeyDelete_parm_t; afs_status_t st = 0; void *bos_server = NULL; - int version_number; + int version_number = 0; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -1150,7 +1150,7 @@ DoBosCellSet(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, CELL } DoBosCellSet_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *cell; + const char *cell = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -1204,7 +1204,7 @@ DoBosHostCreate(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, HOST } DoBosHostCreate_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *host; + const char *host = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -1232,7 +1232,7 @@ DoBosHostDelete(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, HOST } DoBosHostDelete_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *host; + const char *host = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen @@ -1435,7 +1435,7 @@ DoBosExecutableRestartTimeSet(struct cmd_syndesc *as, void *arock) } DoBosExecutableRestartTimeSet_parm_t; afs_status_t st = 0; void *bos_server = NULL; - bos_Restart_t type; + bos_Restart_t type = 0; int have_daily = 0; int have_weekly = 0; bos_RestartTime_t time; @@ -1534,7 +1534,7 @@ DoBosExecutableRestartTimeGet(struct cmd_syndesc *as, void *arock) } DoBosExecutableRestartTimeGet_parm_t; afs_status_t st = 0; void *bos_server = NULL; - bos_Restart_t type; + bos_Restart_t type = 0; int have_daily = 0; int have_weekly = 0; bos_RestartTime_t restart_time; @@ -1583,7 +1583,7 @@ DoBosLogGet(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, LOGFILE } DoBosLogGet_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *log_file; + const char *log_file = NULL; unsigned long buf_size = INITIAL_BUF_SIZE; char *buf = NULL; @@ -1631,7 +1631,7 @@ DoBosAuthSet(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, REQUIREAUTH, DISABLEAUTH } DoBosAuthSet_parm_t; afs_status_t st = 0; void *bos_server = NULL; - bos_Auth_t auth; + bos_Auth_t auth = 0; int have_req = 0; int have_dis = 0; @@ -1675,7 +1675,7 @@ DoBosCommandExecute(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, COMMAND } DoBosCommandExecute_parm_t; afs_status_t st = 0; void *bos_server = NULL; - const char *command; + const char *command = NULL; if (as->parms[SERVER].items) { if (!bos_ServerOpen diff --git a/src/libadmin/test/client.c b/src/libadmin/test/client.c index c4fd4d4..0a7b912 100644 --- a/src/libadmin/test/client.c +++ b/src/libadmin/test/client.c @@ -283,8 +283,8 @@ DoClientMountPointCreate(struct cmd_syndesc *as, void *arock) CHECK } DoClientMountPointCreate_parm_t; afs_status_t st = 0; - const char *directory; - const char *volume; + const char *directory = NULL; + const char *volume = NULL; vol_type_t vol_type = READ_ONLY; vol_check_t vol_check = DONT_CHECK_VOLUME; @@ -335,7 +335,7 @@ DoClientAFSServerGet(struct cmd_syndesc *as, void *arock) { typedef enum { SERVER } DoClientAFSServerGet_parm_t; afs_status_t st = 0; - const char *server; + const char *server = NULL; afs_serverEntry_t entry; if (as->parms[SERVER].items) { @@ -486,8 +486,8 @@ DoClientRPCStatsStateGet(struct cmd_syndesc *as, void *arock) int servAddr = 0; afs_stat_source_t type; int srvrPort; - int typeIsValid; - afs_stat_type_t which; + int typeIsValid = 0; + afs_stat_type_t which = 0; afs_RPCStatsState_t state; if (as->parms[PROCESS].items) { @@ -544,8 +544,8 @@ DoClientRPCStatsStateEnable(struct cmd_syndesc *as, void *arock) int servAddr = 0; afs_stat_source_t type; int srvrPort; - int typeIsValid; - afs_stat_type_t which; + int typeIsValid = 0; + afs_stat_type_t which = 0; if (as->parms[PROCESS].items) { typeIsValid = @@ -600,8 +600,8 @@ DoClientRPCStatsStateDisable(struct cmd_syndesc *as, void *arock) int servAddr = 0; afs_stat_source_t type; int srvrPort; - int typeIsValid; - afs_stat_type_t which; + int typeIsValid = 0; + afs_stat_type_t which = 0; if (as->parms[PROCESS].items) { typeIsValid = @@ -702,11 +702,11 @@ DoClientRPCStatsList(struct cmd_syndesc *as, void *arock) int servAddr = 0; afs_stat_source_t type; int srvrPort; - int typeIsValid; - afs_stat_type_t which; + int typeIsValid = 0; + afs_stat_type_t which = 0; afs_RPCStats_t stats; void *iter; - int i; + int i = 0; #ifdef AFS_NT40_ENV (pthread_func_list_done @@ -833,8 +833,8 @@ DoClientRPCStatsClear(struct cmd_syndesc *as, void *arock) int servAddr = 0; afs_stat_source_t type; int srvrPort; - int typeIsValid; - afs_stat_type_t which; + int typeIsValid = 0; + afs_stat_type_t which = 0; afs_RPCStatsClearFlag_t flag = 0; int seen_all = 0; int seen_any = 0; @@ -999,7 +999,7 @@ DoClientRPCStatsVersionGet(struct cmd_syndesc *as, void *arock) afs_stat_source_t type; int servAddr = 0; int srvrPort; - int typeIsValid; + int typeIsValid = 0; afs_RPCStatsVersion_t version; if (as->parms[PROCESS].items) { diff --git a/src/libadmin/test/vos.c b/src/libadmin/test/vos.c index e374081..58d811b 100644 --- a/src/libadmin/test/vos.c +++ b/src/libadmin/test/vos.c @@ -151,7 +151,7 @@ DoVosBackupVolumeCreate(struct cmd_syndesc *as, void *arock) { typedef enum { VOLUME } DoVosBackupVolumeCreate_parm_t; afs_status_t st = 0; - unsigned int volume_id; + unsigned int volume_id = 0; if (as->parms[VOLUME].items) { const char *volume = as->parms[VOLUME].items->data; @@ -222,7 +222,7 @@ DoVosPartitionGet(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION } DoVosPartitionGet_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; + unsigned int partition_id = 0; vos_partitionEntry_t entry; if (as->parms[SERVER].items) { @@ -318,7 +318,8 @@ DoVosFileServerAddressChange(struct cmd_syndesc *as, void *arock) NEWADDRESS } DoVosFileServerAddressChange_parm_t; afs_status_t st = 0; - int old_addr, new_addr; + int old_addr = 0; + int new_addr = 0; if (as->parms[OLDADDRESS].items) { const char *addr = as->parms[OLDADDRESS].items->data; @@ -341,7 +342,7 @@ DoVosFileServerAddressRemove(struct cmd_syndesc *as, void *arock) { typedef enum { ADDRESS } DoVosFileServerAddressRemove_parm_t; afs_status_t st = 0; - int address; + int address = 0; if (as->parms[ADDRESS].items) { const char *addr = as->parms[ADDRESS].items->data; @@ -678,7 +679,7 @@ DoVosVLDBEntryLock(struct cmd_syndesc *as, void *arock) { typedef enum { VOLUME } DoVosVLDBEntryLoc_parm_tk; afs_status_t st = 0; - unsigned int volume_id; + unsigned int volume_id = 0; if (as->parms[VOLUME].items) { const char *volume = as->parms[VOLUME].items->data; @@ -697,7 +698,7 @@ DoVosVLDBEntryUnlock(struct cmd_syndesc *as, void *arock) { typedef enum { VOLUME } DoVosVLDBEntryUnlock_parm_t; afs_status_t st = 0; - unsigned int volume_id; + unsigned int volume_id = 0; if (as->parms[VOLUME].items) { const char *volume = as->parms[VOLUME].items->data; @@ -719,8 +720,8 @@ DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, void *arock) } DoVosVLDBReadOnlySiteCreate_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -754,8 +755,8 @@ DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, void *arock) } DoVosVLDBReadOnlySiteDelete_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -829,10 +830,10 @@ DoVosVolumeCreate(struct cmd_syndesc *as, void *arock) } DoVosVolumeCreate_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; + unsigned int partition_id = 0; unsigned int volume_id; const char *volume = NULL; - unsigned int quota; + unsigned int quota = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -872,8 +873,8 @@ DoVosVolumeDelete(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeDelete_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -905,8 +906,8 @@ DoVosVolumeRename(struct cmd_syndesc *as, void *arock) { typedef enum { OLDVOLUME, NEWVOLUME } DoVosVolumeRename_parm_t; afs_status_t st = 0; - unsigned int old_volume; - const char *new_volume; + unsigned int old_volume = 0; + const char *new_volume = 0; if (as->parms[OLDVOLUME].items) { const char *volume = as->parms[OLDVOLUME].items->data; @@ -935,9 +936,9 @@ DoVosVolumeDump(struct cmd_syndesc *as, void *arock) unsigned int partition_id; unsigned int *part_ptr = NULL; int have_server = 0; - unsigned int volume_id; - unsigned int start_time; - const char *dumpfile; + unsigned int volume_id = 0; + unsigned int start_time = 0; + const char *dumpfile = NULL; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -988,11 +989,11 @@ DoVosVolumeRestore(struct cmd_syndesc *as, void *arock) } DoVosVolumeRestore_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; + unsigned int partition_id = 0; unsigned int volume_id; unsigned int *vol_ptr = NULL; - const char *dumpfile; - const char *volume_name; + const char *dumpfile = NULL; + const char *volume_name = NULL; vos_volumeRestoreType_t restore = VOS_RESTORE_INCREMENTAL; if (as->parms[SERVER].items) { @@ -1042,9 +1043,9 @@ DoVosVolumeOnline(struct cmd_syndesc *as, void *arock) } DoVosVolumeOnline_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; - unsigned int sleep; + unsigned int partition_id = 0; + unsigned int volume_id = 0; + unsigned int sleep = 0; vos_volumeOnlineType_t type = VOS_ONLINE_OFFLINE; if (as->parms[SERVER].items) { @@ -1088,8 +1089,8 @@ DoVosVolumeOffline(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeOffline_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -1345,8 +1346,8 @@ DoVosVolumeGet(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; vos_volumeEntry_t entry; if (as->parms[SERVER].items) { @@ -1383,7 +1384,7 @@ DoVosVolumeList(struct cmd_syndesc *as, void *arock) afs_status_t st = 0; void *vos_server = NULL; void *iter = NULL; - unsigned int partition_id; + unsigned int partition_id = 0; vos_volumeEntry_t entry; if (as->parms[SERVER].items) { @@ -1431,9 +1432,9 @@ DoVosVolumeMove(struct cmd_syndesc *as, void *arock) afs_status_t st = 0; void *from_server = NULL; void *to_server = NULL; - unsigned int from_partition; - unsigned int to_partition; - unsigned int volume_id; + unsigned int from_partition = 0; + unsigned int to_partition = 0; + unsigned int volume_id = 0; if (as->parms[FROMSERVER].items) { if (!vos_ServerOpen @@ -1479,7 +1480,7 @@ DoVosVolumeRelease(struct cmd_syndesc *as, void *arock) { typedef enum { VOLUME, FORCE } DoVosVolumeRelease_parm_t; afs_status_t st = 0; - unsigned int volume_id; + unsigned int volume_id = 0; vos_force_t force = VOS_NORMAL; if (as->parms[VOLUME].items) { @@ -1503,8 +1504,8 @@ DoVosVolumeZap(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME, FORCE } DoVosVolumeZap_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; vos_force_t force = VOS_NORMAL; if (as->parms[SERVER].items) { @@ -1541,7 +1542,7 @@ DoVosPartitionNameToId(struct cmd_syndesc *as, void *arock) { typedef enum { PARTITION } DoVosPartitionNameToId_parm_t; afs_status_t st = 0; - unsigned int partition_id; + unsigned int partition_id = 0; if (as->parms[PARTITION].items) { partition_id = @@ -1559,7 +1560,7 @@ DoVosPartitionIdToName(struct cmd_syndesc *as, void *arock) { typedef enum { PARTITIONID } DoVosPartitionIdToName_parm_t; afs_status_t st = 0; - unsigned int partition_id; + unsigned int partition_id = 0; char partition[VOS_MAX_PARTITION_NAME_LEN]; if (as->parms[PARTITIONID].items) { @@ -1585,9 +1586,9 @@ DoVosVolumeQuotaChange(struct cmd_syndesc *as, void *arock) } DoVosVolumeQuotaChange_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; - unsigned int quota; + unsigned int partition_id = 0; + unsigned int volume_id = 0; + unsigned int quota = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen @@ -1733,8 +1734,8 @@ DoVosVolumeGet2(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t; afs_status_t st = 0; void *vos_server = NULL; - afs_uint32 partition_id; - afs_uint32 volume_id; + afs_uint32 partition_id = 0; + afs_uint32 volume_id = 0; volintInfo info; memset(&info, 0, sizeof(struct volintInfo)); @@ -1775,8 +1776,8 @@ DoVos_ClearVolUpdateCounter(struct cmd_syndesc *as, void *arock) typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t; afs_status_t st = 0; void *vos_server = NULL; - unsigned int partition_id; - unsigned int volume_id; + unsigned int partition_id = 0; + unsigned int volume_id = 0; if (as->parms[SERVER].items) { if (!vos_ServerOpen diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index abdab42..e986e1a 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -272,8 +272,8 @@ CreateGroup(int g) char name[16]; afs_int32 id = 0; afs_int32 flags = PRGRP; - afs_int32 owner; - char *ownerName; + afs_int32 owner = 0; + char *ownerName = NULL; int ownerType; /* type of ownership */ static char *lastGroupPrefix; /* prefix used for type==2 */ diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index fa5acb6..4ea6271 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -933,7 +933,7 @@ static void handle_split_proc(definition * defp, int multi_flag) { char *startname = SplitStart, *endname = SplitEnd; - int numofparams; + int numofparams = 0; if (!startname) startname = "Start"; diff --git a/src/scout/scout.c b/src/scout/scout.c index c2a9118..99e596d 100644 --- a/src/scout/scout.c +++ b/src/scout/scout.c @@ -470,7 +470,7 @@ mini_justify(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc, int num_src_chars; /*# of chars in source */ int true_num_src_chars; /*# src chars before truncation */ int trunc_needed; /*Is truncation needed? */ - char diskChar; /*Disk name prefix */ + char diskChar = 0; /*Disk name prefix */ if (scout_debug) { fprintf(scout_debugfd, "[%s] Called with '%s', dest width=%d\n", rn, diff --git a/src/uss/uss.c b/src/uss/uss.c index 2c66fee..f4c5063 100644 --- a/src/uss/uss.c +++ b/src/uss/uss.c @@ -1319,7 +1319,7 @@ HandleBulk(register struct cmd_syndesc *a_as, void *a_rock) int code; int line_no = 0; - int error; + int error = 0; char tbuf[USS_BULK_BUF_CHARS]; /* diff --git a/src/uss/uss_procs.c b/src/uss/uss_procs.c index df9f49a..70c60d2 100644 --- a/src/uss/uss_procs.c +++ b/src/uss/uss_procs.c @@ -694,7 +694,7 @@ uss_procs_PickADir(path, cp) char cd[300]; /*Current directory for search */ - int i, count, MinIndex, mina = 10000; + int i, count, MinIndex = 0, mina = 10000; struct dirent *dp; DIR *dirp; char dirname[300]; diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c index 4b80876..a2e4f50 100644 --- a/src/uss/uss_vol.c +++ b/src/uss/uss_vol.c @@ -935,7 +935,7 @@ uss_vol_DeleteVol(a_volName, a_volID, a_servName, a_servID, a_partName, { /*uss_vol_DeleteVol */ static char rn[] = "uss_vol_DeleteVol"; /*Routine name */ - register afs_int32 code; /*Return code */ + register afs_int32 code = 0; /*Return code */ /* * Make sure we've initialized our VLDB connection(s) before diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index 4e47b2c..95d6bb2 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -1662,7 +1662,7 @@ icl_DumpKernel(outFilep, setname) for (i = 0; i < ICL_LOGSPERSET; i++) { code = afs_syscall(AFSCALL_ICL, ICL_OP_ENUMLOGSBYSET, (long)setname, - i, (long)tname, sizeof(tname)); + i, (long)tname, sizeof(tname), 0, 0); if (code) { if (errno == EBADF) { code = 0; @@ -1672,7 +1672,7 @@ icl_DumpKernel(outFilep, setname) } code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)tname, - (long)&dummy, (long)&dummy2, 0); + (long)&dummy, (long)&dummy2, 0, 0, 0); if (code) break; found++; @@ -1691,7 +1691,7 @@ icl_DumpKernel(outFilep, setname) for (i = 0; i < 1000; i++) { code = afs_syscall(AFSCALL_ICL, ICL_OP_ENUMLOGS, i, (long)tname, - sizeof(tname), (long)&dummy); + sizeof(tname), (long)&dummy, 0, 0); if (code) break; if (dummy > bufferSize) /* find biggest log */ @@ -1727,7 +1727,7 @@ icl_DumpKernel(outFilep, setname) code = afs_syscall(AFSCALL_ICL, ICL_OP_COPYOUT, (long)lip->name, (long)(bufferp + nwords), bufferSize - nwords, - (long)&i); + (long)&i, 0, 0); if (code < 0) { /* otherwise we've got an error */ fprintf(outFilep, "Returned error %d dumping log.\n", errno); @@ -1786,7 +1786,7 @@ icl_ClearLog(name) { afs_int32 code; - code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRLOG, (long)name, 0, 0, 0); + code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRLOG, (long)name, 0, 0, 0, 0, 0); return code; } @@ -1796,7 +1796,7 @@ icl_ClearSet(name) { afs_int32 code; - code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRSET, (long)name, 0, 0, 0); + code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRSET, (long)name, 0, 0, 0, 0, 0); return code; } @@ -1805,7 +1805,7 @@ icl_ClearAll() { afs_int32 code; - code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRALL, 0, 0, 0, 0); + code = afs_syscall(AFSCALL_ICL, ICL_OP_CLRALL, 0, 0, 0, 0, 0, 0); return code; } @@ -1822,7 +1822,7 @@ icl_ListSets(outFileP) for (i = 0; i < 1000; i++) { code = afs_syscall(AFSCALL_ICL, ICL_OP_ENUMSETS, i, (long)tname, - sizeof(tname), (long)&states); + sizeof(tname), (long)&states, 0, 0); if (code) break; (void)fprintf(outFileP, "%s %s%s%s\n", tname, @@ -1849,14 +1849,14 @@ icl_ListLogs(outFileP, int32flg) for (i = 0; i < 1000; i++) { code = afs_syscall(AFSCALL_ICL, ICL_OP_ENUMLOGS, i, (long)tname, - sizeof(tname), (long)&logSize); + sizeof(tname), (long)&logSize, 0, 0); if (code) break; if (int32flg) { /* get more information on the log */ code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)tname, - (long)&logSize, (long)&allocated, 0); + (long)&logSize, (long)&allocated, 0, 0, 0); if (code) break; (void)fprintf(outFileP, "%s : %d kbytes (%s)\n", tname, @@ -1885,7 +1885,7 @@ icl_ListLogsBySet(outFileP, setname, int32flg) for (i = 0; i < ICL_LOGSPERSET; i++) { code = afs_syscall(AFSCALL_ICL, ICL_OP_ENUMLOGSBYSET, (long)setname, i, - (long)tname, sizeof(tname)); + (long)tname, sizeof(tname), 0, 0); if (code) { if (errno == EBADF) { code = 0; @@ -1897,7 +1897,7 @@ icl_ListLogsBySet(outFileP, setname, int32flg) /* get more information on the log */ code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)tname, - (long)&logSize, (long)&allocated, 0); + (long)&logSize, (long)&allocated, 0, 0, 0); if (code) break; (void)fprintf(outFileP, "%s : %d kbytes (%s)\n", tname, @@ -1918,7 +1918,7 @@ icl_ChangeSetState(name, op) { afs_int32 code; - code = afs_syscall(AFSCALL_ICL, ICL_OP_SETSTAT, (long)name, op, 0, 0); + code = afs_syscall(AFSCALL_ICL, ICL_OP_SETSTAT, (long)name, op, 0, 0, 0, 0); return code; } @@ -1929,7 +1929,7 @@ icl_ChangeAllSetState(op) { afs_int32 code; - code = afs_syscall(AFSCALL_ICL, ICL_OP_SETSTATALL, op, 0, 0, 0); + code = afs_syscall(AFSCALL_ICL, ICL_OP_SETSTATALL, op, 0, 0, 0, 0, 0); return code; } @@ -1943,7 +1943,7 @@ icl_ChangeLogSize(name, logSize) code = afs_syscall(AFSCALL_ICL, ICL_OP_SETLOGSIZE, (long)name, logSize, 0, - 0); + 0, 0, 0); return code; } @@ -1957,7 +1957,7 @@ icl_GetLogsize(logname, logSizeP, allocatedP) afs_int32 code; code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)logname, - (long)logSizeP, (long)allocatedP, 0); + (long)logSizeP, (long)allocatedP, 0, 0, 0); return code; } @@ -1970,7 +1970,7 @@ icl_GetSetState(setname, stateP) afs_int32 code; code = afs_syscall(AFSCALL_ICL, ICL_OP_GETSETINFO, (long)setname, - (long)stateP, 0, 0); + (long)stateP, 0, 0, 0, 0); return code; } @@ -1993,7 +1993,7 @@ icl_TailKernel(outFilep, logname, waitTime) /* get information about the specified log */ code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)logname, - (long)&bufferSize, (long)&allocated, 0); + (long)&bufferSize, (long)&allocated, 0, 0, 0); if (code) { if (errno == ENOENT) (void)fprintf(stderr, "'%s' not found\n", logname); @@ -2030,7 +2030,7 @@ icl_TailKernel(outFilep, logname, waitTime) code = afs_syscall(AFSCALL_ICL, ICL_OP_COPYOUTCLR, (long)logname, (long)(bufferp + nwords), bufferSize - nwords, - (long)&i); + (long)&i, 0, 0); if (code < 0) { /* otherwise we've got an error */ fprintf(stderr, "returned error %d dumping log.\n", errno); @@ -2078,7 +2078,7 @@ icl_TailKernel(outFilep, logname, waitTime) /* see if things have changed */ code = afs_syscall(AFSCALL_ICL, ICL_OP_GETLOGINFO, (long)logname, - (long)&newBufferSize, (long)&allocated, 0); + (long)&newBufferSize, (long)&allocated, 0, 0, 0); if (code) { if (errno == ENOENT) (void)fprintf(stderr, "'%s' not found\n", logname); diff --git a/src/venus/test/getinitparams.c b/src/venus/test/getinitparams.c index 89f4800..03aa774 100644 --- a/src/venus/test/getinitparams.c +++ b/src/venus/test/getinitparams.c @@ -41,7 +41,7 @@ GetInitParamsCmd(struct cmd_syndesc *as, void *arock) int code; int len; char *file = 0; - int fd; + int fd = 0; if (as->parms[0].items) { file = as->parms[0].items->data; diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index cd2e27e..d2f418b 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -7151,11 +7151,11 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, afs_sfsize_t tlen; /* temp for xfr length */ Inode tinode; /* inode for I/O */ afs_int32 optSize; /* optimal transfer size */ - afs_sfsize_t DataLength; /* size of inode */ + afs_sfsize_t DataLength = 0; /* size of inode */ afs_sfsize_t TruncatedLength; /* size after ftruncate */ 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 linkCount = 0; /* link count on inode */ FdHandle_t *fdP; struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ diff --git a/src/viced/callback.c b/src/viced/callback.c index 3bfa2ff..84305ad 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -532,7 +532,7 @@ AddCallBack1_r(struct host *host, AFSFid * fid, afs_uint32 * thead, int type, struct FileEntry *fe; struct CallBack *cb = 0, *lastcb = 0; struct FileEntry *newfe = 0; - afs_uint32 time_out; + afs_uint32 time_out = 0; afs_uint32 *Thead = thead; struct CallBack *newcb = 0; int safety; diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index a2fc38b..4bf14f5 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -1131,7 +1131,7 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries) return VL_SIZEEXCEEDED; } } else { - afs_int32 nextblockindex = 0, count = 0, k, match = 0; + afs_int32 nextblockindex = 0, count = 0, k = 0, match = 0; while (nextblockindex = NextEntry(trans, nextblockindex, &tentry, &count)) { if (++pollcount > 50) { @@ -1271,7 +1271,7 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries) return VL_SIZEEXCEEDED; } } else { - afs_int32 nextblockindex = 0, count = 0, k, match = 0; + afs_int32 nextblockindex = 0, count = 0, k = 0, match = 0; while (nextblockindex = NextEntry(trans, nextblockindex, &tentry, &count)) { if (++pollcount > 50) { @@ -1371,12 +1371,14 @@ SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, struct ubik_trans *trans; struct nvlentry tentry; struct nvldbentry *Vldbentry = 0, *VldbentryFirst = 0, *VldbentryLast = 0; - afs_int32 blockindex = 0, count = 0, k, match, matchindex; + afs_int32 blockindex = 0, count = 0, k, match; + afs_int32 matchindex = 0; int serverindex = -1; /* no server found */ int findserver = 0, findpartition = 0, findflag = 0, findname = 0; char *t; int pollcount = 0; - int namematchRWBK, namematchRO, thismatch, matchtype; + int namematchRWBK, namematchRO, thismatch; + int matchtype = 0; char volumename[VL_MAXNAMELEN]; #ifdef HAVE_POSIX_REGEX regex_t re; @@ -1640,7 +1642,8 @@ SVL_LinkedList(rxcall, attributes, nentries, vldbentries) struct ubik_trans *trans; struct nvlentry tentry; vldblist vllist, *vllistptr; - afs_int32 blockindex, count, k, match; + afs_int32 blockindex, count, match; + afs_int32 k = 0; int serverindex; int pollcount = 0; @@ -1768,7 +1771,8 @@ SVL_LinkedListN(rxcall, attributes, nentries, vldbentries) struct ubik_trans *trans; struct nvlentry tentry; nvldblist vllist, *vllistptr; - afs_int32 blockindex, count, k, match; + afs_int32 blockindex, count, match; + afs_int32 k = 0; int serverindex; int pollcount = 0; @@ -1974,8 +1978,9 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) afs_uint32 addrs[VL_MAXIPADDRS_PERMH]; afs_int32 fbase; int count, willChangeEntry, foundUuidEntry, willReplaceCnt; - int WillReplaceEntry, WillChange[MAXSERVERID + 1], FoundUuid, - ReplaceEntry; + int WillReplaceEntry, WillChange[MAXSERVERID + 1]; + int FoundUuid = 0; + int ReplaceEntry = 0; int srvidx, mhidx; COUNT_REQ(VLREGADDR); @@ -3136,8 +3141,9 @@ ChangeIPAddr(ipaddr1, ipaddr2, atrans) { int i, j; afs_int32 code; - struct extentaddr *exp; - int base, index, mhidx; + struct extentaddr *exp = NULL; + int base = 0; + int index, mhidx; afsUUID tuuid; afs_int32 blockindex, count; int pollcount = 0; diff --git a/src/vol/clone.c b/src/vol/clone.c index c1bf016..a8d93a0 100644 --- a/src/vol/clone.c +++ b/src/vol/clone.c @@ -168,10 +168,12 @@ DoCloneIndex(Volume * rwvp, Volume * clvp, VnodeClass class, int reclone) char buf[SIZEOF_LARGEDISKVNODE], dbuf[SIZEOF_LARGEDISKVNODE]; struct VnodeDiskObject *rwvnode = (struct VnodeDiskObject *)buf; struct VnodeDiskObject *clvnode = (struct VnodeDiskObject *)dbuf; - Inode rwinode, clinode; + Inode rwinode = 0; + Inode clinode; struct clone_head decHead; struct clone_rock decRock; - afs_int32 offset, dircloned, inodeinced; + afs_int32 offset = 0; + afs_int32 dircloned, inodeinced; struct VnodeClassInfo *vcp = &VnodeClassInfo[class]; int ReadWriteOriginal = VolumeWriteable(rwvp); diff --git a/src/vol/vnode.c b/src/vol/vnode.c index 2936d97..7cb6e06 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -109,9 +109,8 @@ extern int LogLevel; static afs_int32 theLog[THELOGSIZE]; static afs_int32 vnLogPtr = 0; void -VNLog(aop, anparms, av1, av2, av3, av4) - afs_int32 aop, anparms; - afs_int32 av1, av2, av3, av4; +VNLog(afs_int32 aop, afs_int32 anparms, afs_int32 av1, afs_int32 av2, + afs_int32 av3, afs_int32 av4) { register afs_int32 temp; afs_int32 data[4]; @@ -487,7 +486,7 @@ VGetFreeVnode_r(struct VnodeClassInfo * vcp) if (Vn_refcount(vnp) != 0 || CheckLock(&vnp->lock)) Abort("VGetFreeVnode_r: locked vnode in lruq"); #endif - VNLog(1, 2, Vn_id(vnp), (afs_int32) vnp); + VNLog(1, 2, Vn_id(vnp), (afs_int32) vnp, 0, 0); /* * it's going to be overwritten soon enough. @@ -654,13 +653,13 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type) */ vnrehash: - VNLog(2, 1, vnodeNumber); + VNLog(2, 1, vnodeNumber, 0, 0, 0); /* Prepare to move it to the new hash chain */ vnp = VLookupVnode(vp, vnodeNumber); if (vnp) { /* slot already exists. May even not be in lruq (consider store file locking a file being deleted) * so we may have to wait for it below */ - VNLog(3, 2, vnodeNumber, (afs_int32) vnp); + VNLog(3, 2, vnodeNumber, (afs_int32) vnp, 0, 0); VnCreateReservation_r(vnp); if (Vn_refcount(vnp) == 1) { @@ -817,13 +816,13 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type) } sane: - VNLog(4, 2, vnodeNumber, (afs_int32) vnp); + VNLog(4, 2, vnodeNumber, (afs_int32) vnp, 0, 0); #ifndef AFS_DEMAND_ATTACH_FS AddToVnHash(vnp); #endif } - VNLog(5, 1, (afs_int32) vnp); + VNLog(5, 1, (afs_int32) vnp, 0, 0, 0); memset(&vnp->disk, 0, sizeof(vnp->disk)); vnp->changed_newTime = 0; /* set this bit when vnode is updated */ vnp->changed_oldTime = 0; /* set this on CopyOnWrite. */ @@ -1119,7 +1118,7 @@ VGetVnode_r(Error * ec, Volume * vp, VnodeId vnodeNumber, int locktype) return NULL; } - VNLog(100, 1, vnodeNumber); + VNLog(100, 1, vnodeNumber, 0, 0, 0); #ifdef AFS_DEMAND_ATTACH_FS /* @@ -1167,7 +1166,7 @@ VGetVnode_r(Error * ec, Volume * vp, VnodeId vnodeNumber, int locktype) if (vnp) { /* vnode is in cache */ - VNLog(101, 2, vnodeNumber, (afs_int32) vnp); + VNLog(101, 2, vnodeNumber, (afs_int32) vnp, 0, 0); VnCreateReservation_r(vnp); #ifdef AFS_DEMAND_ATTACH_FS @@ -1254,7 +1253,7 @@ VGetVnode_r(Error * ec, Volume * vp, VnodeId vnodeNumber, int locktype) /* Check that the vnode hasn't been removed while we were obtaining * the lock */ - VNLog(102, 2, vnodeNumber, (afs_int32) vnp); + VNLog(102, 2, vnodeNumber, (afs_int32) vnp, 0, 0); if ((vnp->disk.type == vNull) || (Vn_cacheCheck(vnp) == 0)) { VnUnlock(vnp, locktype); VnCancelReservation_r(vnp); @@ -1317,7 +1316,7 @@ VPutVnode_r(Error * ec, register Vnode * vnp) class = vnodeIdToClass(Vn_id(vnp)); vcp = &VnodeClassInfo[class]; assert(vnp->disk.vnodeMagic == vcp->magic); - VNLog(200, 2, Vn_id(vnp), (afs_int32) vnp); + VNLog(200, 2, Vn_id(vnp), (afs_int32) vnp, 0, 0); #ifdef AFS_DEMAND_ATTACH_FS writeLocked = (Vn_state(vnp) == VN_STATE_EXCLUSIVE); @@ -1336,7 +1335,7 @@ VPutVnode_r(Error * ec, register Vnode * vnp) VNLog(201, 2, (afs_int32) vnp, ((vnp->changed_newTime) << 1) | ((vnp-> changed_oldTime) << 1) | vnp-> - delete); + delete, 0, 0); if (thisProcess != vnp->writer) Abort("VPutVnode: Vnode at 0x%x locked by another process!\n", vnp); @@ -1351,7 +1350,7 @@ VPutVnode_r(Error * ec, register Vnode * vnp) /* No longer any directory entries for this vnode. Free the Vnode */ memset(&vnp->disk, 0, sizeof(vnp->disk)); /* delete flag turned off further down */ - VNLog(202, 2, Vn_id(vnp), (afs_int32) vnp); + VNLog(202, 2, Vn_id(vnp), (afs_int32) vnp, 0, 0); } else if (vnp->changed_newTime) { vnp->disk.serverModifyTime = now; } @@ -1458,7 +1457,7 @@ VVnodeWriteToRead_r(Error * ec, register Vnode * vnp) class = vnodeIdToClass(Vn_id(vnp)); vcp = &VnodeClassInfo[class]; assert(vnp->disk.vnodeMagic == vcp->magic); - VNLog(300, 2, Vn_id(vnp), (afs_int32) vnp); + VNLog(300, 2, Vn_id(vnp), (afs_int32) vnp, 0, 0); #ifdef AFS_DEMAND_ATTACH_FS writeLocked = (Vn_state(vnp) == VN_STATE_EXCLUSIVE); @@ -1473,7 +1472,7 @@ VVnodeWriteToRead_r(Error * ec, register Vnode * vnp) VNLog(301, 2, (afs_int32) vnp, ((vnp->changed_newTime) << 1) | ((vnp-> changed_oldTime) << 1) | vnp-> - delete); + delete, 0, 0); /* sanity checks */ #ifdef AFS_PTHREAD_ENV diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 5f824e4..96a4dfe 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -519,7 +519,8 @@ static int DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP) { int code = 0, error = 0; - afs_int32 pad = 0, offset; + afs_int32 pad = 0; + afs_int32 offset = 0; afs_sfsize_t n, nbytes, howMany, howBig; afs_foff_t lcode = 0; byte *p; diff --git a/src/volser/vol-dump.c b/src/volser/vol-dump.c index 7376257..0d5d2b4 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -543,7 +543,8 @@ static int DumpFile(int dumpfd, int vnode, FdHandle_t * handleP, struct VnodeDiskObject *v) { int code = 0, failed_seek = 0, failed_write = 0; - afs_int32 pad = 0, offset; + afs_int32 pad = 0; + afs_int32 offset = 0; afs_sfsize_t n, nbytes, howMany, howBig; byte *p; #ifndef AFS_NT40_ENV diff --git a/src/volser/vos.c b/src/volser/vos.c index 30fbc83..f75913d 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -1133,7 +1133,7 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet) int quiet; { int totalOK, totalNotOK, totalBusy, i; - afs_int32 volid; + afs_int32 volid = 0; totalOK = 0; totalNotOK = 0; @@ -1210,7 +1210,7 @@ XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast, int totalNotOK; /*Total screwed volumes */ int totalBusy; /*Total busy volumes */ int i; /*Loop variable */ - afs_int32 volid; /*Current volume ID */ + afs_int32 volid = 0; /*Current volume ID */ /* * Initialize counters and (global!!) queues. @@ -1301,7 +1301,7 @@ XDisplayVolumes2(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast, int totalNotOK; /*Total screwed volumes */ int totalBusy; /*Total busy volumes */ int i; /*Loop variable */ - afs_int32 volid; /*Current volume ID */ + afs_int32 volid = 0; /*Current volume ID */ /* * Initialize counters and (global!!) queues. @@ -2901,7 +2901,8 @@ RestoreVolume(register struct cmd_syndesc *as, void *arock) afs_int32 avolid, aparentid, aserver, apart, code, vcode, err; afs_int32 aoverwrite = ASK; afs_int32 acreation = 0, alastupdate = 0; - int restoreflags, readonly = 0, offline = 0, voltype = RWVOL; + int restoreflags = 0; + int readonly = 0, offline = 0, voltype = RWVOL; char prompt; char afilename[MAXPATHLEN], avolname[VOLSER_MAXVOLNAME + 1], apartName[10]; char volname[VOLSER_MAXVOLNAME + 1]; @@ -3532,11 +3533,13 @@ ListVolumes(register struct cmd_syndesc *as, void *arock) { afs_int32 apart, int32list, fast; afs_int32 aserver, code; - volintInfo *pntr, *oldpntr; + volintInfo *pntr; + volintInfo *oldpntr = NULL; afs_int32 count; int i; char *base; - volintXInfo *xInfoP, *origxInfoP; /*Ptr to current/orig extended vol info */ + volintXInfo *xInfoP; + volintXInfo *origxInfoP = NULL; /*Ptr to current/orig extended vol info */ int wantExtendedInfo; /*Do we want extended vol info? */ char pname[10]; @@ -4146,7 +4149,7 @@ GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *vo static int DeleteEntry(register struct cmd_syndesc *as, void *arock) { - afs_int32 apart; + afs_int32 apart = 0; afs_int32 avolid; afs_int32 vcode; struct VldbListByAttributes attributes; @@ -4375,7 +4378,9 @@ ListVLDB(struct cmd_syndesc *as, void *arock) struct VldbListByAttributes attributes; nbulkentries arrayEntries; struct nvldbentry *vllist, *tarray = 0, *ttarray; - afs_int32 centries, nentries = 0, tarraysize, parraysize; + afs_int32 centries, nentries = 0; + afs_int32 tarraysize = 0; + afs_int32 parraysize; int j; char pname[10]; int quiet, sort, lock; @@ -4555,7 +4560,7 @@ BackSys(register struct cmd_syndesc *as, void *arock) int comp = 0; struct cmd_item *ti; char *ccode; - int match; + int match = 0; memset(&attributes, 0, sizeof(struct VldbListByAttributes)); attributes.Mask = 0; @@ -4869,7 +4874,8 @@ static int UnlockVLDB(register struct cmd_syndesc *as, void *arock) { afs_int32 apart; - afs_int32 aserver, code; + afs_int32 aserver = NULL; + afs_int32 code; afs_int32 vcode; struct VldbListByAttributes attributes; nbulkentries arrayEntries; @@ -5361,12 +5367,12 @@ ConvertRO(register struct cmd_syndesc *as, void *arock) afs_int32 server, volid, code, i, same; struct nvldbentry entry, storeEntry; afs_int32 vcode; - afs_int32 rwindex; + afs_int32 rwindex = 0; afs_int32 rwserver = 0; - afs_int32 rwpartition; - afs_int32 roindex; + afs_int32 rwpartition = 0; + afs_int32 roindex = 0; afs_int32 roserver = 0; - afs_int32 ropartition; + afs_int32 ropartition = 0; int force = 0; struct rx_connection *aconn; char c, dc;