diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2009-01-17 18:45:20 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2009-01-17 18:45:20 +0000 |
commit | 8f3fac6107460b6d9b011b5c76246468bb16004b (patch) | |
tree | 65b1e1d644d9b8d75d428d827f6bcfddbf89dc40 /src/gallium/auxiliary/util/p_debug.c | |
parent | bcc45a202496fba9686f953011039c09e36bf3ae (diff) |
debug: add noprefix version of debug_dump_enum
Diffstat (limited to 'src/gallium/auxiliary/util/p_debug.c')
-rw-r--r-- | src/gallium/auxiliary/util/p_debug.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/p_debug.c b/src/gallium/auxiliary/util/p_debug.c index acdfa211c8..f373f941dd 100644 --- a/src/gallium/auxiliary/util/p_debug.c +++ b/src/gallium/auxiliary/util/p_debug.c @@ -406,6 +406,32 @@ debug_dump_enum(const struct debug_named_value *names, const char * +debug_dump_enum_noprefix(const struct debug_named_value *names, + const char *prefix, + unsigned long value) +{ + static char rest[64]; + + while(names->name) { + if(names->value == value) { + const char *name = names->name; + while (*name == *prefix) { + name++; + prefix++; + } + return name; + } + ++names; + } + + + + util_snprintf(rest, sizeof(rest), "0x%08lx", value); + return rest; +} + + +const char * debug_dump_flags(const struct debug_named_value *names, unsigned long value) { |