fixed some tinygl warnings

This commit is contained in:
Pawel Kolodziejski 2005-01-12 23:01:37 +00:00
parent c65fbae3b4
commit b47eb161c5
10 changed files with 30 additions and 32 deletions

View file

@ -50,7 +50,7 @@ void gl_transform_to_viewport(GLContext *c,GLVertex *v)
static void gl_add_select1(GLContext *c,int z1,int z2,int z3) static void gl_add_select1(GLContext *c,int z1,int z2,int z3)
{ {
unsigned int min,max; int min,max;
min=max=z1; min=max=z1;
if (z2<min) min=z2; if (z2<min) min=z2;
if (z3<min) min=z3; if (z3<min) min=z3;

View file

@ -36,7 +36,7 @@ void glopMaterial(GLContext *c,TGLParam *p)
break; break;
case TGL_SHININESS: case TGL_SHININESS:
m->shininess=v[0]; m->shininess=v[0];
m->shininess_i = (v[0]/128.0f)*SPECULAR_BUFFER_RESOLUTION; m->shininess_i = (int)(v[0]/128.0f)*SPECULAR_BUFFER_RESOLUTION;
break; break;
case TGL_AMBIENT_AND_DIFFUSE: case TGL_AMBIENT_AND_DIFFUSE:
for(i=0;i<4;i++) for(i=0;i<4;i++)

View file

@ -150,13 +150,13 @@ void gl_add_op(TGLParam *p)
} }
/* this opcode is never called directly */ /* this opcode is never called directly */
void glopEndList(GLContext *c,TGLParam *p) void glopEndList(GLContext *,TGLParam *)
{ {
assert(0); assert(0);
} }
/* this opcode is never called directly */ /* this opcode is never called directly */
void glopNextBuffer(GLContext *c,TGLParam *p) void glopNextBuffer(GLContext *,TGLParam *)
{ {
assert(0); assert(0);
} }

View file

@ -54,7 +54,7 @@ void glopLoadMatrix(GLContext *c,TGLParam *p)
gl_matrix_update(c); gl_matrix_update(c);
} }
void glopLoadIdentity(GLContext *c,TGLParam *p) void glopLoadIdentity(GLContext *c,TGLParam *)
{ {
gl_M4_Id(c->matrix_stack_ptr[c->matrix_mode]); gl_M4_Id(c->matrix_stack_ptr[c->matrix_mode]);
@ -84,7 +84,7 @@ void glopMultMatrix(GLContext *c,TGLParam *p)
} }
void glopPushMatrix(GLContext *c,TGLParam *p) void glopPushMatrix(GLContext *c,TGLParam *)
{ {
int n=c->matrix_mode; int n=c->matrix_mode;
M4 *m; M4 *m;
@ -99,7 +99,7 @@ void glopPushMatrix(GLContext *c,TGLParam *p)
gl_matrix_update(c); gl_matrix_update(c);
} }
void glopPopMatrix(GLContext *c,TGLParam *p) void glopPopMatrix(GLContext *c,TGLParam *)
{ {
int n=c->matrix_mode; int n=c->matrix_mode;

View file

@ -129,14 +129,9 @@ void glopPolygonMode(GLContext *c,TGLParam *p)
} }
} }
void glopHint(GLContext *c,TGLParam *p) void glopHint(GLContext *,TGLParam *)
{ {
#if 0
int target=p[1].i;
int mode=p[2].i;
/* do nothing */ /* do nothing */
#endif
} }
void void

View file

