diff options
author | Eric Anholt <[email protected]> | 2013-02-22 14:47:15 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-03-05 14:24:59 -0800 |
commit | c42148d16e6208c2eb2421f2ebcf823c91b670de (patch) | |
tree | 1fa07b33cf085928aa80e01c559d3a48316c08a6 /src/mesa/main | |
parent | e022461c6435bb3f8c003ea4e5fd0b09cd91100c (diff) |
mesa: Replace open-coded _mesa_lookup_enum_by_nr().
The new one doesn't have the same behavior for GL_NO_ERROR, but we don't
produce errors with GL_NO_ERROR as the error type.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/errors.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 761b5552ee9..987cddb2e32 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -29,7 +29,7 @@ #include "errors.h" - +#include "enums.h" #include "imports.h" #include "context.h" #include "dispatch.h" @@ -836,38 +836,6 @@ output_if_debug(const char *prefixString, const char *outputString, } } - -/** - * Return string version of GL error code. - */ -static const char * -error_string( GLenum error ) -{ - switch (error) { - case GL_NO_ERROR: - return "GL_NO_ERROR"; - case GL_INVALID_VALUE: - return "GL_INVALID_VALUE"; - case GL_INVALID_ENUM: - return "GL_INVALID_ENUM"; - case GL_INVALID_OPERATION: - return "GL_INVALID_OPERATION"; - case GL_STACK_OVERFLOW: - return "GL_STACK_OVERFLOW"; - case GL_STACK_UNDERFLOW: - return "GL_STACK_UNDERFLOW"; - case GL_OUT_OF_MEMORY: - return "GL_OUT_OF_MEMORY"; - case GL_TABLE_TOO_LARGE: - return "GL_TABLE_TOO_LARGE"; - case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: - return "GL_INVALID_FRAMEBUFFER_OPERATION"; - default: - return "unknown"; - } -} - - /** * When a new type of error is recorded, print a message describing * previous errors which were accumulated. @@ -880,7 +848,7 @@ flush_delayed_errors( struct gl_context *ctx ) if (ctx->ErrorDebugCount) { _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors", ctx->ErrorDebugCount, - error_string(ctx->ErrorValue)); + _mesa_lookup_enum_by_nr(ctx->ErrorValue)); output_if_debug("Mesa", s, GL_TRUE); @@ -1015,7 +983,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) } len = _mesa_snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s", - error_string(error), s); + _mesa_lookup_enum_by_nr(error), s); if (len >= MAX_DEBUG_MESSAGE_LENGTH) { /* Same as above. */ ASSERT(0); |