mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
debug: add noprefix version of debug_dump_enum
This commit is contained in:
parent
bcc45a2024
commit
8f3fac6107
2 changed files with 31 additions and 0 deletions
|
|
@ -405,6 +405,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)
|
||||
|
|
|
|||
|
|
@ -261,6 +261,11 @@ const char *
|
|||
debug_dump_enum(const struct debug_named_value *names,
|
||||
unsigned long value);
|
||||
|
||||
const char *
|
||||
debug_dump_enum_noprefix(const struct debug_named_value *names,
|
||||
const char *prefix,
|
||||
unsigned long value);
|
||||
|
||||
|
||||
/**
|
||||
* Convert binary flags value to a string.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue