From 4e1554c295f4c572d829982bdcb7e2556ea23167 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 21 Mar 2010 23:21:00 +0100 Subject: [PATCH] [CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer() This warning was first reported by Ross West on FreeBSD, then by Holger Just on OpenSolaris. It also happens on 64bit Linux. However, fixing the format to use long int complains on 32bit Linux where ptrdiff_t is apparently different. Better cast the pointer difference to an int then. --- src/dumpstats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index d200e928c6..71a323cb34 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2463,9 +2463,9 @@ int stats_dump_full_sess_to_buffer(struct session *s, struct buffer *rep) human_time(TICKS_TO_MS(sess->req->wex - now_ms), TICKS_TO_MS(1000)) : "", sess->req->data, - sess->req->r - sess->req->data, - sess->req->w - sess->req->data, - sess->req->lr - sess->req->data, + (int)(sess->req->r - sess->req->data), + (int)(sess->req->w - sess->req->data), + (int)(sess->req->lr - sess->req->data), sess->req->total); chunk_printf(&msg, @@ -2493,9 +2493,9 @@ int stats_dump_full_sess_to_buffer(struct session *s, struct buffer *rep) human_time(TICKS_TO_MS(sess->rep->wex - now_ms), TICKS_TO_MS(1000)) : "", sess->rep->data, - sess->rep->r - sess->rep->data, - sess->rep->w - sess->rep->data, - sess->rep->lr - sess->rep->data, + (int)(sess->rep->r - sess->rep->data), + (int)(sess->rep->w - sess->rep->data), + (int)(sess->rep->lr - sess->rep->data), sess->rep->total); if (buffer_feed_chunk(rep, &msg) >= 0) -- 2.47.3