@ -11,42 +11,45 @@
happens (which might be an indication of an error). *Don't* use it happens (which might be an indication of an error). *Don't* use it
when there's internal errors in the code - these should be handled when there's internal errors in the code - these should be handled
by asserts. */ by asserts. */
void
tgl_warning(const char *format, ...)
{
#ifndef NO_DEBUG_OUTPUT #ifndef NO_DEBUG_OUTPUT
void tgl_warning(const char *, ...) { }
#else
void tgl_warning(const char *format, ...)
{
va_list args; va_list args;
va_start(args, format); va_start(args, format);
fprintf(stderr, "*WARNING* "); fprintf(stderr, "*WARNING* ");
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
va_end(args); va_end(args);
#endif /* !NO_DEBUG_OUTPUT */
} }
#endif /* !NO_DEBUG_OUTPUT */
/* This function should be used for debug output only. */ /* This function should be used for debug output only. */
void
tgl_trace(const char *format, ...)
{
#ifndef NO_DEBUG_OUTPUT #ifndef NO_DEBUG_OUTPUT
void tgl_trace(const char *, ...) { }
#else
void tgl_trace(const char *format, ...)
{
va_list args; va_list args;
va_start(args, format); va_start(args, format);
fprintf(stderr, "*DEBUG* "); fprintf(stderr, "*DEBUG* ");
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
va_end(args); va_end(args);
#endif /* !NO_DEBUG_OUTPUT */
} }
#endif /* !NO_DEBUG_OUTPUT */
/* Use this function to output info about things in the code which /* Use this function to output info about things in the code which
should be fixed (missing handling of special cases, important should be fixed (missing handling of special cases, important
features not implemented, known bugs/buglets, ...). */ features not implemented, known bugs/buglets, ...). */
void
tgl_fixme(const char *format, ...)
{
#ifndef NO_DEBUG_OUTPUT #ifndef NO_DEBUG_OUTPUT
void tgl_fixme(const char *, ...) { }
#else
void tgl_fixme(const char *format, ...)
{
va_list args; va_list args;
va_start(args, format); va_start(args, format);
fprintf(stderr, "*FIXME* "); fprintf(stderr, "*FIXME* ");
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
va_end(args); va_end(args);
#endif /* !NO_DEBUG_OUTPUT */
} }
#endif /* !NO_DEBUG_OUTPUT */

View file

@ -50,7 +50,7 @@ void glSelectBuffer(int size,unsigned int *buf)
} }
void glopInitNames(GLContext *c,TGLParam *p) void glopInitNames(GLContext *c,TGLParam *)
{ {
if (c->render_mode == TGL_SELECT) { if (c->render_mode == TGL_SELECT) {
c->name_stack_size=0; c->name_stack_size=0;
@ -67,7 +67,7 @@ void glopPushName(GLContext *c,TGLParam *p)
} }
} }
void glopPopName(GLContext *c,TGLParam *p) void glopPopName(GLContext *c,TGLParam *)
{ {
if (c->render_mode == TGL_SELECT) { if (c->render_mode == TGL_SELECT) {
assert(c->name_stack_size>0); assert(c->name_stack_size>0);

View file

@ -181,7 +181,7 @@ void glopTexImage2D(GLContext *c,TGLParam *p)
/* TODO: not all tests are done */ /* TODO: not all tests are done */
void glopTexEnv(GLContext *c,TGLParam *p) void glopTexEnv(GLContext *,TGLParam *p)
{ {
int target=p[1].i; int target=p[1].i;
int pname=p[2].i; int pname=p[2].i;
@ -198,7 +198,7 @@ void glopTexEnv(GLContext *c,TGLParam *p)
} }
/* TODO: not all tests are done */ /* TODO: not all tests are done */
void glopTexParameter(GLContext *c,TGLParam *p) void glopTexParameter(GLContext *,TGLParam *p)
{ {
int target=p[1].i; int target=p[1].i;
int pname=p[2].i; int pname=p[2].i;
@ -217,7 +217,7 @@ void glopTexParameter(GLContext *c,TGLParam *p)
} }
} }
void glopPixelStore(GLContext *c,TGLParam *p) void glopPixelStore(GLContext *,TGLParam *p)
{ {
int pname=p[1].i; int pname=p[1].i;
int param=p[2].i; int param=p[2].i;

View file

@ -346,7 +346,7 @@ void glopVertex(GLContext * c, TGLParam * p)
c->vertex_n = n; c->vertex_n = n;
} }
void glopEnd(GLContext * c, TGLParam * param) void glopEnd(GLContext *c, TGLParam *)
{ {
assert(c->in_begin == 1); assert(c->in_begin == 1);

View file

@ -50,4 +50,4 @@ V4 gl_V4_New(float x,float y,float z,float w);
int gl_Matrix_Inv(float *r,float *m,int n); int gl_Matrix_Inv(float *r,float *m,int n);
#endif __ZMATH__ #endif