From 6f4a03b08acc58945d717324e88b3d2bcec5d354 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 22 Oct 2017 17:38:55 +0200 Subject: [PATCH] gallium/u_dump: export util_dump_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change format to %p while we're at it. Reviewed-by: Marek Olšák --- src/gallium/auxiliary/util/u_dump.h | 3 +++ src/gallium/auxiliary/util/u_dump_state.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index 3fa253e511f..ff1325e1147 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -90,6 +90,9 @@ util_str_query_value_type(unsigned value, boolean shortened); const char * util_str_prim_mode(unsigned value, boolean shortened); +void +util_dump_ptr(FILE *stream, const void *value); + void util_dump_query_type(FILE *stream, unsigned value); diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index c263021a9f6..cef82a314f1 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -142,11 +142,11 @@ util_dump_null(FILE *stream) fputs("NULL", stream); } -static void +void util_dump_ptr(FILE *stream, const void *value) { if(value) - util_stream_writef(stream, "0x%08lx", (unsigned long)(uintptr_t)value); + util_stream_writef(stream, "%p", value); else util_dump_null(stream); } -- 2.30.2