From a53732ef5f425706abc1c5e511df23cecb2f6113 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 26 Sep 2009 18:11:53 +0100 Subject: [PATCH] Miscellaneous warning cleanup Assorted warning cleanup, that it didn't seem to make sense having one patch per file for. This patch - Adds some casting for syscall pointers - ANSIfies SRXAFSCB_GetDE in fsprobe - Loads sys/ioctl.h on some more platforms in usd - Includes some missing header files - Removes unused variables - Makes it clear that VIsSalvager does handle all enumerated types - Adds some more prototypes Reviewed-on: http://gerrit.openafs.org/508 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/UKERNEL/sysincludes.h | 2 +- src/afs/afs_syscall.c | 2 +- src/afsd/afsd.c | 8 ++++++-- src/afsmonitor/afsmonitor.h | 3 +++ src/auth/authcon.c | 2 ++ src/auth/ktc.h | 2 +- src/cmd/cmd.c | 2 +- src/fsprobe/fsprobe.c | 2 +- src/fsprobe/fsprobe_callback.c | 13 ++++--------- src/kauth/read_passwd.c | 5 ++++- src/kauth/user.c | 4 ++++ src/libadmin/client/afs_clientAdmin.c | 7 ++++--- src/platform/DARWIN/afssettings.m | 3 ++- src/sys/pagsh.c | 1 + src/sys/sys_prototypes.h | 1 + src/usd/usd_file.c | 2 +- src/util/regex.c | 6 +++--- src/venus/fs.c | 2 +- src/venus/test/getinitparams.c | 1 + src/viced/host.c | 4 +++- src/vlserver/vlprocs.c | 1 - src/vol/volume_inline.h | 3 ++- 22 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 858141d..16b65fe 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -1278,7 +1278,7 @@ extern struct usr_mount *getmp(unsigned long); typedef long usr_whymountroot_t; struct usr_vfsops { - int (*vfs_mount) (struct vfs *, char *, struct vfs *); + int (*vfs_mount) (struct vfs *, char *, void *); int (*vfs_unmount) (struct vfs *); int (*vfs_root) (struct vfs *, struct vnode **); int (*vfs_statfs) (struct vfs *, struct statfs *); diff --git a/src/afs/afs_syscall.c b/src/afs/afs_syscall.c index e4db706..5557ed7 100644 --- a/src/afs/afs_syscall.c +++ b/src/afs/afs_syscall.c @@ -763,7 +763,7 @@ Afs_syscall() AFS_GLOCK(); code = Afscall_icl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, - uap->parm5, retval); + uap->parm5, (long *)retval); AFS_GUNLOCK(); #ifdef AFS_LINUX20_ENV if (!code) { diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index c082bd6..5fbdf8d 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -138,6 +138,7 @@ #include #include #include +#include #ifdef AFS_SGI61_ENV #include @@ -667,7 +668,7 @@ PartSizeOverflow(char *path, int cs) mint = totalblks / 100 * 95; if (cs > mint) { printf - ("Cache size (%d) must be less than 95%% of partition size (which is %d). Lower cache size\n", + ("Cache size (%d) must be less than 95%% of partition size (which is %lld). Lower cache size\n", cs, mint); return 1; } @@ -1523,7 +1524,9 @@ mainproc(struct cmd_syndesc *as, void *arock) static char rn[] = "afsd"; /*Name of this routine */ afs_int32 code; /*Result of fork() */ int i; +#ifndef AFS_CACHE_VNODE_PATH int currVFile; /*Current AFS cache file number passed in */ +#endif int mountFlags; /*Flags passed to mount() */ int lookupResult; /*Result of GetLocalCellName() */ int cacheIteration; /*How many times through cache verification */ @@ -2647,8 +2650,9 @@ call_syscall(long param1, long param2, long param3, long param4, long param5, struct afssysargs syscall_data; void *ioctldata; int fd = open(SYSCALL_DEV_FNAME,O_RDWR); - int syscallnum, is64 = 0; + int syscallnum; #ifdef AFS_DARWIN100_ENV + int is64 = 0; struct afssysargs64 syscall64_data; if (sizeof(param1) == 8) { syscallnum = VIOC_SYSCALL64; diff --git a/src/afsmonitor/afsmonitor.h b/src/afsmonitor/afsmonitor.h index 06359df..7bccf32 100644 --- a/src/afsmonitor/afsmonitor.h +++ b/src/afsmonitor/afsmonitor.h @@ -96,3 +96,6 @@ extern int fs_refresh(int, int); extern int cm_refresh(int, int); extern int gtx_initialize(void); +/* afsmonitor.c */ +extern int afsmon_Exit(int a_exitVal); + diff --git a/src/auth/authcon.c b/src/auth/authcon.c index 548b153..f18311c 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -26,6 +26,8 @@ #include "afs/keys.h" #include "afs/auth.h" #include "afs/pthread_glock.h" +#include "des.h" +#include "des_prototypes.h" #else /* defined(UKERNEL) */ #include #include diff --git a/src/auth/ktc.h b/src/auth/ktc.h index a86e4fb..8fe5211 100644 --- a/src/auth/ktc.h +++ b/src/auth/ktc.h @@ -13,6 +13,6 @@ extern char * ktc_tkt_string(void); extern char * ktc_tkt_string_uid(afs_uint32); extern void ktc_set_tkt_string(char *); - +extern int ktc_OldPioctl(void); #endif /* _AFS_AUTH_KTC_H */ diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index 1115280..9aae393 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -232,7 +232,7 @@ PrintFlagHelp(register struct cmd_syndesc *as) { register int i; register struct cmd_parmdesc *tp; - size_t flag_width; + int flag_width; char *flag_prefix; /* find flag name length */ diff --git a/src/fsprobe/fsprobe.c b/src/fsprobe/fsprobe.c index 2c85ee7..9ec0b53 100644 --- a/src/fsprobe/fsprobe.c +++ b/src/fsprobe/fsprobe.c @@ -267,7 +267,7 @@ fsprobe_LWP(void *unused) RXAFS_GetStatistics64(curr_conn->rxconn, STATS64_VERSION, &stats64); if (*curr_probeOK == RXGEN_OPCODE) *curr_probeOK = - RXAFS_GetStatistics(curr_conn->rxconn, curr_stats); + RXAFS_GetStatistics(curr_conn->rxconn, (ViceStatistics *)curr_stats); else if (*curr_probeOK == 0) { curr_stats->CurrentTime = RoundInt64ToInt32(stats64.ViceStatistics64_val[STATS64_CURRENTTIME]); curr_stats->BootTime = RoundInt64ToInt32(stats64.ViceStatistics64_val[STATS64_BOOTTIME]); diff --git a/src/fsprobe/fsprobe_callback.c b/src/fsprobe/fsprobe_callback.c index 0e1975d..5570f98 100644 --- a/src/fsprobe/fsprobe_callback.c +++ b/src/fsprobe/fsprobe_callback.c @@ -44,7 +44,7 @@ init_afs_cb(void) int count; afs_uuid_create(&afs_cb_interface.uuid); - count = rx_getAllAddr(&afs_cb_interface.addr_in, AFS_MAX_INTERFACE_ADDR); + count = rx_getAllAddr((afs_uint32 *) &afs_cb_interface.addr_in, AFS_MAX_INTERFACE_ADDR); if (count <= 0) afs_cb_interface.numberOfInterfaces = 0; else @@ -747,14 +747,9 @@ SRXAFSCB_TellMeAboutYourself(struct rx_call * rxcall, return (0); } -int SRXAFSCB_GetDE(a_call, a_index, addr, inode, flags, time, fileName) - struct rx_call *a_call; - afs_int32 a_index; - afs_int32 addr; - afs_int32 inode; - afs_int32 flags; - afs_int32 time; - char ** fileName; +int SRXAFSCB_GetDE(struct rx_call *a_call, afs_int32 a_index, + afs_int32 addr, afs_int32 inode, afs_int32 flags, + afs_int32 time, char ** fileName) { return RXGEN_OPCODE; } diff --git a/src/kauth/read_passwd.c b/src/kauth/read_passwd.c index 49a7c44..99a2b9f 100644 --- a/src/kauth/read_passwd.c +++ b/src/kauth/read_passwd.c @@ -68,8 +68,9 @@ des_read_password(C_Block *k, char *prompt, int verify) ok = read_pw_string(key_string, BUFSIZ, prompt, verify); if (ok == 0) string_to_key(key_string, k); - +#ifdef BSDUNIX lose: +#endif memset(key_string, 0, sizeof(key_string)); return ok; } @@ -197,7 +198,9 @@ read_pw_string(char *s, int max, char *prompt, int verify) ok = 1; } +#ifdef BSDUNIX lose: +#endif if (!ok) memset(s, 0, max); #ifdef BSDUNIX diff --git a/src/kauth/user.c b/src/kauth/user.c index 770742a..3c51155 100644 --- a/src/kauth/user.c +++ b/src/kauth/user.c @@ -35,6 +35,9 @@ #include "afs/kautils.h" #include "afs/afsutil.h" #include "afs/ptuser.h" +#include "des.h" +#include "des_prototypes.h" +#include "ktc.h" #else /* defined(UKERNEL) */ #include #include @@ -62,6 +65,7 @@ #include /* max ticket lifetime */ #include "kauth.h" #include "kautils.h" +#include "ktc.h" #endif /* defined(UKERNEL) */ diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index 55f4e77..6f4adeb 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -1367,7 +1367,8 @@ afsclient_MountPointCreate(const void *cellHandle, const char *directory, */ if (volCheck == CHECK_VOLUME) { - if (!vos_VLDBGet(cellHandle, 0, 0, volumeName, &vldbEntry, &tst)) { + if (!vos_VLDBGet(cellHandle, 0, 0, (char *)volumeName, &vldbEntry, + &tst)) { goto fail_afsclient_MountPointCreate; } } @@ -1499,7 +1500,7 @@ afsclient_ACLEntryAdd(const char *directory, const char *user, idata.out_size = 2048; idata.in_size = 0; idata.in = idata.out = old_acl_string; - tst = pioctl(directory, VIOCGETAL, &idata, 1); + tst = pioctl((char *)directory, VIOCGETAL, &idata, 1); if (tst != 0) { goto fail_afsclient_ACLEntryAdd; @@ -1588,7 +1589,7 @@ afsclient_ACLEntryAdd(const char *directory, const char *user, idata.out_size = 0; idata.in_size = strlen(new_acl_string) + 1; idata.in = idata.out = new_acl_string; - tst = pioctl(directory, VIOCSETAL, &idata, 1); + tst = pioctl((char *) directory, VIOCSETAL, &idata, 1); if (tst != 0) { goto fail_afsclient_ACLEntryAdd; diff --git a/src/platform/DARWIN/afssettings.m b/src/platform/DARWIN/afssettings.m index f6f1088..f8d56fb 100644 --- a/src/platform/DARWIN/afssettings.m +++ b/src/platform/DARWIN/afssettings.m @@ -146,7 +146,8 @@ walk(id obj, Setting *s, int level) } } -main() +int +main(int argc, char **argv) { NSData *plistData; id plist; diff --git a/src/sys/pagsh.c b/src/sys/pagsh.c index 983352d..73efae3 100644 --- a/src/sys/pagsh.c +++ b/src/sys/pagsh.c @@ -35,6 +35,7 @@ #endif #include "rx/rx.h" #include "sys_prototypes.h" +#include #include "AFS_component_version_number.c" diff --git a/src/sys/sys_prototypes.h b/src/sys/sys_prototypes.h index 3f3c46d..8ce9245 100644 --- a/src/sys/sys_prototypes.h +++ b/src/sys/sys_prototypes.h @@ -37,6 +37,7 @@ extern void outparam_conversion(afs_int32, char *, afs_int32); /* rmtsyss.c */ extern void rmt_Quit(char *msg, ...); +extern void rmtsysd(void); /* setpag.c */ extern int lsetpag(void); diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index bfb01b5..af3cc8e 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -23,7 +23,7 @@ #ifdef AFS_DARWIN_ENV #include #endif -#if defined(AFS_DUX40_ENV) || defined(AFS_OBSD_ENV) || defined(AFS_NBSD_ENV) +#if defined(AFS_DUX40_ENV) || defined(AFS_OBSD_ENV) || defined(AFS_NBSD_ENV) || (defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN100_ENV)) #include #endif #ifndef AFS_DARWIN100_ENV diff --git a/src/util/regex.c b/src/util/regex.c index 1c20f96..dcdda80 100644 --- a/src/util/regex.c +++ b/src/util/regex.c @@ -370,7 +370,7 @@ re_exec(const char *p1) braelist[c] = 0; } if (circf) - return ((advance(p1, p2))); + return ((advance((char *)p1, p2))); /* * fast check for first character */ @@ -379,7 +379,7 @@ re_exec(const char *p1) do { if (*p1 != c) continue; - if ((rv = advance(p1, p2))) + if ((rv = advance((char *)p1, p2))) return (rv); } while (*p1++); return (0); @@ -388,7 +388,7 @@ re_exec(const char *p1) * regular algorithm */ do - if ((rv = advance(p1, p2))) + if ((rv = advance((char *)p1, p2))) return (rv); while (*p1++); return (0); diff --git a/src/venus/fs.c b/src/venus/fs.c index 115c694..85f44f7 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2933,7 +2933,7 @@ VLDBInit(int noAuthFlag, struct afsconf_cell *info) { afs_int32 code; - code = ugen_ClientInit(noAuthFlag, AFSDIR_CLIENT_ETC_DIRPATH, + code = ugen_ClientInit(noAuthFlag, (char *) AFSDIR_CLIENT_ETC_DIRPATH, info->name, 0, &uclient, NULL, pn, rxkad_clear, VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 50, diff --git a/src/venus/test/getinitparams.c b/src/venus/test/getinitparams.c index 16eb9a5..3c3da0e 100644 --- a/src/venus/test/getinitparams.c +++ b/src/venus/test/getinitparams.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #ifdef AFS_AIX41_ENV diff --git a/src/viced/host.c b/src/viced/host.c index 53089bc..a0dc675 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -31,6 +31,8 @@ #include #include #include +#define FSINT_COMMON_XG +#include #include #include #include @@ -2278,7 +2280,7 @@ h_FindClient_r(struct rx_connection *tcon) afs_int32 kvno; /* kerberos ticket */ - code = rxkad_GetServerInfo(tcon, /*level */ 0, &expTime, + code = rxkad_GetServerInfo(tcon, /*level */ 0, (afs_uint32 *)&expTime, tname, tinst, tcell, &kvno); if (code) { ViceLog(1, ("Failed to get rxkad ticket info\n")); diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index c11efe7..8a33cbb 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -2721,7 +2721,6 @@ get_vldbupdateentry(struct ubik_trans *trans, struct nvlentry *VlEntry) { int i, j, errorcode, serverindex; - struct vldbentry checkentry; afs_uint32 checkids[MAXTYPES]; /* check if any specified new IDs are already present in the db. Do diff --git a/src/vol/volume_inline.h b/src/vol/volume_inline.h index a26a6dc..581ae56 100644 --- a/src/vol/volume_inline.h +++ b/src/vol/volume_inline.h @@ -28,8 +28,9 @@ VIsSalvager(ProgramType type) case salvager: case salvageServer: return 1; + default: + return 0; } - return 0; } /***************************************************/ -- 1.9.4