From e8a2833996e783f4ebd051ae87dbd301948689b0 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 22 Jul 2009 22:07:32 +0100 Subject: [PATCH] Squish more warnings in xstat Use a correct prototype for a_ProbeHandler in xstat_cm_Init Fix a printf warning rx_getAllAddr and afs_cb_interface.addr disagree on the sign of addresses afs_interface.addr is a [], which we then use & to get the address of. Fix this to stop the compiler from sulking. Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/184 Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/xstat/xstat_cm.c | 6 +++--- src/xstat/xstat_fs_callback.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xstat/xstat_cm.c b/src/xstat/xstat_cm.c index 2aadde3b9..6d4b7b01d 100644 --- a/src/xstat/xstat_cm.c +++ b/src/xstat/xstat_cm.c @@ -379,7 +379,7 @@ xstat_cm_LWP(void *unused) int xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, - int a_ProbeFreqInSecs, int (*a_ProbeHandler) (), int a_flags, + int a_ProbeFreqInSecs, int (*a_ProbeHandler) (void), int a_flags, int a_numCollections, afs_int32 * a_collIDP) { @@ -422,7 +422,7 @@ xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, a_ProbeFreqInSecs); arg_errfound = 1; } - if (a_ProbeHandler == (int (*)())0) { + if (a_ProbeHandler == NULL) { fprintf(stderr, "[%s] Null probe handler function argument\n", rn); arg_errfound = 1; } @@ -474,7 +474,7 @@ xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, malloc(a_numServers * sizeof(struct xstat_cm_ConnectionInfo)); if (xstat_cm_ConnInfo == (struct xstat_cm_ConnectionInfo *)0) { fprintf(stderr, - "[%s] Can't allocate %d connection info structs (%d bytes)\n", + "[%s] Can't allocate %d connection info structs (%lu bytes)\n", rn, a_numServers, (a_numServers * sizeof(struct xstat_cm_ConnectionInfo))); return (-1); /*No cleanup needs to be done yet */ diff --git a/src/xstat/xstat_fs_callback.c b/src/xstat/xstat_fs_callback.c index ee4bab0cf..71778a7ef 100644 --- a/src/xstat/xstat_fs_callback.c +++ b/src/xstat/xstat_fs_callback.c @@ -55,7 +55,7 @@ init_afs_cb(void) #else afs_uuid_create(&afs_cb_interface.uuid); #endif - 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 -- 2.39.5