Remove unnecessary usage of __FUNCTION__.

#define MESA_FUNCTION to __FUNCTION__ if MESA_DEBUG is defined.
This commit is contained in:
Brian Paul
2003-11-25 15:58:22 +00:00
parent e749be22b0
commit b65bc4f87b
7 changed files with 45 additions and 56 deletions

View File

@@ -389,83 +389,83 @@ void _mesa_noop_TexCoord4fv( const GLfloat *v )
void _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x ) void _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1); ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1f" );
} }
void _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) void _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1); ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);
} }
else 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 ) void _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1); ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2f" );
} }
void _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v ) void _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1); ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fv" );
} }
void _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x, void _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z ) GLfloat y, GLfloat z )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1); ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3f" );
} }
void _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v ) void _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
{ {
GET_CURRENT_CONTEXT(ctx); 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); ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fv" );
} }
void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x, void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z, GLfloat w ) GLfloat y, GLfloat z, GLfloat w )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
if (index < 16) { if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w); ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4f" );
} }
void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v ) void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{ {
GET_CURRENT_CONTEXT(ctx); 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]); ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
} }
else else
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fv" );
} }
/* Material /* Material
@@ -575,7 +575,7 @@ void _mesa_noop_Begin( GLenum mode )
void _mesa_noop_End( void ) void _mesa_noop_End( void )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
} }

View File

@@ -278,7 +278,7 @@ _mesa_Flush( void );
#define FLUSH_VERTICES(ctx, newstate) \ #define FLUSH_VERTICES(ctx, newstate) \
do { \ do { \
if (MESA_VERBOSE & VERBOSE_STATE) \ 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) \ if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \ ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
ctx->NewState |= newstate; \ ctx->NewState |= newstate; \
@@ -297,7 +297,7 @@ do { \
#define FLUSH_CURRENT(ctx, newstate) \ #define FLUSH_CURRENT(ctx, newstate) \
do { \ do { \
if (MESA_VERBOSE & VERBOSE_STATE) \ 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) \ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \ ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
ctx->NewState |= newstate; \ ctx->NewState |= newstate; \

View File

@@ -2263,9 +2263,11 @@ extern const char *_mesa_prim_name[GL_POLYGON+4];
#ifdef MESA_DEBUG #ifdef MESA_DEBUG
extern int MESA_VERBOSE; extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS; extern int MESA_DEBUG_FLAGS;
# define MESA_FUNCTION __FUNCTION__
#else #else
# define MESA_VERBOSE 0 # define MESA_VERBOSE 0
# define MESA_DEBUG_FLAGS 0 # define MESA_DEBUG_FLAGS 0
# define MESA_FUNCTION "a function"
# ifndef NDEBUG # ifndef NDEBUG
# define NDEBUG # define NDEBUG
# endif # endif

View File

@@ -474,8 +474,8 @@ static void _save_upgrade_vertex( GLcontext *ctx,
if (tnl->save.currentsz[attr] == 0) { if (tnl->save.currentsz[attr] == 0) {
assert(oldsz == 0); assert(oldsz == 0);
tnl->save.dangling_attr_ref = attr; tnl->save.dangling_attr_ref = attr;
_mesa_debug(0, "%s: dangling reference attr %d\n", _mesa_debug(0, "_save_upgrade_vertex: dangling reference attr %d\n",
__FUNCTION__, attr); attr);
#if 0 #if 0
/* The current strategy is to punt these degenerate cases /* The current strategy is to punt these degenerate cases
@@ -730,7 +730,7 @@ do { \
static void enum_error( void ) static void enum_error( void )
{ {
GET_CURRENT_CONTEXT( ctx ); GET_CURRENT_CONTEXT( ctx );
_mesa_compile_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_compile_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
} }
static void _save_Vertex2f( GLfloat x, GLfloat y ) static void _save_Vertex2f( GLfloat x, GLfloat y )
@@ -1041,7 +1041,7 @@ static void _save_Materialfv( GLenum face, GLenum pname,
MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
break; break;
default: default:
_mesa_compile_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_compile_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return; return;
} }
} }
@@ -1094,7 +1094,7 @@ static void _save_Indexfv( const GLfloat *f )
do { \ do { \
TNLcontext *tnl = TNL_CONTEXT(ctx); \ TNLcontext *tnl = TNL_CONTEXT(ctx); \
\ \
fprintf(stderr, "fallback %s inside begin/end\n", __FUNCTION__); \ /*fprintf(stderr, "fallback %s inside begin/end\n", __FUNCTION__);*/ \
\ \
if (tnl->save.initial_counter != tnl->save.counter || \ if (tnl->save.initial_counter != tnl->save.counter || \
tnl->save.prim_count) \ tnl->save.prim_count) \
@@ -1151,7 +1151,6 @@ static void _save_EvalPoint2( GLint i, GLint j )
static void _save_CallList( GLuint l ) static void _save_CallList( GLuint l )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
fprintf(stderr, "%s\n", __FUNCTION__);
FALLBACK(ctx); FALLBACK(ctx);
ctx->Save->CallList( l ); ctx->Save->CallList( l );
} }
@@ -1159,7 +1158,6 @@ static void _save_CallList( GLuint l )
static void _save_CallLists( GLsizei n, GLenum type, const GLvoid *v ) static void _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
fprintf(stderr, "%s\n", __FUNCTION__);
FALLBACK(ctx); FALLBACK(ctx);
ctx->Save->CallLists( n, type, v ); ctx->Save->CallLists( n, type, v );
} }
@@ -1223,7 +1221,7 @@ static void _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices) const GLvoid *indices)
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
} }
@@ -1233,38 +1231,38 @@ static void _save_DrawRangeElements(GLenum mode,
const GLvoid *indices) const GLvoid *indices)
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
} }
static void _save_DrawArrays(GLenum mode, GLint start, GLsizei count) static void _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
} }
static void _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) static void _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
} }
static void _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) static void _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
} }
static void _save_EvalMesh2( GLenum mode, GLint i1, GLint i2, static void _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 ) GLint j1, GLint j2 )
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
_mesa_compile_error( ctx, GL_INVALID_OPERATION, __FUNCTION__); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
} }
static void _save_Begin( GLenum mode ) static void _save_Begin( GLenum mode )
{ {
GET_CURRENT_CONTEXT( ctx ); GET_CURRENT_CONTEXT( ctx );
_mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive begin" ); _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" );
} }

