From 6d628bbb7c188e5644e27b3657d824c1481034b6 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 26 Sep 2009 17:44:06 +0100 Subject: [PATCH] Squash more viced warnings Get rid of more warnings in viced - Cast fids that we pass into the Dir package to avoid type warnings - Add ()s to a && b || c, to clarify its meaning - (a && b ) || c - Don't use %ld to print ints - Prototype another function from the host package Reviewed-on: http://gerrit.openafs.org/539 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/viced/afsfileprocs.c | 6 +++--- src/viced/host.c | 2 +- src/viced/host.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index e6f8f7f9b..31bdc85bb 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1348,7 +1348,7 @@ DeleteTarget(Vnode * parentptr, Volume * volptr, Vnode ** targetptr, SetDirHandle(&childdir, *targetptr); if (IsEmpty(&childdir) != 0) return (EEXIST); - DZap(&childdir); + DZap((afs_int32 *) &childdir); FidZap(&childdir); (*targetptr)->delete = 1; } else if ((--(*targetptr)->disk.linkCount) == 0) @@ -4810,7 +4810,7 @@ SAFSS_MakeDir(struct rx_call *acall, struct AFSFid *DirFid, char *Name, /* Actually create the New directory in the directory package */ SetDirHandle(&dir, targetptr); - assert(!(MakeDir(&dir, OutFid, DirFid))); + assert(!(MakeDir(&dir, (afs_int32 *)OutFid, (afs_int32 *)DirFid))); DFlush(); VN_SET_LEN(targetptr, (afs_fsize_t) Length(&dir)); @@ -7716,7 +7716,7 @@ sys_error_to_et(afs_int32 in) return 0; if (in < 0 || in > 511) return in; - if (in >= VICE_SPECIAL_ERRORS && in <= VIO || in == VRESTRICTED) + if ((in >= VICE_SPECIAL_ERRORS && in <= VIO) || in == VRESTRICTED) return in; if (sys2et[in] != 0) return sys2et[in]; diff --git a/src/viced/host.c b/src/viced/host.c index a0dc675d8..e6445fe7a 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2710,7 +2710,7 @@ h_DumpHost(register struct host *host, int held, void *rock) sprintf(tmpStr, "%04x", host->holds[i]); (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); } - sprintf(tmpStr, " slot/bit: %ld/%d\n", h_holdSlot(), h_holdbit()); + sprintf(tmpStr, " slot/bit: %d/%d\n", h_holdSlot(), h_holdbit()); (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); H_UNLOCK; diff --git a/src/viced/host.h b/src/viced/host.h index c3bacf3a5..5f9aa6fcd 100644 --- a/src/viced/host.h +++ b/src/viced/host.h @@ -255,6 +255,7 @@ extern int initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf); extern void h_AddHostToAddrHashTable_r(afs_uint32 addr, afs_uint16 port, struct host * host); extern void h_AddHostToUuidHashTable_r(afsUUID * uuid, struct host * host); extern int h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port, struct host *host); +extern int h_DeleteHostFromUuidHashTable_r(struct host *host); extern int initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf); extern int addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port); extern int removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port); -- 2.39.5