From b65bc4f87b356cf6228151cd2f341432e80dc6b8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 25 Nov 2003 15:58:22 +0000 Subject: Remove unnecessary usage of __FUNCTION__. #define MESA_FUNCTION to __FUNCTION__ if MESA_DEBUG is defined. --- src/mesa/main/api_noop.c | 34 +++++++++++++++++----------------- src/mesa/main/context.h | 4 ++-- src/mesa/main/mtypes.h | 2 ++ 3 files changed, 21 insertions(+), 19 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index f6228739dd..e60720fff5 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -389,83 +389,83 @@ void _mesa_noop_TexCoord4fv( const GLfloat *v ) void _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1f" ); } void _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fv" ); } void _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2f" ); } void _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fv" ); } void _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3f" ); } void _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fv" ); } void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4f" ); } void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); - if (index < 16) { + if (index < VERT_ATTRIB_MAX) { ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]); } else - _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fv" ); } /* Material @@ -575,7 +575,7 @@ void _mesa_noop_Begin( GLenum mode ) void _mesa_noop_End( void ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); + _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" ); } diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 663cfc8450..2687dc596a 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -278,7 +278,7 @@ _mesa_Flush( void ); #define FLUSH_VERTICES(ctx, newstate) \ do { \ if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", __FUNCTION__); \ + _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\ if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \ ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \ ctx->NewState |= newstate; \ @@ -297,7 +297,7 @@ do { \ #define FLUSH_CURRENT(ctx, newstate) \ do { \ if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", __FUNCTION__); \ + _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \ ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \ ctx->NewState |= newstate; \ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 012667a2ab..d451cc8985 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2263,9 +2263,11 @@ extern const char *_mesa_prim_name[GL_POLYGON+4]; #ifdef MESA_DEBUG extern int MESA_VERBOSE; extern int MESA_DEBUG_FLAGS; +# define MESA_FUNCTION __FUNCTION__ #else # define MESA_VERBOSE 0 # define MESA_DEBUG_FLAGS 0 +# define MESA_FUNCTION "a function" # ifndef NDEBUG # define NDEBUG # endif -- cgit v1.2.3