From a35279d3146688498bfabec9957a5fd47d6246de Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Wed, 13 Dec 2000 21:36:06 +0000 Subject: [PATCH] warning-fixes-20001213 Various fixes to eliminate warnings --- src/afs/LINUX/osi_alloc.c | 5 +++-- src/afs/LINUX/osi_groups.c | 2 +- src/afs/LINUX/osi_sleep.c | 3 ++- src/afs/UKERNEL/osi_vfsops.c | 4 ++-- src/afs/UKERNEL/sysincludes.h | 6 ++++++ src/afs/VNOPS/afs_vnop_readdir.c | 2 +- src/afs/afs_call.c | 2 +- src/afs/afs_daemons.c | 2 +- src/afs/afs_pioctl.c | 4 ++-- src/afs/afs_server.c | 2 +- src/auth/cellconfig.c | 5 ++++- src/ftpd43+/ftpd.c | 1 + src/ftpd43+/getusershell.c | 20 +++++++++++++------- src/ftpd43+/glob.c | 2 ++ src/inetd/inetd.c | 2 +- src/kauth/admin_tools.c | 21 +++++++++++---------- src/kauth/kaprocs.c | 12 +++++++----- src/kauth/rebuild.c | 5 +++-- src/lwp/lwp.c | 2 +- src/ptserver/db_verify.c | 2 +- src/ptserver/ptprocs.c | 6 +++--- src/ptserver/pts.c | 4 +++- src/ptserver/ptutils.c | 22 ++++++++++------------ src/ptserver/testpt.c | 4 ++-- src/ptserver/utils.c | 24 ++++++++++++------------ src/rsh/rcmd.c | 2 +- src/rx/rx_globals.h | 1 - src/rx/rx_lwp.c | 4 ++-- src/rx/rx_pthread.c | 2 ++ src/rxgen/rpc_parse.c | 1 + src/rxkad/rxkad_server.c | 2 +- src/sys/rmtsysc.c | 3 ++- src/ubik/ubikclient.c | 2 +- src/usd/usd_file.c | 8 ++++---- src/vlserver/vlserver.c | 2 +- src/vol/vol-salvage.c | 2 +- src/vol/volume.c | 2 +- src/vol/vutil.c | 2 +- src/volser/dumpstuff.c | 13 +++++++------ 39 files changed, 119 insertions(+), 91 deletions(-) diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index 75d7498..3b8d6dc 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -199,14 +199,15 @@ static int linux_alloc_init() { /* initiate our pool of osi_linux_mem structs */ al_mem_pool = afs_atomlist_create(sizeof(struct osi_linux_mem), - sizeof(long)*1024, vmalloc, local_free); + sizeof(long)*1024, (void *)vmalloc, + local_free); if (!al_mem_pool) { printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n"); return 0; } /* initialize the hash table to hold references to alloc'ed chunks */ - lh_mem_htab = afs_lhash_create(hash_equal, vmalloc, local_free); + lh_mem_htab = afs_lhash_create(hash_equal, (void *)vmalloc, local_free); if (!lh_mem_htab) { printf("afs_osi_Alloc: Error in initialization(lhash_create)\n"); return 0; diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 446eaed..09b97f7 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -101,7 +101,7 @@ asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist) { int code; cred_t *cr = crref(); - int junk; + afs_uint32 junk; int old_pag; lock_kernel(); diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index f1b75d8..9acd27a 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -16,9 +16,10 @@ #if defined(AFS_GLOBAL_SUNLOCK) static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); +#endif + void afs_osi_Wakeup(char *event); void afs_osi_Sleep(char *event); -#endif static char waitV; diff --git a/src/afs/UKERNEL/osi_vfsops.c b/src/afs/UKERNEL/osi_vfsops.c index c32c494..e146b2c 100644 --- a/src/afs/UKERNEL/osi_vfsops.c +++ b/src/afs/UKERNEL/osi_vfsops.c @@ -49,7 +49,7 @@ afs_mount(afsp, path, data) afs_globalVFS = afsp; afsp->vfs_bsize = 8192; afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = AFS_VFSFSID; + afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID; return 0; } @@ -113,7 +113,7 @@ afs_statfs(afsp, abp) abp->f_type = 0; abp->f_bsize = afsp->vfs_bsize; abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - abp->f_fsid.val[1] = AFS_VFSFSID; + abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID; return 0; } diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 2a5e935..6b4d953 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -197,10 +197,16 @@ #define EXCL usr_EXCL #define NONEXCL usr_NONEXCL #define uio_rw usr_uio_rw +#ifdef ino_t +#undef ino_t +#endif #define ino_t usr_ino_t #define offset_t usr_offset_t #define getpid() usr_getpid() #define setpag(A,B,C,D) usr_setpag((A),(B),(C),(D)) +#ifdef pid_t +#undef pid_t +#endif #define pid_t int enum usr_vcexcl { usr_NONEXCL, usr_EXCL }; diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index 3c2e370..d2bbbf5 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -637,7 +637,7 @@ tagain: } #else /* AFS_HPUX_ENV */ code = afs_readdir_move(ode, avc, auio, o_slen, -#ifdef defined(AFS_SUN5_ENV) +#if defined(AFS_SUN5_ENV) len, origOffset); #else auio->afsio_resid, origOffset); diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 652e407..1792e2c 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -1114,7 +1114,7 @@ afs_shutdown() { extern short afs_brsDaemons; extern afs_int32 afs_CheckServerDaemonStarted; - extern struct osi_WaitHandle AFS_WaitHandler, AFS_CSWaitHandler; + extern struct afs_osi_WaitHandle AFS_WaitHandler, AFS_CSWaitHandler; extern struct osi_file *afs_cacheInodep; AFS_STATCNT(afs_shutdown); diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 766d57c..9810b7f 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -353,7 +353,7 @@ void BPath(ab) #ifdef AFS_LINUX22_ENV code = gop_lookupname((char *)ab->parm[0], AFS_UIOSYS, 1, (struct vnode **) 0, &dp); if (dp) - tvn = (struct vcache*)dp->d_inode; + tvn = (struct vnode*)dp->d_inode; #else code = gop_lookupname((char *)ab->parm[0], AFS_UIOSYS, 1, (struct vnode **) 0, (struct vnode **)&tvn); #endif diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index fe5c9b5..b48eca1 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -792,7 +792,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) #ifdef AFS_LINUX22_ENV code = gop_lookupname(path, AFS_UIOUSER, follow, (struct vnode **) 0, &dp); if (!code) - vp = (struct vcache *)dp->d_inode; + vp = (struct vnode *)dp->d_inode; #else code = gop_lookupname(path, AFS_UIOUSER, follow, (struct vnode **) 0, &vp); #endif /* AFS_LINUX22_ENV */ @@ -2753,7 +2753,7 @@ static int afs_setsprefs(sp, num, vlonly) /* Note that it doesn't have a cell yet... */ if (!matches) { afs_uint32 temp = sp->host.s_addr; - srvr = afs_GetServer(&temp, 1, NULL, (vlonly ? AFS_VLPORT : AFS_FSPORT), + srvr = afs_GetServer(&temp, 1, 0, (vlonly ? AFS_VLPORT : AFS_FSPORT), WRITE_LOCK, (afsUUID *)0,0); srvr->addr->sa_iprank = sp->rank + afs_randomMod15(); afs_PutServer(srvr, WRITE_LOCK); diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index e2ddf74..84a3b35 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -702,7 +702,7 @@ NB: Has to be unsigned, since shifts on signed quantities may preserve clients. This is probably OK, but I don't want to see too much of it. */ -#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1) +#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1) extern afs_int32 rxi_getaddr(); unsigned int afs_random() diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index c3356b5..c05cd53 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -40,6 +40,9 @@ static ParseHostLine(); static ParseCellLine(); +static afsconf_OpenInternal(); +static afsconf_CloseInternal(); +static afsconf_Reopen(); static struct afsconf_servPair serviceTable [] = { "afs", 7000, @@ -195,7 +198,7 @@ register struct afsconf_dir *adir; { #ifdef AFS_NT40_ENV return _utime(tbuffer, NULL); #else - gettimeofday(&tvp[0], (char *) 0); + gettimeofday(&tvp[0], NULL); tvp[1] = tvp[0]; return utimes(tbuffer, tvp); #endif /* AFS_NT40_ENV */ diff --git a/src/ftpd43+/ftpd.c b/src/ftpd43+/ftpd.c index a67c272..24e752c 100644 --- a/src/ftpd43+/ftpd.c +++ b/src/ftpd43+/ftpd.c @@ -61,6 +61,7 @@ static char sccsid[] = "@(#)ftpd.c 5.27.1.1 (Berkeley) 3/2/89"; #include #include #include +#include #include #if defined(AIX) #include diff --git a/src/ftpd43+/getusershell.c b/src/ftpd43+/getusershell.c index 0f6f756..6409dbf 100644 --- a/src/ftpd43+/getusershell.c +++ b/src/ftpd43+/getusershell.c @@ -35,7 +35,7 @@ static char *okshells[] = static char **shells, *strings; static char **curshell = NULL; -extern char **initshells(); +static char **initshells(); /* * Get a list of shells from SHELLS, if it exists. @@ -65,12 +65,6 @@ endusershell() curshell = NULL; } -setusershell() -{ - - curshell = initshells(); -} - static char ** initshells() { @@ -118,3 +112,15 @@ initshells() (void)fclose(fp); return (shells); } + +setusershell() +{ + + curshell = initshells(); +} + + + + + + diff --git a/src/ftpd43+/glob.c b/src/ftpd43+/glob.c index fa79f1c..9367a7c 100644 --- a/src/ftpd43+/glob.c +++ b/src/ftpd43+/glob.c @@ -93,6 +93,8 @@ char **copyblk(register char **); static char *strend(register char *); int gethdir(char *); +static addpath(); +static rscan(); #ifdef notdef static addpath(char); diff --git a/src/inetd/inetd.c b/src/inetd/inetd.c index df6420c..abe25fe 100644 --- a/src/inetd/inetd.c +++ b/src/inetd/inetd.c @@ -1029,7 +1029,7 @@ machtime() fprintf(stderr, "Unable to get time of day\n"); return (0L); } - return (htonl((afs_int32)tv.tv_sec + 2208988800)); + return (htonl((afs_int32)tv.tv_sec + 2208988800U)); } /* ARGSUSED */ diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index 7e62c12..46c6300 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -169,7 +169,7 @@ int DumpUser ( if ((!ka_KeyIsZero((char *) &tentry.key, sizeof(tentry.key))) && (showkey)) { printf (" key (%d):", tentry.key_version); - ka_PrintBytes (&tentry.key, sizeof(tentry.key)); + ka_PrintBytes ((char *)&tentry.key, sizeof(tentry.key)); } else { if (tentry.keyCheckSum == 0) @@ -704,7 +704,7 @@ int StringToKey ( printf ("Converting %s in realm '%s' yields key='", as->parms[0].items->data, realm); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf ("'.\n"); return 0; @@ -745,9 +745,10 @@ int SetPassword ( ka_StringToKey (as->parms[1].items->data, realm, &key); } else if (as->parms[2].items) { - if (ka_ReadBytes (as->parms[2].items->data, &key, sizeof(key)) != 8) { + if (ka_ReadBytes (as->parms[2].items->data, (char *)&key, sizeof(key)) + != 8) { printf ("Key must be 8 bytes: '%s' was too long\n", - as->parms[2].items->data); + as->parms[2].items->data); return KABADCMD; } } @@ -890,10 +891,10 @@ static afs_int32 ListTicket ( } if (verbose) { printf ("SessionKey: "); - ka_PrintBytes (&token.sessionKey, sizeof(token.sessionKey)); + ka_PrintBytes ((char *)&token.sessionKey, sizeof(token.sessionKey)); printf ("\nTicket (kvno = %d, len = %d): ", token.kvno, token.ticketLen); - ka_PrintBytes (token.ticket, token.ticketLen); + ka_PrintBytes ((char *)token.ticket, token.ticketLen); printf ("\n"); } return 0; @@ -982,7 +983,7 @@ static GetPassword ( ubik_ClientDestroy(lpbkConn); if (code) goto abort; printf ("Key: "); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf ("\n"); return code; } @@ -999,7 +1000,7 @@ int GetRandomKey ( else { int i; printf ("Key: "); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf (" ("); for (i=0; iname,"help")) return; @@ -1187,7 +1188,7 @@ void MyAfterProc( conn = 0; } - return; + return 0; } int init = 0, noauth; diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 40aaf86..562fba9 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -142,7 +142,8 @@ static afs_int32 get_time (timeP, tt, admin) &key, 0, 0); if (code == 0) { des_init_random_number_generator (&key); - ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key)); + ka_ConvertBytes (buf, sizeof(buf), (char *)&key, + sizeof(key)); es_Report ("New Admin key is %s\n", buf); } else { es_Report ("in get_time: set_password failed because: %d\n", code); @@ -159,7 +160,8 @@ static afs_int32 get_time (timeP, tt, admin) des_fixup_key_parity (&key); code = set_password (tt, KA_TGS_NAME, lrealm, &key, 0, 0); if (code == 0) { - ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key)); + ka_ConvertBytes (buf, sizeof(buf), (char *)&key, + sizeof(key)); es_Report ("New TGS key is %s\n", buf); } else { es_Report ("in get_time: set_password failed because: %s\n", error_message (code)); @@ -720,7 +722,7 @@ impose_reuse_limits ( password, tentry ) if (!bcmp(password, &(tentry->key), sizeof(EncryptionKey))) return KAREUSED; - code = ka_KeyCheckSum (password, &newsum); + code = ka_KeyCheckSum ((char *)password, &newsum); if (code) return code; @@ -759,7 +761,7 @@ set_password (tt, name, instance, password, kvno, caller) /* do nothing, no limits */ ; } else { - code = ka_KeyCheckSum (&(tentry.key), &newsum); + code = ka_KeyCheckSum ((char *)&(tentry.key), &newsum); if (code) return code; for (i=npwSums-1; i ; i--) @@ -1551,7 +1553,7 @@ afs_int32 kamGetEntry (call, aname, ainstance, aversion, aentry) (callerIsAdmin && enc_level == rxkad_crypt)) bcopy (&tentry.key, &aentry->key, sizeof(struct ktc_encryptionKey)); else bzero (&aentry->key, sizeof(aentry->key)); - code = ka_KeyCheckSum (&tentry.key, &aentry->keyCheckSum); + code = ka_KeyCheckSum ((char *)&tentry.key, &aentry->keyCheckSum); if (!tentry.pwsums[0] && npwSums > 1 && !tentry.pwsums[1]) { aentry->reserved3 = 0x12340000; } else { diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index bf06146..bc74383 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -176,7 +176,7 @@ PrintEntry(index, entry) printf(" Key Version = %d\n", entry->key_version); printf(" Key = "); - ka_PrintBytes (&entry->key, sizeof(entry->key)); + ka_PrintBytes ((char *)&entry->key, sizeof(entry->key)); printf("\n"); /* What about asServer structs and such and misc_ath_bytes */ @@ -229,7 +229,8 @@ RebuildEntry(entryp) fprintf(out, "create -name %s", EntryName(entryp)); - ka_ConvertBytes (key, sizeof(key), &entryp->key, sizeof(entryp->key)); + ka_ConvertBytes (key, sizeof(key), (char *)&entryp->key, + sizeof(entryp->key)); fprintf(out, " -initial_password foo\n", key); strcpy(flags,""); diff --git a/src/lwp/lwp.c b/src/lwp/lwp.c index aa1de78..41d0682 100644 --- a/src/lwp/lwp.c +++ b/src/lwp/lwp.c @@ -914,7 +914,7 @@ static void Initialize_PCB(temp, priority, stack, stacksize, ep, parm, name) temp -> misc = NULL; /* currently unused */ temp -> next = NULL; temp -> prev = NULL; - temp -> lwp_rused = NULL; + temp -> lwp_rused = 0; temp -> level = 1; /* non-preemptable */ } diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index fceb556..7e98bab 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -95,7 +95,7 @@ afs_int32 ReadHeader() } /* Check and see if database exists and is approximately OK. */ if (ntohl(cheader.headerSize) != sizeof(cheader) || - ntohl(cheader.eofPtr) == NULL) { + ntohl(cheader.eofPtr) == 0) { if (code) return code; com_err (whoami, PRDBBAD, "header is bad"); return PRDBBAD; diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 9e98967..33654cc 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -45,6 +45,7 @@ afs_int32 listEntries(), changeEntry(), setFieldsEntry(), put_prentries(); afs_int32 listElements(), listOwned(), isAMemberOf(), idToName(); static stolower(); +extern afs_int32 IDCmp(); /* When abort, reset initd so that the header is read in on next call. * Abort the transarction and return the code. @@ -593,7 +594,7 @@ afs_int32 Delete (call, aid) /* Delete each continuation block as a separate transaction so that no one * transaction become to large to complete. */ nptr = tentry.next; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { struct contentry centry; int i; @@ -636,7 +637,7 @@ afs_int32 Delete (call, aid) * transaction, we start a new transaction every 50 entries. */ count = 0; nptr = tentry.owned; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { struct prentry nentry; code = pr_ReadEntry (tt, 0, nptr, &nentry); @@ -1650,7 +1651,6 @@ afs_int32 addWildCards(tt,alist,host) afs_int32 hostid; int size = 0, i, code; int added = 0; - extern afs_int32 IDCmp(); while (host = (host & wild)) { wild = htonl ( ntohl(wild) << 8) ; diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 52a00bc..23b9884 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -78,13 +78,15 @@ int GetGlobals (as) return code; } -void CleanUp (as) +int CleanUp (as) register struct cmd_syndesc *as; { if (!strcmp(as->name,"help")) return; /* Need to shutdown the ubik_client & other connections */ pr_End(); rx_Finalize(); + + return 0; } CreateGroup (as) diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index 8f4e954..5c8badb 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -32,6 +32,7 @@ extern struct ubik_dbase *dbase; extern struct afsconf_dir *prdir; extern int pr_noAuth; +extern afs_int32 IDCmp(); extern afs_int32 AddToEntry(); static char *whoami = "ptserver"; @@ -444,7 +445,7 @@ afs_int32 RemoveFromEntry (at, aid, bid) } hloc = 0; nptr = tentry.next; - while (nptr != NULL) { + while (nptr != 0) { code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; if ((centry.id != bid) || !(centry.flags & PRCONT)) return PRDBBAD; @@ -526,7 +527,7 @@ afs_int32 DeleteEntry (at, tentry, loc) if (code) return code; } nptr = tentry->next; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return PRDBFAIL; for (i=0;inext; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { code = pr_ReadCoEntry(tt,0,nptr,&nentry); if (code != 0) return code; last = nptr; @@ -693,7 +694,7 @@ afs_int32 AddToEntry (tt, entry, loc, aid) bzero(&aentry,sizeof(aentry)); aentry.flags |= PRCONT; aentry.id = entry->id; - aentry.next = NULL; + aentry.next = 0; aentry.entries[0] = aid; code = pr_WriteCoEntry(tt,0,nptr,&aentry); if (code != 0) return code; @@ -739,7 +740,6 @@ afs_int32 GetList (at, tentry, alist, add) afs_int32 nptr; int size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -752,7 +752,7 @@ afs_int32 GetList (at, tentry, alist, add) if (code) return code; } - for (nptr = tentry->next; nptr != NULL; nptr = centry.next) { + for (nptr = tentry->next; nptr != 0; nptr = centry.next) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; @@ -795,7 +795,6 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) afs_int32 nptr; afs_int32 size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -808,7 +807,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) } nptr = tentry->next; - while (nptr != NULL) { + while (nptr != (afs_uint32)NULL) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; @@ -831,7 +830,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) if (!code) { nptr = tentry2->next; - while (nptr != NULL) { + while (nptr != (afs_uint32)NULL) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) break; @@ -869,7 +868,6 @@ afs_int32 GetOwnedChain (ut, next, alist) struct prentry tentry; int size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -970,7 +968,7 @@ afs_int32 Initdb() } if ((ntohl(cheader.version) == PRDBVERSION) && ntohl(cheader.headerSize) == sizeof(cheader) && - ntohl(cheader.eofPtr) != NULL && + ntohl(cheader.eofPtr) != (afs_uint32)NULL && FindByID(tt,ANONYMOUSID) != 0){ /* database exists, so we don't have to build it */ code = ubik_EndTrans(tt); @@ -1016,7 +1014,7 @@ afs_int32 Initdb() */ if ((ntohl(cheader.version) == PRDBVERSION) && ntohl(cheader.headerSize) == sizeof(cheader) && - ntohl(cheader.eofPtr) != NULL && + ntohl(cheader.eofPtr) != (afs_uint32)NULL && FindByID(tt,ANONYMOUSID) != 0){ /* database exists, so we don't have to build it */ code = ubik_EndTrans(tt); diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index 3d09368..8b81ad4 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -837,7 +837,7 @@ static char tmp_conf_file[128] = ""; static char tmp_cell_file[128] = ""; static char tmp_noauth_file[128] = ""; -static afs_int32 MyAfterProc (as, arock) +static int MyAfterProc (as, arock) struct cmd_syndesc *as; char *arock; { afs_int32 code; @@ -848,7 +848,7 @@ static afs_int32 MyAfterProc (as, arock) return 0; } -static afs_int32 MyBeforeProc (as, arock) +static int MyBeforeProc (as, arock) struct cmd_syndesc *as; char *arock; { afs_int32 code; diff --git a/src/ptserver/utils.c b/src/ptserver/utils.c index ef456f1..42c1e4a 100644 --- a/src/ptserver/utils.c +++ b/src/ptserver/utils.c @@ -287,7 +287,7 @@ afs_int32 aid; if (code != 0) return 0; if (aid == tentry.id) return entry; entry = tentry.nextID; - while (entry != NULL) { + while (entry != 0) { bzero(&tentry,sizeof(tentry)); code = pr_ReadEntry(at,0,entry,&tentry); if (code != 0) return 0; @@ -317,7 +317,7 @@ struct prentry *tentryp; if (code != 0) return 0; if ((strncmp(aname,tentryp->name,PR_MAXNAMELEN)) == 0) return entry; entry = tentryp->nextName; - while (entry != NULL) { + while (entry != 0) { bzero(tentryp, sizeof(struct prentry)); code = pr_ReadEntry(at,0,entry, tentryp); if (code != 0) return 0; @@ -437,18 +437,18 @@ afs_int32 *loc; /* ??? in case ID hashed twice ??? */ bzero(&tentry,sizeof(tentry)); bzero(&bentry,sizeof(bentry)); trail = 0; - if (current == NULL) return PRSUCCESS; /* already gone */ + if (current == 0) return PRSUCCESS; /* already gone */ code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; while (aid != tentry.id) { trail = current; current = tentry.nextID; - if (current == NULL) break; + if (current == 0) break; code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; } - if (current == NULL) return PRSUCCESS; /* we didn't find him, so he's already gone */ - if (trail == NULL) { + if (current == 0) return PRSUCCESS; /* we didn't find him, so he's already gone */ + if (trail == 0) { /* it's the first entry! */ cheader.idHash[i] = htonl(tentry.nextID); code = pr_Write(tt,0,72+HASHSIZE*4+i*4,(char *)&cheader.idHash[i],sizeof(cheader.idHash[i])); @@ -504,18 +504,18 @@ afs_int32 *loc; bzero(&tentry,sizeof(tentry)); bzero(&bentry,sizeof(bentry)); trail = 0; - if (current == NULL) return PRSUCCESS; /* already gone */ + if (current == 0) return PRSUCCESS; /* already gone */ code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; while (strcmp(aname,tentry.name)) { trail = current; current = tentry.nextName; - if (current == NULL) break; + if (current == 0) break; code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; } - if (current == NULL) return PRSUCCESS; /* we didn't find him, already gone */ - if (trail == NULL) { + if (current == 0) return PRSUCCESS; /* we didn't find him, already gone */ + if (trail == 0) { /* it's the first entry! */ cheader.nameHash[i] = htonl(tentry.nextName); code = pr_Write(tt,0,72+i*4,(char *)&cheader.nameHash[i],sizeof(cheader.nameHash[i])); @@ -609,7 +609,7 @@ afs_int32 RemoveFromOwnerChain(at,gid,oid) le = &thisEntry; lastLoc = 0; nptr = thisEntry.owned; - while (nptr != NULL) { + while (nptr != 0) { if (nptr == lastLoc) te = le; else { if (&thisEntry == le) te = &thatEntry; @@ -690,7 +690,7 @@ afs_int32 gid; nptr = ntohl(cheader.orphan); bzero(&bentry,sizeof(bentry)); loc = 0; - while (nptr != NULL) { + while (nptr != 0) { code = pr_ReadEntry(at,0,nptr,&tentry); if (code != 0) return PRDBFAIL; if (gid == tentry.id) { diff --git a/src/rsh/rcmd.c b/src/rsh/rcmd.c index 759b27d..9772e04 100644 --- a/src/rsh/rcmd.c +++ b/src/rsh/rcmd.c @@ -596,7 +596,7 @@ _checkhost(rhost, lhost, len) nodomain = 1; return(0); } - ldomain[MAXHOSTNAMELEN] = NULL; + ldomain[MAXHOSTNAMELEN] = '\0'; if ((domainp = index(ldomain, '.')) == (char *)NULL) { nodomain = 1; return(0); diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index 2ab62d2..bd467e3 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -274,7 +274,6 @@ struct rx_peer *rxi_FindPeer(); struct rx_call *rxi_NewCall(); void rxi_FreeCall(); struct rx_call *rxi_FindCall(); -void rx_ListenerProc(); int rxi_ReadPacket(); struct rx_packet *rxi_ReceivePacket(); struct rx_packet *rxi_ReceiveDataPacket(); diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index c78d695..6517423 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -54,7 +54,7 @@ void rxi_Wakeup(void *addr) } PROCESS rx_listenerPid; /* LWP process id of socket listener process */ -void rx_ListenerProc(); +static void rx_ListenerProc(void *dummy); /* * Delay the current thread the specified number of seconds. @@ -250,7 +250,7 @@ void rxi_ListenerProc(rfds, tnop, newcallp) /* This is the listener process request loop. The listener process loop * becomes a server thread when rxi_ListenerProc returns, and stays * server thread until rxi_ServerProc returns. */ -static void rx_ListenerProc() +static void rx_ListenerProc(void *dummy) { int threadID; int sock; diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 50b6291..c81f86b 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -49,6 +49,8 @@ static long rx_pthread_n_event_wakeups; */ static int rx_pthread_event_rescheduled = 0; +static void rx_ListenerProc(void *); + /* * We supply an event handling thread for Rx's event processing. * The condition variable is used to wakeup the thread whenever a new diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index e0f272d..a774acd 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -97,6 +97,7 @@ static unsigned_dec(); static def_package(); static def_prefix(); static def_startingopcode(); +static def_statindex(); static def_split(); static customize_struct(); static def_special(); diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c index 6c2e19e..43c232a 100644 --- a/src/rxkad/rxkad_server.c +++ b/src/rxkad/rxkad_server.c @@ -76,7 +76,7 @@ pthread_mutex_t rxkad_random_mutex; static void init_random_int32 () { struct timeval key; - gettimeofday (&key, (char *) 0); + gettimeofday (&key, NULL); LOCK_RM fc_keysched (&key, random_int32_schedule); UNLOCK_RM diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index e832389..9b8fe15 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -201,7 +201,8 @@ struct ViceIoctl *data; { struct rx_connection *conn; clientcred creds; - afs_int32 errorcode, groups[NGROUPS_MAX], errornumber, ins= data->in_size; + afs_int32 errorcode, errornumber, ins= data->in_size; + afs_uint32 groups[NGROUPS_MAX]; rmtbulk InData, OutData; char pathname[256], *pathp = pathname, *inbuffer; #if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */ diff --git a/src/ubik/ubikclient.c b/src/ubik/ubikclient.c index 30499db..253ab62 100644 --- a/src/ubik/ubikclient.c +++ b/src/ubik/ubikclient.c @@ -132,7 +132,7 @@ static void afs_random_once(void) * use time and pid to try to get some initial randomness. */ #if !defined(UKERNEL) -#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1) +#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1) unsigned int afs_random(void) { diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index 9ec145c..a2b4973 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -64,8 +64,8 @@ typedef off_t osi_lloff_t; static int usd_FileRead( usd_handle_t usd, char *buf, - u_int nbytes, - u_int *xferdP) + afs_uint32 nbytes, + afs_uint32 *xferdP) { int fd = (int)(usd->handle); int got; @@ -84,8 +84,8 @@ static int usd_FileRead( static int usd_FileWrite( usd_handle_t usd, char *buf, - u_int nbytes, - u_int *xferdP) + afs_uint32 nbytes, + afs_uint32 *xferdP) { int fd = (int)(usd->handle); int sent; diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 6f6650a..e57e410 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -58,7 +58,7 @@ int LogLevel = 0; int smallMem = 0; int rxJumbograms = 1; /* default is to send and receive jumbo grams */ -CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);} +static void CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);} static CheckSignal() { diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 9d801b2..3b6d84e 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -431,7 +431,7 @@ int SalvageVolumeHeaderFile(register struct InodeSummary *isp, void showlog(void); int UseTheForceLuke(char *path); - +static int IsVnodeOrphaned(VnodeId vnode); /* Uniquifier stored in the Inode */ static Unique IUnique(u) diff --git a/src/vol/volume.c b/src/vol/volume.c index 0d540e3..9ffb550 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -98,7 +98,7 @@ #include #endif /* ITIMER_REAL */ #endif /* AFS_NT40_ENV */ -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV) #include #else #include diff --git a/src/vol/vutil.c b/src/vol/vutil.c index f58fdd1..83b97b3 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -56,7 +56,7 @@ #ifdef AFS_AIX_ENV #include #endif -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV) #include #else #include diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index d5808f3..e44971f 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -673,7 +673,7 @@ static int DumpDumpHeader(register struct iod *iodp, register Volume *vp, if (!code) code = DumpString(iodp, 'n',V_name(vp)); dumpTimes[0] = fromtime; dumpTimes[1] = V_backupDate(vp); /* Until the time the clone was made */ - if (!code) code = DumpArrayInt32(iodp, 't', (unsigned int *)dumpTimes, 2); + if (!code) code = DumpArrayInt32(iodp, 't', (afs_uint32 *)dumpTimes, 2); return code; } @@ -811,7 +811,7 @@ int RestoreVolume(register struct rx_call *call, Volume *avp, register Volume *vp; struct iod iod; register struct iod *iodp = &iod; - int *b1=0, *b2=0; + afs_int32 *b1=0, *b2=0; int s1=0, s2=0, delo=0, tdelo; int tag; @@ -913,7 +913,7 @@ static int ReadVnodes(register struct iod *iodp, Volume *vp, while (tag == D_VNODE) { int haveStuff = 0; bzero(buf, sizeof (buf)); - if (!ReadInt32(iodp, (unsigned int *)&vnodeNumber)) + if (!ReadInt32(iodp, (afs_uint32 *)&vnodeNumber)) break; ReadInt32(iodp, &vnode->uniquifier); @@ -946,7 +946,7 @@ static int ReadVnodes(register struct iod *iodp, Volume *vp, ReadInt32(iodp, &vnode->owner); break; case 'g': - ReadInt32(iodp, (unsigned int *)&vnode->group); + ReadInt32(iodp, (afs_uint32 *)&vnode->group); break; case 'b': { unsigned short modeBits; @@ -1101,7 +1101,7 @@ static int ReadDumpHeader(register struct iod *iodp, struct DumpHeader *hp) register tag; afs_uint32 beginMagic; if (iod_getc(iodp) != D_DUMPHEADER || !ReadInt32(iodp, &beginMagic) - || !ReadInt32(iodp, (unsigned int *)&hp->version) + || !ReadInt32(iodp, (afs_uint32 *)&hp->version) || beginMagic != DUMPBEGINMAGIC ) return 0; hp->volumeId = 0; @@ -1122,7 +1122,8 @@ static int ReadDumpHeader(register struct iod *iodp, struct DumpHeader *hp) return 0; hp->nDumpTimes = (arrayLength >> 1); for (i = 0; inDumpTimes; i++) - if (!ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].from) || !ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].to)) + if (!ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].from) + || !ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].to)) return 0; break; } -- 1.9.4