[Mesa-dev] [PATCH] Rename the _mesa_lookup_enum_by_nr() function _mesa_lookup_prim_by_nr() to _mesa_prim_string(); _mesa_lookup_enum_by_name() to _mesa_enum_value(); Changes were made, because nobody liked the way these functions are called

Arnas Milaševičius mla at arnas.me
Wed Jun 5 13:24:55 PDT 2013


Oh god damned, something messed up and I've sent the patch with the wrong
subject. Just ignore this email...


On Wed, Jun 5, 2013 at 11:21 PM, Arnas Milasevicius <giant1gf at gmail.com>wrote:

>  v3: improved commit message
>
> ---
>  src/mapi/glapi/gen/gl_enums.py                   |  6 +-
>  src/mesa/drivers/common/meta.c                   |  2 +-
>  src/mesa/drivers/dri/i915/i830_state.c           | 20 +++----
>  src/mesa/drivers/dri/i915/intel_render.c         |  2 +-
>  src/mesa/drivers/dri/i915/intel_tris.c           |  4 +-
>  src/mesa/drivers/dri/i965/brw_draw.c             | 10 ++--
>  src/mesa/drivers/dri/i965/brw_draw_upload.c      |  2 +-
>  src/mesa/drivers/dri/i965/gen6_cc.c              |  4 +-
>  src/mesa/drivers/dri/intel/intel_fbo.c           |  2 +-
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c   |  2 +-
>  src/mesa/drivers/dri/intel/intel_tex_image.c     |  2 +-
>  src/mesa/drivers/dri/intel/intel_tex_subimage.c  |  2 +-
>  src/mesa/drivers/dri/r200/r200_state.c           |  2 +-
>  src/mesa/drivers/dri/r200/r200_tex.c             | 20 +++----
>  src/mesa/drivers/dri/radeon/radeon_common.c      |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_fbo.c         |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_pixel_read.c  |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_state.c       |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_swtcl.c       |  2 +-
>  src/mesa/drivers/dri/radeon/radeon_tex.c         |  6 +-
>  src/mesa/drivers/dri/radeon/radeon_texture.c     |  4 +-
>  src/mesa/main/atifragshader.c                    | 30 +++++-----
>  src/mesa/main/attrib.c                           |  2 +-
>  src/mesa/main/blend.c                            | 34 ++++++------
>  src/mesa/main/bufferobj.c                        | 10 ++--
>  src/mesa/main/buffers.c                          |  6 +-
>  src/mesa/main/clear.c                            |  8 +--
>  src/mesa/main/condrender.c                       |  4 +-
>  src/mesa/main/debug.c                            |  2 +-
>  src/mesa/main/depth.c                            |  2 +-
>  src/mesa/main/dlist.c                            | 14 ++---
>  src/mesa/main/api_validate.c                     |  6 +-
>  src/mesa/main/drawpix.c                          | 18 +++---
>  src/mesa/main/enable.c                           | 12 ++--
>  src/mesa/main/enums.h                            |  6 +-
>  src/mesa/main/errors.c                           |  4 +-
>  src/mesa/main/fbobject.c                         | 30 +++++-----
>  src/mesa/main/formatquery.c                      |  8 +--
>  src/mesa/main/framebuffer.c                      |  2 +-
>  src/mesa/main/get.c                              |  8 +--
>  src/mesa/main/getstring.c                        |  4 +-
>  src/mesa/main/hint.c                             |  4 +-
>  src/mesa/main/light.c                            |  6 +-
>  src/mesa/main/matrix.c                           |  8 +--
>  src/mesa/main/pack.c                             | 10 ++--
>  src/mesa/main/pack_tmp.h                         |  2 +-
>  src/mesa/main/polygon.c                          |  8 +--
>  src/mesa/main/queryobj.c                         | 26 ++++-----
>  src/mesa/main/readpix.c                          | 12 ++--
>  src/mesa/main/samplerobj.c                       | 20 +++----
>  src/mesa/main/shaderapi.c                        | 12 ++--
>  src/mesa/main/tests/enum_strings.cpp             |  8 +--
>  src/mesa/main/texenv.c                           | 10 ++--
>  src/mesa/main/texformat.c                        |  2 +-
>  src/mesa/main/texgen.c                           |  6 +-
>  src/mesa/main/teximage.c                         | 70
> ++++++++++++------------
>  src/mesa/main/texobj.c                           |  2 +-
>  src/mesa/main/texparam.c                         | 14 ++---
>  src/mesa/main/texstate.c                         | 36 ++++++------
>  src/mesa/main/texstorage.c                       |  4 +-
>  src/mesa/main/texstore.c                         |  4 +-
>  src/mesa/main/uniforms.c                         |  2 +-
>  src/mesa/main/varray.c                           |  2 +-
>  src/mesa/tnl/t_draw.c                            |  2 +-
>  src/mesa/tnl/t_vb_render.c                       |  2 +-
>  src/mesa/tnl/t_vertex_sse.c                      |  2 +-
>  src/mesa/tnl_dd/t_dd_dmatmp.h                    |  2 +-
>  src/mesa/tnl_dd/t_dd_unfilled.h                  |  2 +-
>  src/mesa/vbo/vbo_exec_array.c                    | 46 ++++++++--------
>  src/mesa/vbo/vbo_exec_draw.c                     |  2 +-
>  src/mesa/vbo/vbo_save_api.c                      |  2 +-
>  src/mesa/vbo/vbo_save_loopback.c                 |  2 +-
>  73 files changed, 321 insertions(+), 321 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/gl_enums.py
> b/src/mapi/glapi/gen/gl_enums.py
> index 806d384..6a9acc7 100644
> --- a/src/mapi/glapi/gen/gl_enums.py
> +++ b/src/mapi/glapi/gen/gl_enums.py
> @@ -91,7 +91,7 @@ static int compar_nr( const int *a, const unsigned *b )
>
>  static char token_tmp[20];
>
> -const char *_mesa_lookup_enum_by_nr( int nr )
> +const char *_mesa_enum_string( int nr )
>  {
>     unsigned * i;
>
> @@ -138,7 +138,7 @@ static const char *prim_names[PRIM_MAX+3] = {
>   * GL_FALSE/GL_POINTS ambiguity and others.
>   */
>  const char *
> -_mesa_lookup_prim_by_nr(GLuint nr)
> +_mesa_prim_string(GLuint nr)
>  {
>     if (nr < Elements(prim_names))
>        return prim_names[nr];
> @@ -147,7 +147,7 @@ _mesa_lookup_prim_by_nr(GLuint nr)
>  }
>
>
> -int _mesa_lookup_enum_by_name( const char *symbol )
> +int _mesa_enum_value( const char *symbol )
>  {
>     enum_elt * f = NULL;
>
> diff --git a/src/mesa/drivers/common/meta.c
> b/src/mesa/drivers/common/meta.c
> index 373e8f5..c0d6194 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -3059,7 +3059,7 @@ _mesa_meta_check_generate_mipmap_fallback(struct
> gl_context *ctx, GLenum target,
>         target == GL_TEXTURE_2D_ARRAY) {
>        _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
>                         "glGenerateMipmap() to %s target\n",
> -                       _mesa_lookup_enum_by_nr(target));
> +                       _mesa_enum_string(target));
>        return GL_TRUE;
>     }
>
> diff --git a/src/mesa/drivers/dri/i915/i830_state.c
> b/src/mesa/drivers/dri/i915/i830_state.c
> index cedc58a..df19969 100644
> --- a/src/mesa/drivers/dri/i915/i830_state.c
> +++ b/src/mesa/drivers/dri/i915/i830_state.c
> @@ -57,7 +57,7 @@ i830StencilFuncSeparate(struct gl_context * ctx, GLenum
> face, GLenum func, GLint
>     mask = mask & 0xff;
>
>     DBG("%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(func), ref, mask);
> +       _mesa_enum_string(func), ref, mask);
>
>
>     I830_STATECHANGE(i830, I830_UPLOAD_CTX);
> @@ -95,9 +95,9 @@ i830StencilOpSeparate(struct gl_context * ctx, GLenum
> face, GLenum fail, GLenum
>     int fop, dfop, dpop;
>
>     DBG("%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(fail),
> -       _mesa_lookup_enum_by_nr(zfail),
> -       _mesa_lookup_enum_by_nr(zpass));
> +       _mesa_enum_string(fail),
> +       _mesa_enum_string(zfail),
> +       _mesa_enum_string(zpass));
>
>     fop = 0;
>     dfop = 0;
> @@ -389,8 +389,8 @@ static void
>  i830BlendEquationSeparate(struct gl_context * ctx, GLenum modeRGB, GLenum
> modeA)
>  {
>     DBG("%s -> %s, %s\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(modeRGB),
> -       _mesa_lookup_enum_by_nr(modeA));
> +       _mesa_enum_string(modeRGB),
> +       _mesa_enum_string(modeA));
>
>     (void) modeRGB;
>     (void) modeA;
> @@ -403,10 +403,10 @@ i830BlendFuncSeparate(struct gl_context * ctx,
> GLenum sfactorRGB,
>                        GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA)
>  {
>     DBG("%s -> RGB(%s, %s) A(%s, %s)\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(sfactorRGB),
> -       _mesa_lookup_enum_by_nr(dfactorRGB),
> -       _mesa_lookup_enum_by_nr(sfactorA),
> -       _mesa_lookup_enum_by_nr(dfactorA));
> +       _mesa_enum_string(sfactorRGB),
> +       _mesa_enum_string(dfactorRGB),
> +       _mesa_enum_string(sfactorA),
> +       _mesa_enum_string(dfactorA));
>
>     (void) sfactorRGB;
>     (void) dfactorRGB;
> diff --git a/src/mesa/drivers/dri/i915/intel_render.c
> b/src/mesa/drivers/dri/i915/intel_render.c
> index 6afd738..6767076 100644
> --- a/src/mesa/drivers/dri/i915/intel_render.c
> +++ b/src/mesa/drivers/dri/i915/intel_render.c
> @@ -113,7 +113,7 @@ static void
>  intelDmaPrimitive(struct intel_context *intel, GLenum prim)
>  {
>     if (0)
> -      fprintf(stderr, "%s %s\n", __FUNCTION__,
> _mesa_lookup_enum_by_nr(prim));
> +      fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_enum_string(prim));
>     INTEL_FIREVERTICES(intel);
>     intel->vtbl.reduced_primitive_state(intel, reduced_prim[prim]);
>     intel_set_prim(intel, hw_prim[prim]);
> diff --git a/src/mesa/drivers/dri/i915/intel_tris.c
> b/src/mesa/drivers/dri/i915/intel_tris.c
> index 7c60d84..41c7451 100644
> --- a/src/mesa/drivers/dri/i915/intel_tris.c
> +++ b/src/mesa/drivers/dri/i915/intel_tris.c
> @@ -1136,7 +1136,7 @@ intelRasterPrimitive(struct gl_context * ctx, GLenum
> rprim, GLuint hwprim)
>
>     if (0)
>        fprintf(stderr, "%s %s %x\n", __FUNCTION__,
> -              _mesa_lookup_enum_by_nr(rprim), hwprim);
> +              _mesa_enum_string(rprim), hwprim);
>
>     intel->vtbl.reduced_primitive_state(intel, rprim);
>
> @@ -1160,7 +1160,7 @@ intelRenderPrimitive(struct gl_context * ctx, GLenum
> prim)
>                           ctx->Polygon.BackMode != GL_FILL);
>
>     if (0)
> -      fprintf(stderr, "%s %s\n", __FUNCTION__,
> _mesa_lookup_enum_by_nr(prim));
> +      fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_enum_string(prim));
>
>     /* Let some clipping routines know which primitive they're dealing
>      * with.
> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c
> b/src/mesa/drivers/dri/i965/brw_draw.c
> index 657d6ee..3295367 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw.c
> @@ -92,7 +92,7 @@ static void brw_set_prim(struct brw_context *brw,
>     struct gl_context *ctx = &brw->intel.ctx;
>     uint32_t hw_prim = prim_to_hw_prim[prim->mode];
>
> -   DBG("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
> +   DBG("PRIM: %s\n", _mesa_enum_string(prim->mode));
>
>     /* Slight optimization to avoid the GS program when not needed:
>      */
> @@ -125,7 +125,7 @@ static void gen6_set_prim(struct brw_context *brw,
>  {
>     uint32_t hw_prim;
>
> -   DBG("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
> +   DBG("PRIM: %s\n", _mesa_enum_string(prim->mode));
>
>     hw_prim = prim_to_hw_prim[prim->mode];
>
> @@ -165,7 +165,7 @@ static void brw_emit_prim(struct brw_context *brw,
>     int start_vertex_location;
>     int base_vertex_location;
>
> -   DBG("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode),
> +   DBG("PRIM: %s %d %d\n", _mesa_enum_string(prim->mode),
>         prim->start, prim->count);
>
>     start_vertex_location = prim->start;
> @@ -226,7 +226,7 @@ static void gen7_emit_prim(struct brw_context *brw,
>     int start_vertex_location;
>     int base_vertex_location;
>
> -   DBG("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode),
> +   DBG("PRIM: %s %d %d\n", _mesa_enum_string(prim->mode),
>         prim->start, prim->count);
>
>     start_vertex_location = prim->start;
> @@ -517,7 +517,7 @@ void brw_draw_prims( struct gl_context *ctx,
>      */
>     if (ctx->RenderMode != GL_RENDER) {
>        perf_debug("%s render mode not supported in hardware\n",
> -                 _mesa_lookup_enum_by_nr(ctx->RenderMode));
> +                 _mesa_enum_string(ctx->RenderMode));
>        _swsetup_Wakeup(ctx);
>        _tnl_wakeup(ctx);
>        _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index,
> max_index);
> diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c
> b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> index 2ded14b..304cfd5 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> @@ -230,7 +230,7 @@ get_surface_type(struct intel_context *intel,
>
>     if (unlikely(INTEL_DEBUG & DEBUG_VERTS))
>        printf("type %s size %d normalized %d\n",
> -             _mesa_lookup_enum_by_nr(glarray->Type),
> +             _mesa_enum_string(glarray->Type),
>               glarray->Size, glarray->Normalized);
>
>     if (glarray->Integer) {
> diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c
> b/src/mesa/drivers/dri/i965/gen6_cc.c
> index e4ec170..245a3a3 100644
> --- a/src/mesa/drivers/dri/i965/gen6_cc.c
> +++ b/src/mesa/drivers/dri/i965/gen6_cc.c
> @@ -97,8 +97,8 @@ gen6_upload_blend_state(struct brw_context *brw)
>                     rb_type != GL_UNSIGNED_NORMALIZED &&
>                     rb_type != GL_FLOAT, "Ignoring %s logic op on %s "
>                     "renderbuffer\n",
> -                   _mesa_lookup_enum_by_nr(ctx->Color.LogicOp),
> -                   _mesa_lookup_enum_by_nr(rb_type));
> +                   _mesa_enum_string(ctx->Color.LogicOp),
> +                   _mesa_enum_string(rb_type));
>          if (rb_type == GL_UNSIGNED_NORMALIZED) {
>             blend[b].blend1.logic_op_enable = 1;
>             blend[b].blend1.logic_op_func =
> diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c
> b/src/mesa/drivers/dri/intel/intel_fbo.c
> index 9f892a9..b61a8df 100644
> --- a/src/mesa/drivers/dri/intel/intel_fbo.c
> +++ b/src/mesa/drivers/dri/intel/intel_fbo.c
> @@ -248,7 +248,7 @@ intel_alloc_renderbuffer_storage(struct gl_context *
> ctx, struct gl_renderbuffer
>     intel_miptree_release(&irb->mt);
>
>     DBG("%s: %s: %s (%dx%d)\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(internalFormat),
> +       _mesa_enum_string(internalFormat),
>         _mesa_get_format_name(rb->Format), width, height);
>
>     if (width == 0 || height == 0)
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> index c336c46..0b5e831 100644
> --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> @@ -143,7 +143,7 @@ intel_miptree_create_layout(struct intel_context
> *intel,
>     struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
>
>     DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(target),
> +       _mesa_enum_string(target),
>         _mesa_get_format_name(format),
>         first_level, last_level, mt);
>
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c
> b/src/mesa/drivers/dri/intel/intel_tex_image.c
> index fba02c2..e8b5935 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
> @@ -196,7 +196,7 @@ intelTexImage(struct gl_context * ctx,
>     bool ok;
>
>     DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
> +       _mesa_enum_string(texImage->TexObject->Target),
>         texImage->Level, texImage->Width, texImage->Height,
> texImage->Depth);
>
>     ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> index bd178bb..de2beeb 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> @@ -78,7 +78,7 @@ intel_blit_texsubimage(struct gl_context * ctx,
>
>     DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
>         __FUNCTION__,
> -       _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
> +       _mesa_enum_string(texImage->TexObject->Target),
>         texImage->Level, xoffset, yoffset, width, height);
>
>     pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1,
> diff --git a/src/mesa/drivers/dri/r200/r200_state.c
> b/src/mesa/drivers/dri/r200/r200_state.c
> index d3e8114..0674a13 100644
> --- a/src/mesa/drivers/dri/r200/r200_state.c
> +++ b/src/mesa/drivers/dri/r200/r200_state.c
> @@ -1722,7 +1722,7 @@ static void r200Enable( struct gl_context *ctx,
> GLenum cap, GLboolean state )
>
>     if ( R200_DEBUG & RADEON_STATE )
>        fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
> -              _mesa_lookup_enum_by_nr( cap ),
> +              _mesa_enum_string( cap ),
>                state ? "GL_TRUE" : "GL_FALSE" );
>
>     switch ( cap ) {
> diff --git a/src/mesa/drivers/dri/r200/r200_tex.c
> b/src/mesa/drivers/dri/r200/r200_tex.c
> index 31a65c8..39314d6 100644
> --- a/src/mesa/drivers/dri/r200/r200_tex.c
> +++ b/src/mesa/drivers/dri/r200/r200_tex.c
> @@ -68,9 +68,9 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum
> swrap, GLenum twrap, GLenu
>     radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>                 "%s(tex %p) sw %s, tw %s, rw %s\n",
>                 __func__, t,
> -               _mesa_lookup_enum_by_nr(swrap),
> -               _mesa_lookup_enum_by_nr(twrap),
> -               _mesa_lookup_enum_by_nr(rwrap));
> +               _mesa_enum_string(swrap),
> +               _mesa_enum_string(twrap),
> +               _mesa_enum_string(rwrap));
>
>     t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK |
> R200_BORDER_MODE_D3D);
>
> @@ -225,8 +225,8 @@ static void r200SetTexFilter( radeonTexObjPtr t,
> GLenum minf, GLenum magf )
>     radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>         "%s(tex %p) minf %s, maxf %s, anisotropy %d.\n",
>         __func__, t,
> -       _mesa_lookup_enum_by_nr(minf),
> -       _mesa_lookup_enum_by_nr(magf),
> +       _mesa_enum_string(minf),
> +       _mesa_enum_string(magf),
>         anisotropy);
>
>     if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) {
> @@ -302,7 +302,7 @@ static void r200TexEnv( struct gl_context *ctx, GLenum
> target,
>     struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
>
>     radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE, "%s( %s
> )\n",
> -              __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
> +              __FUNCTION__, _mesa_enum_string( pname ) );
>
>     /* This is incorrect: Need to maintain this data for each of
>      * GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
> @@ -384,8 +384,8 @@ static void r200TexParameter( struct gl_context *ctx,
> GLenum target,
>     radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE,
>                 "%s(%p, tex %p)  target %s, pname %s\n",
>                 __FUNCTION__, ctx, texObj,
> -               _mesa_lookup_enum_by_nr( target ),
> -              _mesa_lookup_enum_by_nr( pname ) );
> +               _mesa_enum_string( target ),
> +              _mesa_enum_string( pname ) );
>
>     switch ( pname ) {
>     case GL_TEXTURE_MIN_FILTER:
> @@ -416,7 +416,7 @@ static void r200DeleteTexture(struct gl_context * ctx,
> struct gl_texture_object
>     radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_NORMAL,
>             "%s( %p (target = %s) )\n", __FUNCTION__,
>            (void *)texObj,
> -          _mesa_lookup_enum_by_nr(texObj->Target));
> +          _mesa_enum_string(texObj->Target));
>
>     if (rmesa) {
>        int i;
> @@ -474,7 +474,7 @@ static struct gl_texture_object
> *r200NewTextureObject(struct gl_context * ctx,
>     radeon_print(RADEON_STATE | RADEON_TEXTURE, RADEON_NORMAL,
>             "%s(%p) target %s, new texture %p.\n",
>            __FUNCTION__, ctx,
> -          _mesa_lookup_enum_by_nr(target), t);
> +          _mesa_enum_string(target), t);
>
>     _mesa_initialize_texture_object(&t->base, name, target);
>     t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
> diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c
> b/src/mesa/drivers/dri/radeon/radeon_common.c
> index 0cf656b..8d6d92b 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_common.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_common.c
> @@ -356,7 +356,7 @@ void radeonDrawBuffer( struct gl_context *ctx, GLenum
> mode )
>  {
>         if (RADEON_DEBUG & RADEON_DRI)
>                 fprintf(stderr, "%s %s\n", __FUNCTION__,
> -                       _mesa_lookup_enum_by_nr( mode ));
> +                       _mesa_enum_string( mode ));
>
>         if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
>                 radeonContextPtr radeon = RADEON_CONTEXT(ctx);
> diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c
> b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> index 63bc7e8..2e9449c 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> @@ -732,7 +732,7 @@ radeon_bind_framebuffer(struct gl_context * ctx,
> GLenum target,
>    radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>                 "%s(%p, fb %p, target %s) \n",
>                 __func__, ctx, fb,
> -               _mesa_lookup_enum_by_nr(target));
> +               _mesa_enum_string(target));
>
>     if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT)
> {
>        radeon_draw_buffer(ctx, fb);
> diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> index 4cb1838..ed0e788 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> @@ -276,7 +276,7 @@ static void calculate_min_max_lod(struct
> gl_sampler_object *samp, struct gl_text
>         radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>                         "%s(%p) target %s, min %d, max %d.\n",
>                         __func__, tObj,
> -                       _mesa_lookup_enum_by_nr(tObj->Target),
> +                       _mesa_enum_string(tObj->Target),
>                         minLod, maxLod);
>
>         /* save these values */
> diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
> b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
> index db5e01d..757a8ee 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
> @@ -212,7 +212,7 @@ radeonReadPixels(struct gl_context * ctx,
>       */
>      radeon_print(RADEON_FALLBACKS, RADEON_NORMAL,
>                   "Falling back to sw for ReadPixels (format %s, type
> %s)\n",
> -                 _mesa_lookup_enum_by_nr(format),
> _mesa_lookup_enum_by_nr(type));
> +                 _mesa_enum_string(format), _mesa_enum_string(type));
>
>      if (ctx->NewState)
>          _mesa_update_state(ctx);
> diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c
> b/src/mesa/drivers/dri/radeon/radeon_state.c
> index 70542f6..c7982dc 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_state.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_state.c
> @@ -1505,7 +1505,7 @@ static void radeonEnable( struct gl_context *ctx,
> GLenum cap, GLboolean state )
>
>     if ( RADEON_DEBUG & RADEON_STATE )
>        fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
> -              _mesa_lookup_enum_by_nr( cap ),
> +              _mesa_enum_string( cap ),
>                state ? "GL_TRUE" : "GL_FALSE" );
>
>     switch ( cap ) {
> diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> index 1e80162..3df90b3 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> @@ -440,7 +440,7 @@ static GLboolean radeon_run_render( struct gl_context
> *ctx,
>
>        radeon_print(RADEON_SWRENDER, RADEON_NORMAL,
>           "radeon_render.c: prim %s %d..%d\n",
> -                _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
> +                _mesa_enum_string(prim & PRIM_MODE_MASK),
>                  start, start+length);
>
>        if (length)
> diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c
> b/src/mesa/drivers/dri/radeon/radeon_tex.c
> index 301949d..aff67ef 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_tex.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
> @@ -263,7 +263,7 @@ static void radeonTexEnv( struct gl_context *ctx,
> GLenum target,
>
>     if ( RADEON_DEBUG & RADEON_STATE ) {
>        fprintf( stderr, "%s( %s )\n",
> -              __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
> +              __FUNCTION__, _mesa_enum_string( pname ) );
>     }
>
>     switch ( pname ) {
> @@ -335,7 +335,7 @@ static void radeonTexParameter( struct gl_context
> *ctx, GLenum target,
>     radeonTexObj* t = radeon_tex_obj(texObj);
>
>     radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, "%s( %s )\n",
> __FUNCTION__,
> -              _mesa_lookup_enum_by_nr( pname ) );
> +              _mesa_enum_string( pname ) );
>
>     switch ( pname ) {
>     case GL_TEXTURE_BASE_LEVEL:
> @@ -359,7 +359,7 @@ static void radeonDeleteTexture( struct gl_context
> *ctx,
>
>     radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
>          "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
> -              _mesa_lookup_enum_by_nr( texObj->Target ) );
> +              _mesa_enum_string( texObj->Target ) );
>
>     if ( rmesa ) {
>       radeon_firevertices(&rmesa->radeon);
> diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c
> b/src/mesa/drivers/dri/radeon/radeon_texture.c
> index 52cf95d..f7dd238 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_texture.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
> @@ -267,8 +267,8 @@ gl_format radeonChooseTextureFormat(struct gl_context
> * ctx,
>         radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>                 "%s InternalFormat=%s(%d) type=%s format=%s\n",
>                 __func__,
> -               _mesa_lookup_enum_by_nr(internalFormat), internalFormat,
> -               _mesa_lookup_enum_by_nr(type),
> _mesa_lookup_enum_by_nr(format));
> +               _mesa_enum_string(internalFormat), internalFormat,
> +               _mesa_enum_string(type), _mesa_enum_string(format));
>         radeon_print(RADEON_TEXTURE, RADEON_TRACE,
>                         "%s do32bpt=%d force16bpt=%d\n",
>                         __func__, do32bpt, force16bpt);
> diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c
> index 7077c96..e6d551f 100644
> --- a/src/mesa/main/atifragshader.c
> +++ b/src/mesa/main/atifragshader.c
> @@ -132,21 +132,21 @@ static void debug_op(GLint optype, GLuint arg_count,
> GLenum op, GLuint dst,
>
>    op_name = atifs_ops[(arg_count-1)+(optype?3:0)];
>
> -  fprintf(stderr, "%s(%s, %s", op_name, _mesa_lookup_enum_by_nr(op),
> -             _mesa_lookup_enum_by_nr(dst));
> +  fprintf(stderr, "%s(%s, %s", op_name, _mesa_enum_string(op),
> +             _mesa_enum_string(dst));
>    if (!optype)
>      fprintf(stderr, ", %d", dstMask);
>
>    fprintf(stderr, ", %s", create_dst_mod_str(dstMod));
>
> -  fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg1),
> -             _mesa_lookup_enum_by_nr(arg1Rep), arg1Mod);
> +  fprintf(stderr, ", %s, %s, %d", _mesa_enum_string(arg1),
> +             _mesa_enum_string(arg1Rep), arg1Mod);
>    if (arg_count>1)
> -    fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg2),
> -             _mesa_lookup_enum_by_nr(arg2Rep), arg2Mod);
> +    fprintf(stderr, ", %s, %s, %d", _mesa_enum_string(arg2),
> +             _mesa_enum_string(arg2Rep), arg2Mod);
>    if (arg_count>2)
> -    fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg3),
> -             _mesa_lookup_enum_by_nr(arg3Rep), arg3Mod);
> +    fprintf(stderr, ", %s, %s, %d", _mesa_enum_string(arg3),
> +             _mesa_enum_string(arg3Rep), arg3Mod);
>
>    fprintf(stderr,")\n");
>
> @@ -383,7 +383,7 @@ _mesa_EndFragmentShaderATI(void)
>     for (j = 0; j < MAX_NUM_PASSES_ATI; j++) {
>        for (i = 0; i < MAX_NUM_FRAGMENT_REGISTERS_ATI; i++) {
>          GLuint op = curProg->SetupInst[j][i].Opcode;
> -        const char *op_enum = op > 5 ? _mesa_lookup_enum_by_nr(op) : "0";
> +        const char *op_enum = op > 5 ? _mesa_enum_string(op) : "0";
>          GLuint src = curProg->SetupInst[j][i].src;
>          GLuint swizzle = curProg->SetupInst[j][i].swizzle;
>          fprintf(stderr, "%2d %04X %s %d %04X\n", i, op, op_enum, src,
> @@ -392,8 +392,8 @@ _mesa_EndFragmentShaderATI(void)
>        for (i = 0; i < curProg->numArithInstr[j]; i++) {
>          GLuint op0 = curProg->Instructions[j][i].Opcode[0];
>          GLuint op1 = curProg->Instructions[j][i].Opcode[1];
> -        const char *op0_enum = op0 > 5 ? _mesa_lookup_enum_by_nr(op0) :
> "0";
> -        const char *op1_enum = op1 > 5 ? _mesa_lookup_enum_by_nr(op1) :
> "0";
> +        const char *op0_enum = op0 > 5 ? _mesa_enum_string(op0) : "0";
> +        const char *op1_enum = op1 > 5 ? _mesa_enum_string(op1) : "0";
>          GLuint count0 = curProg->Instructions[j][i].ArgCount[0];
>          GLuint count1 = curProg->Instructions[j][i].ArgCount[1];
>          fprintf(stderr, "%2d %04X %s %d %04X %s %d\n", i, op0, op0_enum,
> count0,
> @@ -477,8 +477,8 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum
> swizzle)
>
>  #if MESA_DEBUG_ATI_FS
>     _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__,
> -              _mesa_lookup_enum_by_nr(dst),
> _mesa_lookup_enum_by_nr(coord),
> -              _mesa_lookup_enum_by_nr(swizzle));
> +              _mesa_enum_string(dst), _mesa_enum_string(coord),
> +              _mesa_enum_string(swizzle));
>  #endif
>  }
>
> @@ -550,8 +550,8 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum
> swizzle)
>
>  #if MESA_DEBUG_ATI_FS
>     _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__,
> -              _mesa_lookup_enum_by_nr(dst),
> _mesa_lookup_enum_by_nr(interp),
> -              _mesa_lookup_enum_by_nr(swizzle));
> +              _mesa_enum_string(dst), _mesa_enum_string(interp),
> +              _mesa_enum_string(swizzle));
>  #endif
>  }
>
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index 9358e69..a2467d9 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -858,7 +858,7 @@ _mesa_PopAttrib(void)
>
>        if (MESA_VERBOSE & VERBOSE_API) {
>           _mesa_debug(ctx, "glPopAttrib %s\n",
> -                     _mesa_lookup_enum_by_nr(attr->kind));
> +                     _mesa_enum_string(attr->kind));
>        }
>
>        switch (attr->kind) {
> diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
> index c97c207..717b6d3 100644
> --- a/src/mesa/main/blend.c
> +++ b/src/mesa/main/blend.c
> @@ -130,28 +130,28 @@ validate_blend_factors(struct gl_context *ctx, const
> char *func,
>     if (!legal_src_factor(ctx, sfactorRGB)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "%s(sfactorRGB = %s)", func,
> -                  _mesa_lookup_enum_by_nr(sfactorRGB));
> +                  _mesa_enum_string(sfactorRGB));
>        return GL_FALSE;
>     }
>
>     if (!legal_dst_factor(ctx, dfactorRGB)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "%s(dfactorRGB = %s)", func,
> -                  _mesa_lookup_enum_by_nr(dfactorRGB));
> +                  _mesa_enum_string(dfactorRGB));
>        return GL_FALSE;
>     }
>
>     if (sfactorA != sfactorRGB && !legal_src_factor(ctx, sfactorA)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "%s(sfactorA = %s)", func,
> -                  _mesa_lookup_enum_by_nr(sfactorA));
> +                  _mesa_enum_string(sfactorA));
>        return GL_FALSE;
>     }
>
>     if (dfactorA != dfactorRGB && !legal_dst_factor(ctx, dfactorA)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "%s(dfactorA = %s)", func,
> -                  _mesa_lookup_enum_by_nr(dfactorA));
> +                  _mesa_enum_string(dfactorA));
>        return GL_FALSE;
>     }
>
> @@ -210,10 +210,10 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum
> dfactorRGB,
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n",
> -                  _mesa_lookup_enum_by_nr(sfactorRGB),
> -                  _mesa_lookup_enum_by_nr(dfactorRGB),
> -                  _mesa_lookup_enum_by_nr(sfactorA),
> -                  _mesa_lookup_enum_by_nr(dfactorA));
> +                  _mesa_enum_string(sfactorRGB),
> +                  _mesa_enum_string(dfactorRGB),
> +                  _mesa_enum_string(sfactorA),
> +                  _mesa_enum_string(dfactorA));
>
>     if (!validate_blend_factors(ctx, "glBlendFuncSeparate",
>                                 sfactorRGB, dfactorRGB,
> @@ -344,7 +344,7 @@ _mesa_BlendEquation( GLenum mode )
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBlendEquation(%s)\n",
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(mode));
>
>     if (!legal_blend_equation(ctx, mode)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation");
> @@ -387,7 +387,7 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBlendEquationi(%u, %s)\n",
> -                  buf, _mesa_lookup_enum_by_nr(mode));
> +                  buf, _mesa_enum_string(mode));
>
>     if (buf >= ctx->Const.MaxDrawBuffers) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
> "glBlendFuncSeparatei(buffer=%u)",
> @@ -423,8 +423,8 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum
> modeA )
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
> -                  _mesa_lookup_enum_by_nr(modeRGB),
> -                  _mesa_lookup_enum_by_nr(modeA));
> +                  _mesa_enum_string(modeRGB),
> +                  _mesa_enum_string(modeA));
>
>     if ( (modeRGB != modeA) &&
> !ctx->Extensions.EXT_blend_equation_separate ) {
>        _mesa_error(ctx, GL_INVALID_OPERATION,
> @@ -478,8 +478,8 @@ _mesa_BlendEquationSeparateiARB(GLuint buf, GLenum
> modeRGB, GLenum modeA)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBlendEquationSeparatei(%u, %s %s)\n", buf,
> -                  _mesa_lookup_enum_by_nr(modeRGB),
> -                  _mesa_lookup_enum_by_nr(modeA));
> +                  _mesa_enum_string(modeRGB),
> +                  _mesa_enum_string(modeA));
>
>     if (buf >= ctx->Const.MaxDrawBuffers) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
> "glBlendEquationSeparatei(buffer=%u)",
> @@ -569,7 +569,7 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glAlphaFunc(%s, %f)\n",
> -                  _mesa_lookup_enum_by_nr(func), ref);
> +                  _mesa_enum_string(func), ref);
>
>     switch (func) {
>     case GL_NEVER:
> @@ -615,7 +615,7 @@ _mesa_LogicOp( GLenum opcode )
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLogicOp(%s)\n",
> _mesa_lookup_enum_by_nr(opcode));
> +      _mesa_debug(ctx, "glLogicOp(%s)\n", _mesa_enum_string(opcode));
>
>     switch (opcode) {
>        case GL_CLEAR:
> @@ -792,7 +792,7 @@ _mesa_ClampColor(GLenum target, GLenum clamp)
>
>  invalid_enum:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glClampColor(%s)",
> -               _mesa_lookup_enum_by_nr(target));
> +               _mesa_enum_string(target));
>  }
>
>  static GLboolean
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index bd71688..444c2d4 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -815,7 +815,7 @@ _mesa_BindBuffer(GLenum target, GLuint buffer)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBindBuffer(%s, %u)\n",
> -                  _mesa_lookup_enum_by_nr(target), buffer);
> +                  _mesa_enum_string(target), buffer);
>
>     bind_buffer_object(ctx, target, buffer);
>  }
> @@ -1005,9 +1005,9 @@ _mesa_BufferData(GLenum target, GLsizeiptrARB size,
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBufferData(%s, %ld, %p, %s)\n",
> -                  _mesa_lookup_enum_by_nr(target),
> +                  _mesa_enum_string(target),
>                    (long int) size, data,
> -                  _mesa_lookup_enum_by_nr(usage));
> +                  _mesa_enum_string(usage));
>
>     if (size < 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE, "glBufferDataARB(size < 0)");
> @@ -1319,7 +1319,7 @@ _mesa_GetBufferParameteriv(GLenum target, GLenum
> pname, GLint *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM,
> "glGetBufferParameterivARB(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1372,7 +1372,7 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum
> pname, GLint64 *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameteri64v(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
> index e80f040..8db46c2 100644
> --- a/src/mesa/main/buffers.c
> +++ b/src/mesa/main/buffers.c
> @@ -248,7 +248,7 @@ _mesa_DrawBuffer(GLenum buffer)
>     FLUSH_VERTICES(ctx, 0);
>
>     if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glDrawBuffer %s\n",
> _mesa_lookup_enum_by_nr(buffer));
> +      _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_enum_string(buffer));
>     }
>
>     if (buffer == GL_NONE) {
> @@ -615,12 +615,12 @@ _mesa_ReadBuffer(GLenum buffer)
>     FLUSH_VERTICES(ctx, 0);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glReadBuffer %s\n",
> _mesa_lookup_enum_by_nr(buffer));
> +      _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_enum_string(buffer));
>
>     fb = ctx->ReadBuffer;
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glReadBuffer %s\n",
> _mesa_lookup_enum_by_nr(buffer));
> +      _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_enum_string(buffer));
>
>     if (buffer == GL_NONE) {
>        /* This is legal--it means that no buffer should be bound for
> reading. */
> diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
> index 304d135..574bbb3 100644
> --- a/src/mesa/main/clear.c
> +++ b/src/mesa/main/clear.c
> @@ -353,7 +353,7 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer,
> const GLint *value)
>        return;
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferiv(buffer=%s)",
> -                  _mesa_lookup_enum_by_nr(buffer));
> +                  _mesa_enum_string(buffer));
>        return;
>     }
>  }
> @@ -425,7 +425,7 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer,
> const GLuint *value)
>        return;
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
> -                  _mesa_lookup_enum_by_nr(buffer));
> +                  _mesa_enum_string(buffer));
>        return;
>     }
>  }
> @@ -517,7 +517,7 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer,
> const GLfloat *value)
>        return;
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfv(buffer=%s)",
> -                  _mesa_lookup_enum_by_nr(buffer));
> +                  _mesa_enum_string(buffer));
>        return;
>     }
>  }
> @@ -539,7 +539,7 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
>
>     if (buffer != GL_DEPTH_STENCIL) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)",
> -                  _mesa_lookup_enum_by_nr(buffer));
> +                  _mesa_enum_string(buffer));
>        return;
>     }
>
> diff --git a/src/mesa/main/condrender.c b/src/mesa/main/condrender.c
> index 3d9b0ec..187f780 100644
> --- a/src/mesa/main/condrender.c
> +++ b/src/mesa/main/condrender.c
> @@ -60,7 +60,7 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode)
>        break;
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glBeginConditionalRender(mode=%s)",
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(mode));
>        return;
>     }
>
> @@ -144,7 +144,7 @@ _mesa_check_conditional_render(struct gl_context *ctx)
>     default:
>        _mesa_problem(ctx, "Bad cond render mode %s in "
>                      " _mesa_check_conditional_render()",
> -                    _mesa_lookup_enum_by_nr(ctx->Query.CondRenderMode));
> +                    _mesa_enum_string(ctx->Query.CondRenderMode));
>        return GL_TRUE;
>     }
>  }
> diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
> index 8c3f783..60bced4 100644
> --- a/src/mesa/main/debug.c
> +++ b/src/mesa/main/debug.c
> @@ -406,7 +406,7 @@ dump_renderbuffer(const struct gl_renderbuffer *rb,
> GLboolean writeImage)
>  {
>     printf("Renderbuffer %u: %u x %u  IntFormat = %s\n",
>           rb->Name, rb->Width, rb->Height,
> -         _mesa_lookup_enum_by_nr(rb->InternalFormat));
> +         _mesa_enum_string(rb->InternalFormat));
>     if (writeImage) {
>        _mesa_write_renderbuffer_image(rb);
>     }
> diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
> index 29851ec..9187342 100644
> --- a/src/mesa/main/depth.c
> +++ b/src/mesa/main/depth.c
> @@ -63,7 +63,7 @@ _mesa_DepthFunc( GLenum func )
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
> +      _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_enum_string(func));
>
>     switch (func) {
>     case GL_LESS:    /* (default) pass if incoming z < stored z */
> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> index abc8665..f49f101 100644
> --- a/src/mesa/main/dlist.c
> +++ b/src/mesa/main/dlist.c
> @@ -8613,7 +8613,7 @@ _mesa_NewList(GLuint name, GLenum mode)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glNewList %u %s\n", name,
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(mode));
>
>     if (name == 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
> @@ -9286,7 +9286,7 @@ _mesa_initialize_save_table(const struct gl_context
> *ctx)
>  static const char *
>  enum_string(GLenum k)
>  {
> -   return _mesa_lookup_enum_by_nr(k);
> +   return _mesa_enum_string(k);
>  }
>
>
> @@ -9423,19 +9423,19 @@ print_list(struct gl_context *ctx, GLuint list)
>              break;
>           case OPCODE_BIND_TEXTURE:
>              printf("BindTexture %s %d\n",
> -                         _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
> +                         _mesa_enum_string(n[1].ui), n[2].ui);
>              break;
>           case OPCODE_SHADE_MODEL:
> -            printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
> +            printf("ShadeModel %s\n", _mesa_enum_string(n[1].ui));
>              break;
>           case OPCODE_MAP1:
>              printf("Map1 %s %.3f %.3f %d %d\n",
> -                         _mesa_lookup_enum_by_nr(n[1].ui),
> +                         _mesa_enum_string(n[1].ui),
>                           n[2].f, n[3].f, n[4].i, n[5].i);
>              break;
>           case OPCODE_MAP2:
>              printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
> -                         _mesa_lookup_enum_by_nr(n[1].ui),
> +                         _mesa_enum_string(n[1].ui),
>                           n[2].f, n[3].f, n[4].f, n[5].f,
>                           n[6].i, n[7].i, n[8].i, n[9].i);
>              break;
> @@ -9514,7 +9514,7 @@ print_list(struct gl_context *ctx, GLuint list)
>
>           case OPCODE_PROVOKING_VERTEX:
>              printf("ProvokingVertex %s\n",
> -                         _mesa_lookup_enum_by_nr(n[1].ui));
> +                         _mesa_enum_string(n[1].ui));
>              break;
>
>              /*
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index 7ab8e30..ea7e5a9 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -279,8 +279,8 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum
> mode, const char *name)
>          _mesa_error(ctx, GL_INVALID_OPERATION,
>                      "%s(mode=%s vs transform feedback %s)",
>                      name,
> -                    _mesa_lookup_prim_by_nr(mode),
> -                    _mesa_lookup_prim_by_nr(ctx->TransformFeedback.Mode));
> +                    _mesa_prim_string(mode),
> +                    _mesa_prim_string(ctx->TransformFeedback.Mode));
>          return GL_FALSE;
>        }
>     }
> @@ -304,7 +304,7 @@ valid_elements_type(struct gl_context *ctx, GLenum
> type, const char *name)
>
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
> -                  _mesa_lookup_enum_by_nr(type));
> +                  _mesa_enum_string(type));
>        return false;
>     }
>  }
> diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
> index 096615c..b3804fa 100644
> --- a/src/mesa/main/drawpix.c
> +++ b/src/mesa/main/drawpix.c
> @@ -53,10 +53,10 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d,
> %d\n",
>                    width, height,
> -                  _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type),
> +                  _mesa_enum_string(format),
> +                  _mesa_enum_string(type),
>                    pixels,
> -
>  _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
> +                  _mesa_enum_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
>                    IROUND(ctx->Current.RasterPos[0]),
>                    IROUND(ctx->Current.RasterPos[1]));
>
> @@ -96,8 +96,8 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
>     err = _mesa_error_check_format_and_type(ctx, format, type);
>     if (err != GL_NO_ERROR) {
>        _mesa_error(ctx, err, "glDrawPixels(invalid format %s and/or type
> %s)",
> -                  _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type));
> +                  _mesa_enum_string(format),
> +                  _mesa_enum_string(type));
>        goto end;
>     }
>
> @@ -198,9 +198,9 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei
> width, GLsizei height,
>        _mesa_debug(ctx,
>                    "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at
> %d, %d\n",
>                    srcx, srcy, width, height,
> -                  _mesa_lookup_enum_by_nr(type),
> -
>  _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer),
> -
>  _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
> +                  _mesa_enum_string(type),
> +                  _mesa_enum_string(ctx->ReadBuffer->ColorReadBuffer),
> +                  _mesa_enum_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
>                    IROUND(ctx->Current.RasterPos[0]),
>                    IROUND(ctx->Current.RasterPos[1]));
>
> @@ -218,7 +218,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei
> width, GLsizei height,
>         type != GL_STENCIL &&
>         type != GL_DEPTH_STENCIL) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels(type=%s)",
> -                  _mesa_lookup_enum_by_nr(type));
> +                  _mesa_enum_string(type));
>        return;
>     }
>
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> index fdde24e..a4dc190 100644
> --- a/src/mesa/main/enable.c
> +++ b/src/mesa/main/enable.c
> @@ -143,7 +143,7 @@ client_state(struct gl_context *ctx, GLenum cap,
> GLboolean state)
>
>  invalid_enum_error:
>     _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(%s)",
> -               state ? "Enable" : "Disable",
> _mesa_lookup_enum_by_nr(cap));
> +               state ? "Enable" : "Disable", _mesa_enum_string(cap));
>  }
>
>
> @@ -280,7 +280,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap,
> GLboolean state)
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "%s %s (newstate is %x)\n",
>                    state ? "glEnable" : "glDisable",
> -                  _mesa_lookup_enum_by_nr(cap),
> +                  _mesa_enum_string(cap),
>                    ctx->NewState);
>
>     switch (cap) {
> @@ -1021,7 +1021,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap,
> GLboolean state)
>
>  invalid_enum_error:
>     _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(%s)",
> -               state ? "Enable" : "Disable",
> _mesa_lookup_enum_by_nr(cap));
> +               state ? "Enable" : "Disable", _mesa_enum_string(cap));
>  }
>
>
> @@ -1086,7 +1086,7 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
>  invalid_enum_error:
>      _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
>                  state ? "glEnablei" : "glDisablei",
> -                _mesa_lookup_enum_by_nr(cap));
> +                _mesa_enum_string(cap));
>  }
>
>
> @@ -1121,7 +1121,7 @@ _mesa_IsEnabledi( GLenum cap, GLuint index )
>        return (ctx->Color.BlendEnabled >> index) & 1;
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
> -                  _mesa_lookup_enum_by_nr(cap));
> +                  _mesa_enum_string(cap));
>        return GL_FALSE;
>     }
>  }
> @@ -1594,6 +1594,6 @@ _mesa_IsEnabled( GLenum cap )
>
>  invalid_enum_error:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(%s)",
> -               _mesa_lookup_enum_by_nr(cap));
> +               _mesa_enum_string(cap));
>     return GL_FALSE;
>  }
> diff --git a/src/mesa/main/enums.h b/src/mesa/main/enums.h
> index 556c1db..513e1f0 100644
> --- a/src/mesa/main/enums.h
> +++ b/src/mesa/main/enums.h
> @@ -37,13 +37,13 @@
>  #define _ENUMS_H_
>
>
> -extern const char *_mesa_lookup_enum_by_nr( int nr );
> +extern const char *_mesa_enum_string( int nr );
>
>  /* Get the name of an enum given that it is a primitive type.  Avoids
>   * GL_FALSE/GL_POINTS ambiguity and others.
>   */
> -const char *_mesa_lookup_prim_by_nr( unsigned nr );
> +const char *_mesa_prim_string( unsigned nr );
>
> -extern int _mesa_lookup_enum_by_name( const char *symbol );
> +extern int _mesa_enum_value( const char *symbol );
>
>  #endif
> diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
> index cc652ba..6aed377 100644
> --- a/src/mesa/main/errors.c
> +++ b/src/mesa/main/errors.c
> @@ -793,7 +793,7 @@ flush_delayed_errors( struct gl_context *ctx )
>     if (ctx->ErrorDebugCount) {
>        _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
>                       ctx->ErrorDebugCount,
> -                     _mesa_lookup_enum_by_nr(ctx->ErrorValue));
> +                     _mesa_enum_string(ctx->ErrorValue));
>
>        output_if_debug("Mesa", s, GL_TRUE);
>
> @@ -958,7 +958,7 @@ _mesa_error( struct gl_context *ctx, GLenum error,
> const char *fmtString, ... )
>        }
>
>        len = _mesa_snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s",
> -                           _mesa_lookup_enum_by_nr(error), s);
> +                           _mesa_enum_string(error), s);
>        if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
>           /* Same as above. */
>           ASSERT(0);
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index aa0f125..f305437 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -1586,14 +1586,14 @@ renderbuffer_storage(GLenum target, GLenum
> internalFormat,
>        if (samples == NO_SAMPLES)
>           _mesa_debug(ctx, "%s(%s, %s, %d, %d)\n",
>                       func,
> -                     _mesa_lookup_enum_by_nr(target),
> -                     _mesa_lookup_enum_by_nr(internalFormat),
> +                     _mesa_enum_string(target),
> +                     _mesa_enum_string(internalFormat),
>                       width, height);
>        else
>           _mesa_debug(ctx, "%s(%s, %s, %d, %d, %d)\n",
>                       func,
> -                     _mesa_lookup_enum_by_nr(target),
> -                     _mesa_lookup_enum_by_nr(internalFormat),
> +                     _mesa_enum_string(target),
> +                     _mesa_enum_string(internalFormat),
>                       width, height, samples);
>     }
>
> @@ -1605,7 +1605,7 @@ renderbuffer_storage(GLenum target, GLenum
> internalFormat,
>     baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
>     if (baseFormat == 0) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat=%s)",
> -                  func, _mesa_lookup_enum_by_nr(internalFormat));
> +                  func, _mesa_enum_string(internalFormat));
>        return;
>     }
>
> @@ -2118,7 +2118,7 @@ _mesa_CheckFramebufferStatus(GLenum target)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glCheckFramebufferStatus(%s)\n",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>
>     buffer = get_framebuffer_target(ctx, target);
>     if (!buffer) {
> @@ -2362,7 +2362,7 @@ _mesa_FramebufferTexture1D(GLenum target, GLenum
> attachment,
>        if (error) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                       "glFramebufferTexture1DEXT(textarget=%s)",
> -                     _mesa_lookup_enum_by_nr(textarget));
> +                     _mesa_enum_string(textarget));
>           return;
>        }
>     }
> @@ -2413,7 +2413,7 @@ _mesa_FramebufferTexture2D(GLenum target, GLenum
> attachment,
>        if (error) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                       "glFramebufferTexture2DEXT(textarget=%s)",
> -                     _mesa_lookup_enum_by_nr(textarget));
> +                     _mesa_enum_string(textarget));
>           return;
>        }
>     }
> @@ -2500,7 +2500,7 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum
> attachment,
>     if (att == NULL) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glFramebufferRenderbufferEXT(invalid attachment %s)",
> -                  _mesa_lookup_enum_by_nr(attachment));
> +                  _mesa_enum_string(attachment));
>        return;
>     }
>
> @@ -2841,7 +2841,7 @@ _mesa_GenerateMipmap(GLenum target)
>
>     if (error) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target=%s)",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>        return;
>     }
>
> @@ -3018,7 +3018,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0,
> GLint srcX1, GLint srcY1,
>                    "glBlitFramebuffer(%d, %d, %d, %d,  %d, %d, %d, %d,
> 0x%x, %s)\n",
>                    srcX0, srcY0, srcX1, srcY1,
>                    dstX0, dstY0, dstX1, dstY1,
> -                  mask, _mesa_lookup_enum_by_nr(filter));
> +                  mask, _mesa_enum_string(filter));
>
>     if (ctx->NewState) {
>        _mesa_update_state(ctx);
> @@ -3044,7 +3044,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0,
> GLint srcX1, GLint srcY1,
>
>     if (!is_valid_blit_filter(ctx, filter)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(%s)",
> -                  _mesa_lookup_enum_by_nr(filter));
> +                  _mesa_enum_string(filter));
>        return;
>     }
>
> @@ -3052,7 +3052,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0,
> GLint srcX1, GLint srcY1,
>          filter == GL_SCALED_RESOLVE_NICEST_EXT) &&
>          (readFb->Visual.samples == 0 || drawFb->Visual.samples > 0)) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(%s)",
> -                  _mesa_lookup_enum_by_nr(filter));
> +                  _mesa_enum_string(filter));
>        return;
>     }
>
> @@ -3517,7 +3517,7 @@ _mesa_DiscardFramebufferEXT(GLenum target, GLsizei
> numAttachments,
>     if (!fb) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>           "glDiscardFramebufferEXT(target %s)",
> -         _mesa_lookup_enum_by_nr(target));
> +         _mesa_enum_string(target));
>        return;
>     }
>
> @@ -3554,5 +3554,5 @@ _mesa_DiscardFramebufferEXT(GLenum target, GLsizei
> numAttachments,
>  invalid_enum:
>     _mesa_error(ctx, GL_INVALID_ENUM,
>                 "glDiscardFramebufferEXT(attachment %s)",
> -              _mesa_lookup_enum_by_nr(attachments[i]));
> +              _mesa_enum_string(attachments[i]));
>  }
> diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
> index 40eca87..269e1b2 100644
> --- a/src/mesa/main/formatquery.c
> +++ b/src/mesa/main/formatquery.c
> @@ -80,7 +80,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum
> internalformat, GLenum pname,
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glGetInternalformativ(target=%s)",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>        return;
>     }
>
> @@ -93,7 +93,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum
> internalformat, GLenum pname,
>     if (_mesa_base_fbo_format(ctx, internalformat) == 0) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glGetInternalformativ(internalformat=%s)",
> -                  _mesa_lookup_enum_by_nr(internalformat));
> +                  _mesa_enum_string(internalformat));
>        return;
>     }
>
> @@ -105,7 +105,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum
> internalformat, GLenum pname,
>     if (bufSize < 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    "glGetInternalformativ(target=%s)",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>        return;
>     }
>
> @@ -143,7 +143,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum
> internalformat, GLenum pname,
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glGetInternalformativ(pname=%s)",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        return;
>     }
>
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index 1906a8a..ef829a8 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -973,7 +973,7 @@ _mesa_print_framebuffer(const struct gl_framebuffer
> *fb)
>
>     fprintf(stderr, "Mesa Framebuffer %u at %p\n", fb->Name, (void *) fb);
>     fprintf(stderr, "  Size: %u x %u  Status: %s\n", fb->Width, fb->Height,
> -           _mesa_lookup_enum_by_nr(fb->_Status));
> +           _mesa_enum_string(fb->_Status));
>     fprintf(stderr, "  Attachments:\n");
>
>     for (i = 0; i < BUFFER_COUNT; i++) {
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 593c75b..4e0fac7 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -1006,7 +1006,7 @@ check_extra(struct gl_context *ctx, const char
> *func, const struct value_desc *d
>
>     if (api_check && !api_found) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
> -                  _mesa_lookup_enum_by_nr(d->pname));
> +                  _mesa_enum_string(d->pname));
>        return GL_FALSE;
>     }
>
> @@ -1067,7 +1067,7 @@ find_value(const char *func, GLenum pname, void **p,
> union value *v)
>         * any valid enum. */
>        if (unlikely(idx == 0)) {
>           _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>           return &error_value;
>        }
>
> @@ -1691,11 +1691,11 @@ find_value_indexed(const char *func, GLenum pname,
> GLuint index, union value *v)
>
>   invalid_enum:
>     _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return TYPE_INVALID;
>   invalid_value:
>     _mesa_error(ctx, GL_INVALID_VALUE, "%s(pname=%s)", func,
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return TYPE_INVALID;
>  }
>
> diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
> index 1145d0f..d2d31d2 100644
> --- a/src/mesa/main/getstring.c
> +++ b/src/mesa/main/getstring.c
> @@ -201,7 +201,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
>        return;
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetPointerv %s\n",
> _mesa_lookup_enum_by_nr(pname));
> +      _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_enum_string(pname));
>
>     switch (pname) {
>        case GL_VERTEX_ARRAY_POINTER:
> @@ -295,7 +295,7 @@ _mesa_GetError( void )
>     ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
> +      _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_enum_string(e));
>
>     ctx->ErrorValue = (GLenum) GL_NO_ERROR;
>     ctx->ErrorDebugCount = 0;
> diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
> index 6d3e58d..efc82d7 100644
> --- a/src/mesa/main/hint.c
> +++ b/src/mesa/main/hint.c
> @@ -40,8 +40,8 @@ _mesa_Hint( GLenum target, GLenum mode )
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glHint %s %s\n",
> -                  _mesa_lookup_enum_by_nr(target),
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(target),
> +                  _mesa_enum_string(mode));
>
>     if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
> diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
> index d8ef8f2..8339973 100644
> --- a/src/mesa/main/light.c
> +++ b/src/mesa/main/light.c
> @@ -41,7 +41,7 @@ _mesa_ShadeModel( GLenum mode )
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glShadeModel %s\n",
> _mesa_lookup_enum_by_nr(mode));
> +      _mesa_debug(ctx, "glShadeModel %s\n", _mesa_enum_string(mode));
>
>     if (mode != GL_FLAT && mode != GL_SMOOTH) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel");
> @@ -722,8 +722,8 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
>
>     if (MESA_VERBOSE&VERBOSE_API)
>        _mesa_debug(ctx, "glColorMaterial %s %s\n",
> -                  _mesa_lookup_enum_by_nr(face),
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(face),
> +                  _mesa_enum_string(mode));
>
>     bitmask = _mesa_material_bitmask(ctx, face, mode, legal,
> "glColorMaterial");
>     if (bitmask == 0)
> diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
> index b213022..3d28d15 100644
> --- a/src/mesa/main/matrix.c
> +++ b/src/mesa/main/matrix.c
> @@ -229,7 +229,7 @@ _mesa_PushMatrix( void )
>
>     if (MESA_VERBOSE&VERBOSE_API)
>        _mesa_debug(ctx, "glPushMatrix %s\n",
> -                  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
> +                  _mesa_enum_string(ctx->Transform.MatrixMode));
>
>     if (stack->Depth + 1 >= stack->MaxDepth) {
>        if (ctx->Transform.MatrixMode == GL_TEXTURE) {
> @@ -239,7 +239,7 @@ _mesa_PushMatrix( void )
>        }
>        else {
>           _mesa_error(ctx,  GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
> -                     _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
> +                     _mesa_enum_string(ctx->Transform.MatrixMode));
>        }
>        return;
>     }
> @@ -270,7 +270,7 @@ _mesa_PopMatrix( void )
>
>     if (MESA_VERBOSE&VERBOSE_API)
>        _mesa_debug(ctx, "glPopMatrix %s\n",
> -                  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
> +                  _mesa_enum_string(ctx->Transform.MatrixMode));
>
>     if (stack->Depth == 0) {
>        if (ctx->Transform.MatrixMode == GL_TEXTURE) {
> @@ -280,7 +280,7 @@ _mesa_PopMatrix( void )
>        }
>        else {
>           _mesa_error(ctx,  GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
> -                     _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
> +                     _mesa_enum_string(ctx->Transform.MatrixMode));
>        }
>        return;
>     }
> diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
> index d976e5a..736dfd0 100644
> --- a/src/mesa/main/pack.c
> +++ b/src/mesa/main/pack.c
> @@ -523,8 +523,8 @@ _pack_rgba_span_from_uints_problem(struct gl_context
> *ctx,
>     _mesa_problem(ctx,
>                   "Unsupported type (%s) / format (%s) "
>                   "in _mesa_pack_rgba_span_from_uints",
> -                 _mesa_lookup_enum_by_nr(dstType),
> -                 _mesa_lookup_enum_by_nr(dstFormat));
> +                 _mesa_enum_string(dstType),
> +                 _mesa_enum_string(dstFormat));
>  }
>
>  void
> @@ -909,8 +909,8 @@ _pack_rgba_span_from_ints_problem(struct gl_context
> *ctx,
>     _mesa_problem(ctx,
>                   "Unsupported type (%s) / format (%s) "
>                   "in _mesa_pack_rgba_span_from_ints",
> -                 _mesa_lookup_enum_by_nr(dstType),
> -                 _mesa_lookup_enum_by_nr(dstFormat));
> +                 _mesa_enum_string(dstType),
> +                 _mesa_enum_string(dstFormat));
>  }
>
>  void
> @@ -3104,7 +3104,7 @@ get_component_mapping(GLenum format,
>        break;
>     default:
>        _mesa_problem(NULL, "bad srcFormat %s in get_component_mapping",
> -                    _mesa_lookup_enum_by_nr(format));
> +                    _mesa_enum_string(format));
>        return;
>     }
>  }
> diff --git a/src/mesa/main/pack_tmp.h b/src/mesa/main/pack_tmp.h
> index 0d4eb38..377dac6 100644
> --- a/src/mesa/main/pack_tmp.h
> +++ b/src/mesa/main/pack_tmp.h
> @@ -116,7 +116,7 @@ FN_NAME(struct gl_context *ctx,
>     default:
>        _mesa_problem(ctx,
>           "Unsupported format (%s)",
> -         _mesa_lookup_enum_by_nr(dstFormat));
> +         _mesa_enum_string(dstFormat));
>        break;
>     }
>  }
> diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
> index 611cef6..d86f21c 100644
> --- a/src/mesa/main/polygon.c
> +++ b/src/mesa/main/polygon.c
> @@ -56,7 +56,7 @@ _mesa_CullFace( GLenum mode )
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
> +      _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_string(mode));
>
>     if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
>        _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
> @@ -91,7 +91,7 @@ _mesa_FrontFace( GLenum mode )
>     GET_CURRENT_CONTEXT(ctx);
>
>     if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
> +      _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_string(mode));
>
>     if (mode!=GL_CW && mode!=GL_CCW) {
>        _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
> @@ -130,8 +130,8 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
>
>     if (MESA_VERBOSE&VERBOSE_API)
>        _mesa_debug(ctx, "glPolygonMode %s %s\n",
> -                  _mesa_lookup_enum_by_nr(face),
> -                  _mesa_lookup_enum_by_nr(mode));
> +                  _mesa_enum_string(face),
> +                  _mesa_enum_string(mode));
>
>     if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
>        _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index b74898c..084fe80 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -310,7 +310,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index,
> GLuint id)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glBeginQueryIndexed(%s, %u, %u)\n",
> -                  _mesa_lookup_enum_by_nr(target), index, id);
> +                  _mesa_enum_string(target), index, id);
>
>     if (!query_error_check_index(ctx, target, index))
>        return;
> @@ -332,7 +332,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index,
> GLuint id)
>     if (*bindpt) {
>        _mesa_error(ctx, GL_INVALID_OPERATION,
>                    "glBeginQuery{Indexed}(target=%s is active)",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>        return;
>     }
>
> @@ -387,7 +387,7 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glEndQueryIndexed(%s, %u)\n",
> -                  _mesa_lookup_enum_by_nr(target), index);
> +                  _mesa_enum_string(target), index);
>
>     if (!query_error_check_index(ctx, target, index))
>        return;
> @@ -407,8 +407,8 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
>     if (q && q->Target != target) {
>        _mesa_error(ctx, GL_INVALID_OPERATION,
>                    "glEndQuery(target=%s with active query of target %s)",
> -                  _mesa_lookup_enum_by_nr(target),
> -                  _mesa_lookup_enum_by_nr(q->Target));
> +                  _mesa_enum_string(target),
> +                  _mesa_enum_string(q->Target));
>        return;
>     }
>
> @@ -444,7 +444,7 @@ _mesa_QueryCounter(GLuint id, GLenum target)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glQueryCounter(%u, %s)\n", id,
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>
>     /* error checking */
>     if (target != GL_TIMESTAMP) {
> @@ -506,9 +506,9 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index,
> GLenum pname,
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glGetQueryIndexediv(%s, %u, %s)\n",
> -                  _mesa_lookup_enum_by_nr(target),
> +                  _mesa_enum_string(target),
>                    index,
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>
>     if (!query_error_check_index(ctx, target, index))
>        return;
> @@ -557,7 +557,7 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index,
> GLenum pname,
>           default:
>              _mesa_problem(ctx,
>                            "Unknown target in glGetQueryIndexediv(target =
> %s)",
> -                          _mesa_lookup_enum_by_nr(target));
> +                          _mesa_enum_string(target));
>              *params = 0;
>              break;
>           }
> @@ -585,7 +585,7 @@ _mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint
> *params)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glGetQueryObjectiv(%u, %s)\n", id,
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>
>     if (id)
>        q = _mesa_lookup_query_object(ctx, id);
> @@ -636,7 +636,7 @@ _mesa_GetQueryObjectuiv(GLuint id, GLenum pname,
> GLuint *params)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glGetQueryObjectuiv(%u, %s)\n", id,
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>
>     if (id)
>        q = _mesa_lookup_query_object(ctx, id);
> @@ -690,7 +690,7 @@ _mesa_GetQueryObjecti64v(GLuint id, GLenum pname,
> GLint64EXT *params)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glGetQueryObjecti64v(%u, %s)\n", id,
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>
>     if (id)
>        q = _mesa_lookup_query_object(ctx, id);
> @@ -730,7 +730,7 @@ _mesa_GetQueryObjectui64v(GLuint id, GLenum pname,
> GLuint64EXT *params)
>
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glGetQueryObjectui64v(%u, %s)\n", id,
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>
>     if (id)
>        q = _mesa_lookup_query_object(ctx, id);
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 51a0b15..d6af4b2 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -919,8 +919,8 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width,
> GLsizei height,
>     if (MESA_VERBOSE & VERBOSE_API)
>        _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
>                    width, height,
> -                  _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type),
> +                  _mesa_enum_string(format),
> +                  _mesa_enum_string(type),
>                    pixels);
>
>     if (width < 0 || height < 0) {
> @@ -977,8 +977,8 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width,
> GLsizei height,
>
>        if (err != GL_NO_ERROR) {
>           _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or
> type %s)",
> -                     _mesa_lookup_enum_by_nr(format),
> -                     _mesa_lookup_enum_by_nr(type));
> +                     _mesa_enum_string(format),
> +                     _mesa_enum_string(type));
>           return;
>        }
>     }
> @@ -986,8 +986,8 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width,
> GLsizei height,
>     err = _mesa_error_check_format_and_type(ctx, format, type);
>     if (err != GL_NO_ERROR) {
>        _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type
> %s)",
> -                  _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type));
> +                  _mesa_enum_string(format),
> +                  _mesa_enum_string(type));
>        return;
>     }
>
> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
> index 91b17ab..0b1f957 100644
> --- a/src/mesa/main/samplerobj.c
> +++ b/src/mesa/main/samplerobj.c
> @@ -675,7 +675,7 @@ _mesa_SamplerParameteri(GLuint sampler, GLenum pname,
> GLint param)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n",
> @@ -760,7 +760,7 @@ _mesa_SamplerParameterf(GLuint sampler, GLenum pname,
> GLfloat param)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n",
> @@ -852,7 +852,7 @@ _mesa_SamplerParameteriv(GLuint sampler, GLenum pname,
> const GLint *params)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameteriv(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameteriv(param=%d)\n",
> @@ -937,7 +937,7 @@ _mesa_SamplerParameterfv(GLuint sampler, GLenum pname,
> const GLfloat *params)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterfv(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterfv(param=%f)\n",
> @@ -1022,7 +1022,7 @@ _mesa_SamplerParameterIiv(GLuint sampler, GLenum
> pname, const GLint *params)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterIiv(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterIiv(param=%d)\n",
> @@ -1108,7 +1108,7 @@ _mesa_SamplerParameterIuiv(GLuint sampler, GLenum
> pname, const GLuint *params)
>        break;
>     case INVALID_PNAME:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterIuiv(pname=%s)\n",
> -                  _mesa_lookup_enum_by_nr(pname));
> +                  _mesa_enum_string(pname));
>        break;
>     case INVALID_PARAM:
>        _mesa_error(ctx, GL_INVALID_ENUM,
> "glSamplerParameterIuiv(param=%u)\n",
> @@ -1198,7 +1198,7 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum
> pname, GLint *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1276,7 +1276,7 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum
> pname, GLfloat *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1355,7 +1355,7 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum
> pname, GLint *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1434,7 +1434,7 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum
> pname, GLuint *params)
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM,
> "glGetSamplerParameterIuiv(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 8cb0276..d9604c9 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -619,7 +619,7 @@ get_programiv(struct gl_context *ctx, GLuint program,
> GLenum pname, GLint *param
>     }
>
>     _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1041,7 +1041,7 @@ _mesa_CreateShader(GLenum type)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCreateShader %s\n",
> _mesa_lookup_enum_by_nr(type));
> +      _mesa_debug(ctx, "glCreateShader %s\n", _mesa_enum_string(type));
>     return create_shader(ctx, type);
>  }
>
> @@ -1628,7 +1628,7 @@ _mesa_ProgramParameteri(GLuint program, GLenum
> pname, GLint value)
>        default:
>           _mesa_error(ctx, GL_INVALID_VALUE,
>                       "glProgramParameteri(geometry input type = %s",
> -                     _mesa_lookup_enum_by_nr(value));
> +                     _mesa_enum_string(value));
>           return;
>        }
>        return;
> @@ -1645,7 +1645,7 @@ _mesa_ProgramParameteri(GLuint program, GLenum
> pname, GLint value)
>        default:
>           _mesa_error(ctx, GL_INVALID_VALUE,
>                       "glProgramParameteri(geometry output type = %s",
> -                     _mesa_lookup_enum_by_nr(value));
> +                     _mesa_enum_string(value));
>           return;
>        }
>        return;
> @@ -1667,7 +1667,7 @@ _mesa_ProgramParameteri(GLuint program, GLenum
> pname, GLint value)
>           _mesa_error(ctx, GL_INVALID_VALUE,
>                       "glProgramParameteri(pname=%s, value=%d): "
>                       "value must be 0 or 1.",
> -                     _mesa_lookup_enum_by_nr(pname),
> +                     _mesa_enum_string(pname),
>                       value);
>           return;
>        }
> @@ -1699,7 +1699,7 @@ _mesa_ProgramParameteri(GLuint program, GLenum
> pname, GLint value)
>     }
>
>     _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>  void
> diff --git a/src/mesa/main/tests/enum_strings.cpp
> b/src/mesa/main/tests/enum_strings.cpp
> index 1dae60f..dbe74dd 100644
> --- a/src/mesa/main/tests/enum_strings.cpp
> +++ b/src/mesa/main/tests/enum_strings.cpp
> @@ -40,7 +40,7 @@ TEST(EnumStrings, LookUpByNumber)
>  {
>     for (unsigned i = 0; everything[i].name != NULL; i++) {
>        EXPECT_STREQ(everything[i].name,
> -                  _mesa_lookup_enum_by_nr(everything[i].value));
> +                  _mesa_enum_string(everything[i].value));
>     }
>  }
>
> @@ -48,7 +48,7 @@ TEST(EnumStrings, LookUpByName)
>  {
>     for (unsigned i = 0; everything[i].name != NULL; i++) {
>        EXPECT_EQ(everything[i].value,
> -               _mesa_lookup_enum_by_name(everything[i].name));
> +               _mesa_enum_value(everything[i].name));
>     }
>  }
>
> @@ -59,13 +59,13 @@ TEST(EnumStrings, LookUpByDuplicateName)
>      */
>     for (unsigned i = 0; alternate_names[i].name != NULL; i++) {
>        EXPECT_EQ(alternate_names[i].value,
> -               _mesa_lookup_enum_by_name(alternate_names[i].name));
> +               _mesa_enum_value(alternate_names[i].name));
>     }
>  }
>
>  TEST(EnumStrings, LookUpUnknownNumber)
>  {
> -   EXPECT_STRCASEEQ("0xEEEE", _mesa_lookup_enum_by_nr(0xEEEE));
> +   EXPECT_STRCASEEQ("0xEEEE", _mesa_enum_string(0xEEEE));
>  }
>
>  /* Please type the name and the value.  This makes it easier to detect
> diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
> index 1aadd7f..77b874b 100644
> --- a/src/mesa/main/texenv.c
> +++ b/src/mesa/main/texenv.c
> @@ -42,7 +42,7 @@
>
>
>  #define TE_ERROR(errCode, msg, value)                          \
> -   _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
> +   _mesa_error(ctx, errCode, msg, _mesa_enum_string(value));
>
>
>  /** Set texture env mode */
> @@ -507,16 +507,16 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const
> GLfloat *param )
>     }
>     else {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(target=%s)",
> -                  _mesa_lookup_enum_by_nr(target));
> +                  _mesa_enum_string(target));
>        return;
>     }
>
>     if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
> -                  _mesa_lookup_enum_by_nr(target),
> -                  _mesa_lookup_enum_by_nr(pname),
> +                  _mesa_enum_string(target),
> +                  _mesa_enum_string(pname),
>                    *param,
> -                  _mesa_lookup_enum_by_nr((GLenum) iparam0));
> +                  _mesa_enum_string((GLenum) iparam0));
>
>     /* Tell device driver about the new texture environment */
>     if (ctx->Driver.TexEnv) {
> diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
> index c2f9257..e1aac9a 100644
> --- a/src/mesa/main/texformat.c
> +++ b/src/mesa/main/texformat.c
> @@ -816,7 +816,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum
> target,
>     }
>
>     _mesa_problem(ctx, "unexpected format %s in _mesa_choose_tex_format()",
> -                 _mesa_lookup_enum_by_nr(internalFormat));
> +                 _mesa_enum_string(internalFormat));
>     return MESA_FORMAT_NONE;
>  }
>
> diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
> index 41e428b..c93c761 100644
> --- a/src/mesa/main/texgen.c
> +++ b/src/mesa/main/texgen.c
> @@ -76,10 +76,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const
> GLfloat *params )
>
>     if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n",
> -                  _mesa_lookup_enum_by_nr(coord),
> -                  _mesa_lookup_enum_by_nr(pname),
> +                  _mesa_enum_string(coord),
> +                  _mesa_enum_string(pname),
>                    *params,
> -                 _mesa_lookup_enum_by_nr((GLenum) (GLint) *params));
> +                 _mesa_enum_string((GLenum) (GLint) *params));
>
>     if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)");
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 9aaa63f..81368af 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1960,8 +1960,8 @@ texture_error_check( struct gl_context *ctx,
>              _mesa_error(ctx, GL_INVALID_OPERATION,
>                          "glTexImage%dD(format = %s, internalFormat = %s)",
>                          dimensions,
> -                        _mesa_lookup_enum_by_nr(format),
> -                        _mesa_lookup_enum_by_nr(internalFormat));
> +                        _mesa_enum_string(format),
> +                        _mesa_enum_string(internalFormat));
>              return GL_TRUE;
>           }
>
> @@ -1971,9 +1971,9 @@ texture_error_check( struct gl_context *ctx,
>           _mesa_error(ctx, err,
>                       "glTexImage%dD(format = %s, type = %s,
> internalFormat = %s)",
>                       dimensions,
> -                     _mesa_lookup_enum_by_nr(format),
> -                     _mesa_lookup_enum_by_nr(type),
> -                     _mesa_lookup_enum_by_nr(internalFormat));
> +                     _mesa_enum_string(format),
> +                     _mesa_enum_string(type),
> +                     _mesa_enum_string(internalFormat));
>           return GL_TRUE;
>        }
>     }
> @@ -2003,7 +2003,7 @@ texture_error_check( struct gl_context *ctx,
>     if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    "glTexImage%dD(internalFormat=%s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(internalFormat));
> +                  dimensions, _mesa_enum_string(internalFormat));
>        return GL_TRUE;
>     }
>
> @@ -2012,8 +2012,8 @@ texture_error_check( struct gl_context *ctx,
>     if (err != GL_NO_ERROR) {
>        _mesa_error(ctx, err,
>                    "glTexImage%dD(incompatible format = %s, type = %s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type));
> +                  dimensions, _mesa_enum_string(format),
> +                  _mesa_enum_string(type));
>        return GL_TRUE;
>     }
>
> @@ -2026,8 +2026,8 @@ texture_error_check( struct gl_context *ctx,
>         (_mesa_is_dudv_format(internalFormat) !=
> _mesa_is_dudv_format(format))) {
>        _mesa_error(ctx, GL_INVALID_OPERATION,
>                    "glTexImage%dD(incompatible internalFormat = %s, format
> = %s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(internalFormat),
> -                  _mesa_lookup_enum_by_nr(format));
> +                  dimensions, _mesa_enum_string(internalFormat),
> +                  _mesa_enum_string(format));
>        return GL_TRUE;
>     }
>
> @@ -2300,7 +2300,7 @@ texsubimage_error_check(struct gl_context *ctx,
> GLuint dimensions,
>     /* check target (proxies not allowed) */
>     if (!legal_texsubimage_target(ctx, dimensions, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(target));
> +                  dimensions, _mesa_enum_string(target));
>        return GL_TRUE;
>     }
>
> @@ -2322,8 +2322,8 @@ texsubimage_error_check(struct gl_context *ctx,
> GLuint dimensions,
>           _mesa_error(ctx, err,
>                       "glTexSubImage%dD(format = %s, type = %s)",
>                       dimensions,
> -                     _mesa_lookup_enum_by_nr(format),
> -                     _mesa_lookup_enum_by_nr(type));
> +                     _mesa_enum_string(format),
> +                     _mesa_enum_string(type));
>           return GL_TRUE;
>        }
>     }
> @@ -2332,8 +2332,8 @@ texsubimage_error_check(struct gl_context *ctx,
> GLuint dimensions,
>     if (err != GL_NO_ERROR) {
>        _mesa_error(ctx, err,
>                    "glTexSubImage%dD(incompatible format = %s, type = %s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type));
> +                  dimensions, _mesa_enum_string(format),
> +                  _mesa_enum_string(type));
>        return GL_TRUE;
>     }
>
> @@ -2413,7 +2413,7 @@ copytexture_error_check( struct gl_context *ctx,
> GLuint dimensions,
>     /* check target */
>     if (!legal_texsubimage_target(ctx, dimensions, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(target));
> +                  dimensions, _mesa_enum_string(target));
>        return GL_TRUE;
>     }
>
> @@ -2654,7 +2654,7 @@ copytexsubimage_error_check(struct gl_context *ctx,
> GLuint dimensions,
>     /* check target (proxies not allowed) */
>     if (!legal_texsubimage_target(ctx, dimensions, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%uD(target=%s)",
> -                  dimensions, _mesa_lookup_enum_by_nr(target));
> +                  dimensions, _mesa_enum_string(target));
>        return GL_TRUE;
>     }
>
> @@ -2915,8 +2915,8 @@ _mesa_choose_texture_format(struct gl_context *ctx,
>                         "DXT compression requested (%s), "
>                         "but libtxc_dxtn library not installed.  Using %s "
>                         "instead.",
> -                       _mesa_lookup_enum_by_nr(before),
> -                       _mesa_lookup_enum_by_nr(internalFormat));
> +                       _mesa_enum_string(before),
> +                       _mesa_enum_string(internalFormat));
>        }
>     }
>
> @@ -3003,18 +3003,18 @@ teximage(struct gl_context *ctx, GLboolean
> compressed, GLuint dims,
>           _mesa_debug(ctx,
>                       "glCompressedTexImage%uD %s %d %s %d %d %d %d %p\n",
>                       dims,
> -                     _mesa_lookup_enum_by_nr(target), level,
> -                     _mesa_lookup_enum_by_nr(internalFormat),
> +                     _mesa_enum_string(target), level,
> +                     _mesa_enum_string(internalFormat),
>                       width, height, depth, border, pixels);
>        else
>           _mesa_debug(ctx,
>                       "glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n",
>                       dims,
> -                     _mesa_lookup_enum_by_nr(target), level,
> -                     _mesa_lookup_enum_by_nr(internalFormat),
> +                     _mesa_enum_string(target), level,
> +                     _mesa_enum_string(internalFormat),
>                       width, height, depth, border,
> -                     _mesa_lookup_enum_by_nr(format),
> -                     _mesa_lookup_enum_by_nr(type), pixels);
> +                     _mesa_enum_string(format),
> +                     _mesa_enum_string(type), pixels);
>     }
>
>     internalFormat = override_internal_format(internalFormat, width,
> height);
> @@ -3022,7 +3022,7 @@ teximage(struct gl_context *ctx, GLboolean
> compressed, GLuint dims,
>     /* target error checking */
>     if (!legal_teximage_target(ctx, dims, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
> -                  func, dims, _mesa_lookup_enum_by_nr(target));
> +                  func, dims, _mesa_enum_string(target));
>        return;
>     }
>
> @@ -3309,15 +3309,15 @@ texsubimage(struct gl_context *ctx, GLuint dims,
> GLenum target, GLint level,
>     if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s
> %p\n",
>                    dims,
> -                  _mesa_lookup_enum_by_nr(target), level,
> +                  _mesa_enum_string(target), level,
>                    xoffset, yoffset, zoffset, width, height, depth,
> -                  _mesa_lookup_enum_by_nr(format),
> -                  _mesa_lookup_enum_by_nr(type), pixels);
> +                  _mesa_enum_string(format),
> +                  _mesa_enum_string(type), pixels);
>
>     /* check target (proxies not allowed) */
>     if (!legal_texsubimage_target(ctx, dims, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)",
> -                  dims, _mesa_lookup_enum_by_nr(target));
> +                  dims, _mesa_enum_string(target));
>        return;
>     }
>
> @@ -3448,8 +3448,8 @@ copyteximage(struct gl_context *ctx, GLuint dims,
>     if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n",
>                    dims,
> -                  _mesa_lookup_enum_by_nr(target), level,
> -                  _mesa_lookup_enum_by_nr(internalFormat),
> +                  _mesa_enum_string(target), level,
> +                  _mesa_enum_string(internalFormat),
>                    x, y, width, height, border);
>
>     if (ctx->NewState & NEW_COPY_TEX_STATE)
> @@ -3573,7 +3573,7 @@ copytexsubimage(struct gl_context *ctx, GLuint dims,
> GLenum target, GLint level,
>     if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glCopyTexSubImage%uD %s %d %d %d %d %d %d %d
> %d\n",
>                    dims,
> -                  _mesa_lookup_enum_by_nr(target),
> +                  _mesa_enum_string(target),
>                    level, xoffset, yoffset, zoffset, x, y, width, height);
>
>     if (ctx->NewState & NEW_COPY_TEX_STATE)
> @@ -4240,14 +4240,14 @@ teximagemultisample(GLuint dims, GLenum target,
> GLsizei samples,
>     if (immutable && !_mesa_is_legal_tex_storage_format(ctx,
> internalformat)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>              "%s(internalformat=%s not legal for immutable-format)",
> -            func, _mesa_lookup_enum_by_nr(internalformat));
> +            func, _mesa_enum_string(internalformat));
>        return;
>     }
>
>     if (!is_renderable_texture_format(ctx, internalformat)) {
>        _mesa_error(ctx, GL_INVALID_OPERATION,
>              "%s(internalformat=%s)",
> -            func, _mesa_lookup_enum_by_nr(internalformat));
> +            func, _mesa_enum_string(internalformat));
>        return;
>     }
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 2168bff..22190f7 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -1230,7 +1230,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
>
>     if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glBindTexture %s %d\n",
> -                  _mesa_lookup_enum_by_nr(target), (GLint) texName);
> +                  _mesa_enum_string(target), (GLint) texName);
>
>     targetIndex = target_enum_to_index(ctx, target);
>     if (targetIndex < 0) {
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
> index 9507bc3..1d00c2f 100644
> --- a/src/mesa/main/texparam.c
> +++ b/src/mesa/main/texparam.c
> @@ -582,17 +582,17 @@ set_tex_parameteri(struct gl_context *ctx,
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return GL_FALSE;
>
>  invalid_param:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=%s)",
> -               _mesa_lookup_enum_by_nr(params[0]));
> +               _mesa_enum_string(params[0]));
>     return GL_FALSE;
>
>  invalid_operation:
>     _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return GL_FALSE;
>  }
>
> @@ -712,12 +712,12 @@ set_tex_parameterf(struct gl_context *ctx,
>
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return GL_FALSE;
>
>  invalid_operation:
>     _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>     return GL_FALSE;
>  }
>
> @@ -1217,7 +1217,7 @@ get_tex_level_parameter_image(struct gl_context *ctx,
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM,
>                 "glGetTexLevelParameter[if]v(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> @@ -1328,7 +1328,7 @@ get_tex_level_parameter_buffer(struct gl_context
> *ctx,
>  invalid_pname:
>     _mesa_error(ctx, GL_INVALID_ENUM,
>                 "glGetTexLevelParameter[if]v(pname=%s)",
> -               _mesa_lookup_enum_by_nr(pname));
> +               _mesa_enum_string(pname));
>  }
>
>
> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
> index 741985c..7fa7638 100644
> --- a/src/mesa/main/texstate.c
> +++ b/src/mesa/main/texstate.c
> @@ -122,21 +122,21 @@ _mesa_print_texunit_state( struct gl_context *ctx,
> GLuint unit )
>  {
>     const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
>     printf("Texture Unit %d\n", unit);
> -   printf("  GL_TEXTURE_ENV_MODE = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->EnvMode));
> -   printf("  GL_COMBINE_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
> -   printf("  GL_COMBINE_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
> -   printf("  GL_SOURCE0_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
> -   printf("  GL_SOURCE1_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
> -   printf("  GL_SOURCE2_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
> -   printf("  GL_SOURCE0_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
> -   printf("  GL_SOURCE1_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
> -   printf("  GL_SOURCE2_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
> -   printf("  GL_OPERAND0_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
> -   printf("  GL_OPERAND1_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
> -   printf("  GL_OPERAND2_RGB = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
> -   printf("  GL_OPERAND0_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
> -   printf("  GL_OPERAND1_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
> -   printf("  GL_OPERAND2_ALPHA = %s\n",
> _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
> +   printf("  GL_TEXTURE_ENV_MODE = %s\n",
> _mesa_enum_string(texUnit->EnvMode));
> +   printf("  GL_COMBINE_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.ModeRGB));
> +   printf("  GL_COMBINE_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.ModeA));
> +   printf("  GL_SOURCE0_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceRGB[0]));
> +   printf("  GL_SOURCE1_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceRGB[1]));
> +   printf("  GL_SOURCE2_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceRGB[2]));
> +   printf("  GL_SOURCE0_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceA[0]));
> +   printf("  GL_SOURCE1_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceA[1]));
> +   printf("  GL_SOURCE2_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.SourceA[2]));
> +   printf("  GL_OPERAND0_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandRGB[0]));
> +   printf("  GL_OPERAND1_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandRGB[1]));
> +   printf("  GL_OPERAND2_RGB = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandRGB[2]));
> +   printf("  GL_OPERAND0_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandA[0]));
> +   printf("  GL_OPERAND1_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandA[1]));
> +   printf("  GL_OPERAND2_ALPHA = %s\n",
> _mesa_enum_string(texUnit->Combine.OperandA[2]));
>     printf("  GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
>     printf("  GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
>     printf("  GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n",
> texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2],
> texUnit->EnvColor[3]);
> @@ -299,11 +299,11 @@ _mesa_ActiveTexture(GLenum texture)
>
>     if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glActiveTexture %s\n",
> -                  _mesa_lookup_enum_by_nr(texture));
> +                  _mesa_enum_string(texture));
>
>     if (texUnit >= k) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)",
> -                  _mesa_lookup_enum_by_nr(texture));
> +                  _mesa_enum_string(texture));
>        return;
>     }
>
> @@ -329,7 +329,7 @@ _mesa_ClientActiveTexture(GLenum texture)
>
>     if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
>        _mesa_debug(ctx, "glClientActiveTexture %s\n",
> -                  _mesa_lookup_enum_by_nr(texture));
> +                  _mesa_enum_string(texture));
>
>     if (texUnit >= ctx->Const.MaxTextureCoordUnits) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)");
> diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
> index 0a53726..f6977f6 100644
> --- a/src/mesa/main/texstorage.c
> +++ b/src/mesa/main/texstorage.c
> @@ -292,7 +292,7 @@ tex_storage_error_check(struct gl_context *ctx, GLuint
> dims, GLenum target,
>     if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glTexStorage%uD(internalformat = %s)", dims,
> -                  _mesa_lookup_enum_by_nr(internalformat));
> +                  _mesa_enum_string(internalformat));
>        return GL_TRUE;
>     }
>
> @@ -307,7 +307,7 @@ tex_storage_error_check(struct gl_context *ctx, GLuint
> dims, GLenum target,
>     if (!legal_texobj_target(ctx, dims, target)) {
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                    "glTexStorage%uD(illegal target=%s)",
> -                  dims, _mesa_lookup_enum_by_nr(target));
> +                  dims, _mesa_enum_string(target));
>        return GL_TRUE;
>     }
>
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 9b66ad5..f47f140 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -279,8 +279,8 @@ compute_component_mapping(GLenum inFormat, GLenum
> outFormat,
>
>  #if 0
>     printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n",
> -         inFormat, _mesa_lookup_enum_by_nr(inFormat),
> -         outFormat, _mesa_lookup_enum_by_nr(outFormat),
> +         inFormat, _mesa_enum_string(inFormat),
> +         outFormat, _mesa_enum_string(outFormat),
>           map[0],
>           map[1],
>           map[2],
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index 6d79df6..68802d1 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -723,7 +723,7 @@ _mesa_GetActiveUniformBlockiv(GLuint program,
>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM,
>                   "glGetActiveUniformBlockiv(pname 0x%x (%s))",
> -                 pname, _mesa_lookup_enum_by_nr(pname));
> +                 pname, _mesa_enum_string(pname));
>        return;
>     }
>  }
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index 529d933..4fcc9a2 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -185,7 +185,7 @@ update_array(struct gl_context *ctx,
>     typeBit = type_to_bit(ctx, type);
>     if (typeBit == 0x0 || (typeBit & legalTypesMask) == 0x0) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)",
> -                  func, _mesa_lookup_enum_by_nr(type));
> +                  func, _mesa_enum_string(type));
>        return;
>     }
>
> diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
> index 637ac6f..3fcc4e8 100644
> --- a/src/mesa/tnl/t_draw.c
> +++ b/src/mesa/tnl/t_draw.c
> @@ -457,7 +457,7 @@ void _tnl_draw_prims( struct gl_context *ctx,
>        printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
>        for (i = 0; i < nr_prims; i++)
>          printf("prim %d: %s start %d count %d\n", i,
> -               _mesa_lookup_enum_by_nr(prim[i].mode),
> +               _mesa_enum_string(prim[i].mode),
>                 prim[i].start,
>                 prim[i].count);
>     }
> diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
> index 528f8b5..76b761c 100644
> --- a/src/mesa/tnl/t_vb_render.c
> +++ b/src/mesa/tnl/t_vb_render.c
> @@ -314,7 +314,7 @@ static GLboolean run_render( struct gl_context *ctx,
>
>          if (MESA_VERBOSE & VERBOSE_PRIMS)
>             _mesa_debug(NULL, "MESA prim %s %d..%d\n",
> -                       _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
> +                       _mesa_enum_string(prim & PRIM_MODE_MASK),
>                         start, start+length);
>
>          if (length)
> diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c
> index e0141c3..f846451 100644
> --- a/src/mesa/tnl/t_vertex_sse.c
> +++ b/src/mesa/tnl/t_vertex_sse.c
> @@ -591,7 +591,7 @@ static GLboolean build_vertex_emit( struct x86_program
> *p )
>             break;
>          case GL_UNSIGNED_SHORT:
>          default:
> -           printf("unknown CHAN_TYPE %s\n",
> _mesa_lookup_enum_by_nr(CHAN_TYPE));
> +           printf("unknown CHAN_TYPE %s\n", _mesa_enum_string(CHAN_TYPE));
>             return GL_FALSE;
>          }
>          break;
> diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
> index 2a1a424..ac41828 100644
> --- a/src/mesa/tnl_dd/t_dd_dmatmp.h
> +++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
> @@ -1256,7 +1256,7 @@ static GLboolean TAG(validate_render)( struct
> gl_context *ctx,
>        }
>
>        if (!ok) {
> -/*      fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim &
> PRIM_MODE_MASK)); */
> +/*      fprintf(stderr, "not ok %s\n", _mesa_enum_string(prim &
> PRIM_MODE_MASK)); */
>          return GL_FALSE;
>        }
>     }
> diff --git a/src/mesa/tnl_dd/t_dd_unfilled.h
> b/src/mesa/tnl_dd/t_dd_unfilled.h
> index 404b6e8..b271410 100644
> --- a/src/mesa/tnl_dd/t_dd_unfilled.h
> +++ b/src/mesa/tnl_dd/t_dd_unfilled.h
> @@ -60,7 +60,7 @@ static void TAG(unfilled_tri)( struct gl_context *ctx,
>     }
>
>  /*     fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */
> -/*        _mesa_lookup_enum_by_nr( mode ), */
> +/*        _mesa_enum_string( mode ), */
>  /*        ef[e0], ef[e1], ef[e2]); */
>
>     if (mode == GL_POINT) {
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 9dadd04..2bc755d 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -765,7 +765,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei
> count)
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), start, count);
> +                  _mesa_enum_string(mode), start, count);
>
>     if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
>        return;
> @@ -792,7 +792,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start,
> GLsizei count,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), start, count,
> numInstances);
> +                  _mesa_enum_string(mode), start, count, numInstances);
>
>     if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count,
> numInstances))
>        return;
> @@ -818,7 +818,7 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode,
> GLint first, GLsizei count
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawArraysInstancedBaseInstance(%s, %d, %d, %d,
> %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), first, count,
> +                  _mesa_enum_string(mode), first, count,
>                    numInstances, baseInstance);
>
>     if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
> @@ -992,8 +992,8 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx,
>                  "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p,
> %d)\n",
> -                _mesa_lookup_enum_by_nr(mode), start, end, count,
> -                _mesa_lookup_enum_by_nr(type), indices, basevertex);
> +                _mesa_enum_string(mode), start, end, count,
> +                _mesa_enum_string(type), indices, basevertex);
>
>     if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
>                                            type, indices, basevertex ))
> @@ -1089,8 +1089,8 @@ vbo_exec_DrawRangeElements(GLenum mode, GLuint
> start, GLuint end,
>        GET_CURRENT_CONTEXT(ctx);
>        _mesa_debug(ctx,
>                    "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
> -                  _mesa_lookup_enum_by_nr(mode), start, end, count,
> -                  _mesa_lookup_enum_by_nr(type), indices);
> +                  _mesa_enum_string(mode), start, end, count,
> +                  _mesa_enum_string(type), indices);
>     }
>
>     vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
> @@ -1109,8 +1109,8 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count,
> GLenum type,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices);
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices);
>
>     if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
>        return;
> @@ -1131,8 +1131,8 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei
> count, GLenum type,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices, basevertex);
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices, basevertex);
>
>     if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices,
>                                      basevertex ))
> @@ -1154,8 +1154,8 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei
> count, GLenum type,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices, numInstances);
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices, numInstances);
>
>     if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type,
> indices,
>                                               numInstances, 0))
> @@ -1178,8 +1178,8 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum
> mode, GLsizei count, GLenum type
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElementsInstancedBaseVertex(%s, %d, %s, %p,
> %d; %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices,
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices,
>                    numInstances, basevertex);
>
>     if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type,
> indices,
> @@ -1203,8 +1203,8 @@ vbo_exec_DrawElementsInstancedBaseInstance(GLenum
> mode, GLsizei count, GLenum ty
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElementsInstancedBaseInstance(%s, %d, %s,
> %p, %d, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices,
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices,
>                    numInstances, baseInstance);
>
>     if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type,
> indices,
> @@ -1229,8 +1229,8 @@
> vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei
> count,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawElementsInstancedBaseVertexBaseInstance(%s,
> %d, %s, %p, %d, %d, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), count,
> -                  _mesa_lookup_enum_by_nr(type), indices,
> +                  _mesa_enum_string(mode), count,
> +                  _mesa_enum_string(type), indices,
>                    numInstances, basevertex, baseInstance);
>
>     if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type,
> indices,
> @@ -1456,7 +1456,7 @@ vbo_exec_DrawTransformFeedback(GLenum mode, GLuint
> name)
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), name);
> +                  _mesa_enum_string(mode), name);
>
>     vbo_draw_transform_feedback(ctx, mode, obj, 0, 1);
>  }
> @@ -1470,7 +1470,7 @@ vbo_exec_DrawTransformFeedbackStream(GLenum mode,
> GLuint name, GLuint stream)
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawTransformFeedbackStream(%s, %u, %u)\n",
> -                  _mesa_lookup_enum_by_nr(mode), name, stream);
> +                  _mesa_enum_string(mode), name, stream);
>
>     vbo_draw_transform_feedback(ctx, mode, obj, stream, 1);
>  }
> @@ -1485,7 +1485,7 @@ vbo_exec_DrawTransformFeedbackInstanced(GLenum mode,
> GLuint name,
>
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawTransformFeedbackInstanced(%s, %d)\n",
> -                  _mesa_lookup_enum_by_nr(mode), name);
> +                  _mesa_enum_string(mode), name);
>
>     vbo_draw_transform_feedback(ctx, mode, obj, 0, primcount);
>  }
> @@ -1501,7 +1501,7 @@ vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum
> mode, GLuint name,
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glDrawTransformFeedbackStreamInstanced"
>                    "(%s, %u, %u, %i)\n",
> -                  _mesa_lookup_enum_by_nr(mode), name, stream, primcount);
> +                  _mesa_enum_string(mode), name, stream, primcount);
>
>     vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount);
>  }
> diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
> index 1075bd5..22236ab 100644
> --- a/src/mesa/vbo/vbo_exec_draw.c
> +++ b/src/mesa/vbo/vbo_exec_draw.c
> @@ -53,7 +53,7 @@ vbo_exec_debug_verts( struct vbo_exec_context *exec )
>        struct _mesa_prim *prim = &exec->vtx.prim[i];
>        printf("   prim %d: %s%s %d..%d %s %s\n",
>              i,
> -            _mesa_lookup_prim_by_nr(prim->mode),
> +            _mesa_prim_string(prim->mode),
>              prim->weak ? " (weak)" : "",
>              prim->start,
>              prim->start + prim->count,
> diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
> index 26951bd..1fcf2bf 100644
> --- a/src/mesa/vbo/vbo_save_api.c
> +++ b/src/mesa/vbo/vbo_save_api.c
> @@ -1508,7 +1508,7 @@ vbo_print_vertex_list(struct gl_context *ctx, void
> *data)
>        struct _mesa_prim *prim = &node->prim[i];
>        printf("   prim %d: %s%s %d..%d %s %s\n",
>               i,
> -             _mesa_lookup_prim_by_nr(prim->mode),
> +             _mesa_prim_string(prim->mode),
>               prim->weak ? " (weak)" : "",
>               prim->start,
>               prim->start + prim->count,
> diff --git a/src/mesa/vbo/vbo_save_loopback.c
> b/src/mesa/vbo/vbo_save_loopback.c
> index 31343cd..6627338 100644
> --- a/src/mesa/vbo/vbo_save_loopback.c
> +++ b/src/mesa/vbo/vbo_save_loopback.c
> @@ -95,7 +95,7 @@ static void loopback_prim( struct gl_context *ctx,
>
>     if (0)
>        printf("loopback prim %s(%s,%s) verts %d..%d\n",
> -            _mesa_lookup_prim_by_nr(prim->mode),
> +            _mesa_prim_string(prim->mode),
>              prim->begin ? "begin" : "..",
>              prim->end ? "end" : "..",
>              start,
> --
> 1.8.3
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130605/77b54875/attachment-0001.html>


More information about the mesa-dev mailing list