Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] fix warning on 32-bit systems
@ 2013-04-12  3:53 Aaron Carroll
  2013-04-12  3:55 ` Aaron Carroll
  2013-04-12  5:52 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Carroll @ 2013-04-12  3:53 UTC (permalink / raw)
  To: fio@vger.kernel.org

Casting a uint64_t to a pointer emits a warning on 32 bit systems.
This patch fixes the warning, but seems a bit suspicious. Should the
type of 'tag' be uintptr_t ?

--

diff --git a/server.c b/server.c
index 9537c96..3c52083 100644
--- a/server.c
+++ b/server.c
@@ -293,7 +293,7 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)

 static void add_reply(uint64_t tag, struct flist_head *list)
 {
-       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
+       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
(uintptr_t)tag;

        flist_add_tail(&reply->list, list);
 }
@@ -313,7 +313,7 @@ static uint64_t alloc_reply(uint64_t tag, uint16_t opcode)

 static void free_reply(uint64_t tag)
 {
-       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
+       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
(uintptr_t)tag;

        free(reply);
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-12  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12  3:53 [PATCH] fix warning on 32-bit systems Aaron Carroll
2013-04-12  3:55 ` Aaron Carroll
2013-04-12  5:52 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox