From df380934e53c645b4b7cdec882b512b4d20ebc14 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 11 Oct 2011 14:25:08 +0200 Subject: [PATCH] client/server: fix ptr <-> uint64_t casting warnings on 32-bit builds Not actually a bug, but gcc complains. Signed-off-by: Jens Axboe --- client.c | 6 +++--- server.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client.c b/client.c index 31b48627..83bbfc40 100644 --- a/client.c +++ b/client.c @@ -663,7 +663,7 @@ static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) flist_for_each(entry, &client->cmd_list) { icmd = flist_entry(entry, struct fio_net_int_cmd, list); - if (cmd->tag == (uint64_t) icmd) + if (cmd->tag == (uintptr_t) icmd) break; icmd = NULL; @@ -682,7 +682,7 @@ static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) static void handle_eta(struct fio_client *client, struct fio_net_cmd *cmd) { struct jobs_eta *je = (struct jobs_eta *) cmd->payload; - struct client_eta *eta = (struct client_eta *) cmd->tag; + struct client_eta *eta = (struct client_eta *) (uintptr_t) cmd->tag; dprint(FD_NET, "client: got eta tag %p, %d\n", eta, eta->pending); @@ -810,7 +810,7 @@ static void request_client_etas(void) flist_add_tail(&client->eta_list, &eta_list); client->eta_in_flight = eta; fio_net_send_simple_cmd(client->fd, FIO_NET_CMD_SEND_ETA, - (uint64_t) eta, &client->cmd_list); + (uintptr_t) eta, &client->cmd_list); } while (skipped--) diff --git a/server.c b/server.c index db9d8594..ad07a0e9 100644 --- a/server.c +++ b/server.c @@ -299,7 +299,7 @@ int fio_net_send_simple_cmd(int sk, uint16_t opcode, uint64_t tag, cmd = malloc(sizeof(*cmd)); - fio_init_net_cmd(&cmd->cmd, opcode, NULL, 0, (uint64_t) cmd); + fio_init_net_cmd(&cmd->cmd, opcode, NULL, 0, (uintptr_t) cmd); fio_net_cmd_crc(&cmd->cmd); INIT_FLIST_HEAD(&cmd->list); -- 2.25.1