From 3853dd846d68f9b515b81ad8a03e1b2a3da9fb25 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 20 Mar 2009 17:10:19 +0000 Subject: [PATCH] DEVEL15-xstat-printf-ptr-format-20090320 LICENSE IPL10 make use of AFS_PTR_FMT to avoid warnings on Windows. (cherry picked from commit 218f08ffedb8c75e0314ab00000adf8419fdfe7b) --- src/xstat/xstat_cm.c | 12 ++++++------ src/xstat/xstat_fs.c | 10 +++++----- src/xstat/xstat_fs_callback.c | 4 ---- src/xstat/xstat_fs_test.c | 4 ++-- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/xstat/xstat_cm.c b/src/xstat/xstat_cm.c index d89daa243..e998d1c13 100644 --- a/src/xstat/xstat_cm.c +++ b/src/xstat/xstat_cm.c @@ -264,12 +264,12 @@ xstat_cm_LWP(void *unused) if (xstat_cm_debug) { printf - ("%s: Calling RXAFSCB_GetXStats, conn=0x%x, clientVersionNumber=%d, collectionNumber=%d, srvVersionNumberP=0x%x, timeP=0x%x, dataP=0x%x\n", + ("%s: Calling RXAFSCB_GetXStats, conn=0x%" AFS_PTR_FMT ", clientVersionNumber=%d, collectionNumber=%d, srvVersionNumberP=0x%" AFS_PTR_FMT ", timeP=0x%" AFS_PTR_FMT ", dataP=0x%" AFS_PTR_FMT "\n", rn, curr_conn->rxconn, clientVersionNumber, *currCollIDP, &srvVersionNumber, &(xstat_cm_Results.probeTime), &(xstat_cm_Results.data)); - printf("%s: [bufflen=%d, buffer at 0x%x]\n", rn, + printf("%s: [bufflen=%d, buffer at 0x%" AFS_PTR_FMT "]\n", rn, xstat_cm_Results.data.AFSCB_CollData_len, xstat_cm_Results.data.AFSCB_CollData_val); } @@ -321,7 +321,7 @@ xstat_cm_LWP(void *unused) * that we've finished our collection round. */ if (xstat_cm_debug) - printf("[%s] Signalling main process at 0x%x\n", rn, + printf("[%s] Signalling main process at 0x%" AFS_PTR_FMT "\n", rn, &terminationEvent); oneShotCode = LWP_SignalProcess(&terminationEvent); if (oneShotCode) @@ -525,7 +525,7 @@ xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, */ if (xstat_cm_debug) { printf("[%s] Copying in the following socket info:\n", rn); - printf("[%s] IP addr 0s, port %d\n", rn, + printf("[%s] IP addr 0s, port %d\n", afs_inet_ntoa_r((a_socketArray + curr_srv)->sin_addr.s_addr,hoststr), ntohs((a_socketArray + curr_srv)->sin_port)); } @@ -566,7 +566,7 @@ xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, conn_err = 1; } if (xstat_cm_debug) - printf("[%s] New connection at 0x%lx\n", rn, curr_conn->rxconn); + printf("[%s] New connection at 0x%" AFS_PTR_FMT "\n", rn, curr_conn->rxconn); /* * Bump the current xstat_cm connection to set up. @@ -593,7 +593,7 @@ xstat_cm_Init(int a_numServers, struct sockaddr_in *a_socketArray, return (code); } if (xstat_cm_debug) - printf("[%s] Probe LWP process structure located at 0x%x\n", rn, + printf("[%s] Probe LWP process structure located at 0x%" AFS_PTR_FMT "\n", rn, probeLWP_ID); /* diff --git a/src/xstat/xstat_fs.c b/src/xstat/xstat_fs.c index c582312e3..146b7e43e 100644 --- a/src/xstat/xstat_fs.c +++ b/src/xstat/xstat_fs.c @@ -303,12 +303,12 @@ xstat_fs_LWP(void *unused) if (xstat_fs_debug) { printf - ("%s: Calling RXAFS_GetXStats, conn=0x%x, clientVersionNumber=%d, collectionNumber=%d, srvVersionNumberP=0x%x, timeP=0x%x, dataP=0x%x\n", + ("%s: Calling RXAFS_GetXStats, conn=0x%" AFS_PTR_FMT ", clientVersionNumber=%d, collectionNumber=%d, srvVersionNumberP=0x%" AFS_PTR_FMT ", timeP=0x%" AFS_PTR_FMT ", dataP=0x%" AFS_PTR_FMT "\n", rn, curr_conn->rxconn, clientVersionNumber, *currCollIDP, &srvVersionNumber, &(xstat_fs_Results.probeTime), &(xstat_fs_Results.data)); - printf("%s: [bufflen=%d, buffer at 0x%x]\n", rn, + printf("%s: [bufflen=%d, buffer at 0x%" AFS_PTR_FMT "]\n", rn, xstat_fs_Results.data.AFS_CollData_len, xstat_fs_Results.data.AFS_CollData_val); } @@ -360,7 +360,7 @@ xstat_fs_LWP(void *unused) * that we've finished our collection round. */ if (xstat_fs_debug) - printf("[%s] Signalling main process at 0x%x\n", rn, + printf("[%s] Signalling main process at 0x%" AFS_PTR_FMT "\n", rn, &terminationEvent); oneShotCode = LWP_SignalProcess(&terminationEvent); if (oneShotCode) @@ -636,7 +636,7 @@ xstat_fs_Init(int a_numServers, struct sockaddr_in *a_socketArray, conn_err = 1; } if (xstat_fs_debug) - printf("[%s] New connection at 0x%lx\n", rn, curr_conn->rxconn); + printf("[%s] New connection at 0x%" AFS_PTR_FMT "\n", rn, curr_conn->rxconn); /* * Bump the current xstat_fs connection to set up. @@ -690,7 +690,7 @@ xstat_fs_Init(int a_numServers, struct sockaddr_in *a_socketArray, return (code); } if (xstat_fs_debug) - printf("[%s] Probe LWP process structure located at 0x%x\n", rn, + printf("[%s] Probe LWP process structure located at 0x%" AFS_PTR_FMT "\n", rn, probeLWP_ID); /* diff --git a/src/xstat/xstat_fs_callback.c b/src/xstat/xstat_fs_callback.c index d580e9d2d..1e8e7a69a 100644 --- a/src/xstat/xstat_fs_callback.c +++ b/src/xstat/xstat_fs_callback.c @@ -490,9 +490,7 @@ SRXAFSCB_InitCallBackState2(struct rx_call * rxcall, afs_int32 SRXAFSCB_WhoAreYou(struct rx_call * rxcall, struct interfaceAddr * addr) { - int i; int code = 0; - int count; #if XSTAT_FS_CALLBACK_VERBOSE static char rn[] = "SRXAFSCB_WhoAreYou"; /*Routine name */ @@ -753,9 +751,7 @@ SRXAFSCB_TellMeAboutYourself(struct rx_call * rxcall, struct interfaceAddr * addr, Capabilities * capabilites) { - int i; int code = 0; - int count; #if XSTAT_FS_CALLBACK_VERBOSE static char rn[] = "SRXAFSCB_TellMeAboutYourself"; /*Routine name */ diff --git a/src/xstat/xstat_fs_test.c b/src/xstat/xstat_fs_test.c index 0c97afbb2..058470efa 100644 --- a/src/xstat/xstat_fs_test.c +++ b/src/xstat/xstat_fs_test.c @@ -131,7 +131,7 @@ PrintCallInfo() printableTime); if (debugging_on) - printf("\n[%d entries returned at 0x%x]\n\n", numInt32s, currInt32); + printf("\n[%d entries returned at 0x%" AFS_PTR_FMT "]\n\n", numInt32s, currInt32); for (i = 0; i < numInt32s; i++) printf("%d ", *currInt32++); @@ -789,7 +789,7 @@ RunTheTest(struct cmd_syndesc *a_s) * One-shot operation; just wait for the collection to be done. */ if (debugging_on) - printf("[%s] Calling LWP_WaitProcess() on event 0x%x\n", rn, + printf("[%s] Calling LWP_WaitProcess() on event 0x%" AFS_PTR_FMT "\n", rn, &terminationEvent); waitCode = LWP_WaitProcess(&terminationEvent); if (debugging_on) -- 2.39.5