Re: [PATCH] fix warning on 32-bit systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sigh.... sorry about the line wrapping.

On 12 April 2013 13:53, Aaron Carroll <xaaronc@xxxxxxxxx> wrote:
> 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);
>  }
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux