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 <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2009-09-26 18:11:53 +01:00 committed by Derrick Brashear
parent 6dcf37d810
commit a53732ef5f
22 changed files with 47 additions and 29 deletions

View File

@ -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 *);

View File

@ -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) {

View File

@ -138,6 +138,7 @@
#include <ctype.h>
#include <afs/afssyscalls.h>
#include <afs/afsutil.h>
#include <afs/sys_prototypes.h>
#ifdef AFS_SGI61_ENV
#include <unistd.h>
@ -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;

View File

@ -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);

View File

@ -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 <afs/stds.h>
#include <afs/pthread_glock.h>

View File

@ -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 */

View File

@ -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 */

View File

@ -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]);

View File

@ -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;
}

View File

@ -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

View File

@ -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 <afs/stds.h>
#include <signal.h>
@ -62,6 +65,7 @@
#include <rx/rxkad.h> /* max ticket lifetime */
#include "kauth.h"
#include "kautils.h"
#include "ktc.h"
#endif /* defined(UKERNEL) */

View File

@ -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;

View File

@ -146,7 +146,8 @@ walk(id obj, Setting *s, int level)
}
}
main()
int
main(int argc, char **argv)
{
NSData *plistData;
id plist;

View File

@ -35,6 +35,7 @@
#endif
#include "rx/rx.h"
#include "sys_prototypes.h"
#include <afs/auth.h>
#include "AFS_component_version_number.c"

View File

@ -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);

View File

@ -23,7 +23,7 @@
#ifdef AFS_DARWIN_ENV
#include <sys/ioccom.h>
#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 <sys/ioctl.h>
#endif
#ifndef AFS_DARWIN100_ENV

View File

@ -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);

View File

@ -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,

View File

@ -19,6 +19,7 @@
#include <afs/venus.h>
#include <afs/cmd.h>
#include <afs/sys_prototypes.h>
#include <afs/afssyscalls.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef AFS_AIX41_ENV

View File

@ -31,6 +31,8 @@
#include <lwp.h>
#include <lock.h>
#include <afs/afsint.h>
#define FSINT_COMMON_XG
#include <afs/afscbint.h>
#include <afs/rxgen_consts.h>
#include <afs/nfs.h>
#include <afs/errors.h>
@ -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"));

View File

@ -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

View File

@ -28,8 +28,9 @@ VIsSalvager(ProgramType type)
case salvager:
case salvageServer:
return 1;
default:
return 0;
}
return 0;
}
/***************************************************/