nir: avoid warning when casting bogus pointer
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 8 Aug 2019 11:59:44 +0000 (13:59 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Aug 2019 18:23:35 +0000 (20:23 +0200)
This intentionally-bogus pointer generates a warning on some 64-bit
systems, so let's cast to a properly-sized integer first.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/nir/nir_deref.c

index 5aa1c383db701125f53c91bcbd2d6efdac3836d7..da66c5f04879880a4630d22b44d78677ebb15b07 100644 (file)
@@ -58,7 +58,7 @@ nir_deref_path_init(nir_deref_path *path,
 #ifndef NDEBUG
    /* Just in case someone uses short_path by accident */
    for (unsigned i = 0; i < ARRAY_SIZE(path->_short_path); i++)
-      path->_short_path[i] = (void *)0xdeadbeef;
+      path->_short_path[i] = (void *)(uintptr_t)0xdeadbeef;
 #endif
 
    path->path = ralloc_array(mem_ctx, nir_deref_instr *, count + 1);