> From: Eric Anholt <[email protected]>
> Date: Mon, 27 Jan 2014 11:36:09 -0800
>
> We all know that XIDs are 32 bits, even if 32-bit headers call them
> "long".
> ---
> test/hashtabletest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/hashtabletest.c b/test/hashtabletest.c
> index ceadfa7..a37dfb5 100644
> --- a/test/hashtabletest.c
> +++ b/test/hashtabletest.c
> @@ -12,7 +12,7 @@ static void
> print_xid(void* ptr, void* v)
> {
> XID *x = v;
> - printf("%ld", *x);
> + printf("%d", (uint32_t)*x);
> }
There is no guarantee that uint32_t isn't long either! And of course
using %d to print an unsigned integer isn't quite right either.
Either make this
printf("%lu", (unsigned long)*x);
or
printf("%u", (unsigned int)*x);
Cheers,
Mark
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel