mesa: avoid warning on Windows
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 5 Aug 2019 15:29:22 +0000 (17:29 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 8 Aug 2019 16:20:29 +0000 (18:20 +0200)
On Windows, p_atomic_inc_return returns an unsigned long long rather
than the type the pointer refers to, so let's make sure we cast the
result to the right type. Otherwise, we'll trigger a warning about
the wrong format-string for the type.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Engestrom <eric@engestrom.ch>
src/gallium/auxiliary/util/u_helpers.c

index f28685f80d9a7650b5c97e2baf9ae6d4b5b7ab0d..c9da90c775a21d97a6d96116a6d9e8d5d4991a3e 100644 (file)
@@ -233,7 +233,7 @@ util_end_pipestat_query(struct pipe_context *ctx, struct pipe_query *q,
            "    hs_invocations = %"PRIu64"\n"
            "    ds_invocations = %"PRIu64"\n"
            "    cs_invocations = %"PRIu64"\n",
-           p_atomic_inc_return(&counter),
+           (unsigned)p_atomic_inc_return(&counter),
            stats.ia_vertices,
            stats.ia_primitives,
            stats.vs_invocations,