diff options
author | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-08-07 19:25:28 +0100 |
---|---|---|
committer | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-08-07 19:25:28 +0100 |
commit | fdafa1f8632bf4e92996291a094e98f4e58dc37c (patch) | |
tree | 7f0e448d5afbb0f2f12a0363d952c1040a066e5a | |
parent | 9dee60969df7ff263e05430e69ef26982fe2bd94 (diff) |
gallium: Simplify format->name conversion.
-rw-r--r-- | src/gallium/auxiliary/util/p_debug.c | 7 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_format.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/p_debug.c b/src/gallium/auxiliary/util/p_debug.c index a3db13f96d..082b0e9fb5 100644 --- a/src/gallium/auxiliary/util/p_debug.c +++ b/src/gallium/auxiliary/util/p_debug.c @@ -335,7 +335,7 @@ const char * debug_dump_enum(const struct debug_named_value *names, unsigned long value) { - static char rest[256]; + static char rest[64]; while(names->name) { if(names->value == value) @@ -498,10 +498,9 @@ void debug_print_format(const char *msg, unsigned fmt ) } #endif -char *pf_sprint_name( char *str, enum pipe_format format ) +const char *pf_name( enum pipe_format format ) { - strcpy( str, debug_dump_enum(pipe_format_names, format) ); - return str; + return debug_dump_enum(pipe_format_names, format); } diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 947c445583..0a9cad8993 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -379,7 +379,7 @@ enum pipe_format { /** * Builds pipe format name from format token. */ -extern char *pf_sprint_name( char *str, enum pipe_format format ); +extern const char *pf_name( enum pipe_format format ); /** * Return bits for a particular component. |