View File

@@ -1,4 +1,3 @@
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 5.1 * Version: 5.1
@@ -188,7 +187,8 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
/* Degenerate case: list references current data and would /* Degenerate case: list references current data and would
* require fixup. Take the easier option & loop it back. * require fixup. Take the easier option & loop it back.
*/ */
_mesa_debug( 0, "%s: loopback dangling attr ref\n", __FUNCTION__); _mesa_debug(ctx,
"tnl_playback_vertex_list: loopback dangling attr ref\n");
_tnl_loopback_vertex_list( ctx, data ); _tnl_loopback_vertex_list( ctx, data );
return; return;
} }

View File

@@ -495,7 +495,7 @@ do { \
static void enum_error( void ) static void enum_error( void )
{ {
GET_CURRENT_CONTEXT( ctx ); GET_CURRENT_CONTEXT( ctx );
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
} }
static void _tnl_Vertex2f( GLfloat x, GLfloat y ) static void _tnl_Vertex2f( GLfloat x, GLfloat y )
@@ -790,7 +790,7 @@ static void _tnl_Materialfv( GLenum face, GLenum pname,
break; break;
default: default:
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__); _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return; return;
} }
@@ -818,7 +818,7 @@ static void _tnl_Materialfv( GLenum face, GLenum pname,
MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
break; break;
default: default:
_mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
return; return;
} }
} }
@@ -990,7 +990,7 @@ static void _tnl_Begin( GLenum mode )
ctx->Driver.CurrentExecPrimitive = mode; ctx->Driver.CurrentExecPrimitive = mode;
} }
else else
_mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
} }
@@ -1023,7 +1023,7 @@ static void _tnl_End( void )
} }
else else
_mesa_error( ctx, GL_INVALID_OPERATION, __FUNCTION__ ); _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
} }

View File

@@ -28,20 +28,21 @@
#include "glheader.h" #include "glheader.h"
#include "api_eval.h" #include "api_eval.h"
#include "context.h" #include "context.h"
#include "enums.h"
#include "state.h" #include "state.h"
#include "macros.h" #include "macros.h"
#include "math/m_eval.h" #include "math/m_eval.h"
#include "t_vtx_api.h" #include "t_vtx_api.h"
#include "t_pipeline.h" #include "t_pipeline.h"
static void _tnl_print_vtx( GLcontext *ctx ) static void _tnl_print_vtx( GLcontext *ctx )
{ {
TNLcontext *tnl = TNL_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter; GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
GLuint i; GLuint i;
_mesa_debug(0, "%s: %u vertices %d primitives, %d vertsize\n", _mesa_debug(ctx, "_tnl_print_vtx: %u vertices %d primitives, %d vertsize\n",
__FUNCTION__,
count, count,
tnl->vtx.prim_count, tnl->vtx.prim_count,
tnl->vtx.vertex_size); tnl->vtx.vertex_size);
@@ -112,8 +113,8 @@ static void _tnl_vb_bind_vtx( GLcontext *ctx )
GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter; GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
GLuint attr, i; GLuint attr, i;
if (0) fprintf(stderr, "%s: %d verts %d vertsize\n", if (0) fprintf(stderr, "_tnl_vb_bind_vtx(): %d verts %d vertsize\n",
__FUNCTION__, count, tnl->vtx.vertex_size); count, tnl->vtx.vertex_size);
/* Setup constant data in the VB. /* Setup constant data in the VB.
@@ -178,9 +179,6 @@ static void _tnl_vb_bind_vtx( GLcontext *ctx )
} }
/* /*
* NOTE: Need to have calculated primitives by this point -- do it on the fly. * NOTE: Need to have calculated primitives by this point -- do it on the fly.
* NOTE: Old 'parity' issue is gone. * NOTE: Old 'parity' issue is gone.
@@ -255,10 +253,6 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx )
} }
/** /**
* Execute the buffer and save copied verts. * Execute the buffer and save copied verts.
*/ */
@@ -293,8 +287,3 @@ void _tnl_flush_vtx( GLcontext *ctx )
tnl->vtx.counter = tnl->vtx.initial_counter; tnl->vtx.counter = tnl->vtx.initial_counter;
tnl->vtx.vbptr = tnl->vtx.buffer; tnl->vtx.vbptr = tnl->vtx.buffer;
} }