[Mesa-dev] [PATCH v2 16/26] gallium/u_dump: export util_dump_ptr

Nicolai Hähnle nhaehnle at gmail.com
Mon Nov 6 10:23:47 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Change format to %p while we're at it.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 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
@@ -84,20 +84,23 @@ util_str_tex_filter(unsigned value, boolean shortened);
 const char *
 util_str_query_type(unsigned value, boolean shortened);
 
 const char *
 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);
 
 void
 util_dump_query_value_type(FILE *stream, unsigned value);
 
 /*
  * p_state.h, through a FILE
  */
 
 void
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
@@ -135,25 +135,25 @@ util_dump_member_end(FILE *stream)
 {
    fputs(", ", stream);
 }
 
 static void
 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);
 }
 
 
 /*
  * Code saving macros.
  */
 
 #define util_dump_arg(_stream, _type, _arg) \
-- 
2.11.0



More information about the mesa-dev mailing list