mesa: avoid warning on Windows
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 13 Aug 2019 11:01:42 +0000 (13:01 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Aug 2019 18:23:49 +0000 (20:23 +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>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/driver_ddebug/dd_draw.c

index f9d9ed54b3ec326a762b9da376c65d237e23a92e..1d8e57767edf0db9a5572e91c0b9731b8542c631 100644 (file)
@@ -57,7 +57,7 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, bool verbose)
       fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
 
    snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
-            p_atomic_inc_return(&index) - 1);
+            (unsigned int)p_atomic_inc_return(&index) - 1);
 
    if (verbose)
       fprintf(stderr, "dd: dumping to file %s\n", buf);