pipebuffer: clean up cast-warnings
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 24 Mar 2020 09:58:14 +0000 (10:58 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Mar 2020 14:19:37 +0000 (14:19 +0000)
commit079cb4949dd3199ea5693cc0c6ac4c3d838ee022
treefc343139aface29808975c20f18420993c402844
parent12711939320e4fcd3a0d86af22da1042ad92035f
pipebuffer: clean up cast-warnings

This code produces warnings, so let's fix that. The problem is that
casting a pointer to an integer of non-pointer-size triggers warnings on
MSVC, and on 64-bit Windows unsigned long is 32-bit large.

So let's instead use uintptr_t, which is exactly for these kinds of
things.

While we're at it, let's make the resulting index a plain "unsigned",
which is the type this originated from before we started with this
cast-dance.

Fixes: 1a66ead1c75 ("pipebuffer, winsys/svga: Add functionality to update pb_validate_entry flags")
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297>
src/gallium/auxiliary/pipebuffer/pb_validate.c