fix assorted g++ warnings

This commit is contained in:
Brian Paul 2003-11-25 16:39:31 +00:00
parent 2c9f50dd4a
commit 8236a534b7
10 changed files with 50 additions and 49 deletions

View File

@ -345,7 +345,7 @@ _mesa_add_state_reference(struct program_parameter_list *paramList,
idx = add_parameter(paramList, "Some State", NULL, STATE);
for (a=0; a<6; a++)
paramList->Parameters[idx].StateIndexes[a] = stateTokens[a];
paramList->Parameters[idx].StateIndexes[a] = (enum state_index) stateTokens[a];
return idx;
}

View File

@ -116,15 +116,15 @@ enum state_index {
STATE_TEXGEN_OBJECT_R,
STATE_TEXGEN_OBJECT_Q,
STATE_TEXENV_COLOR,
STATE_TEXENV_COLOR,
STATE_DEPTH_RANGE,
STATE_DEPTH_RANGE,
STATE_VERTEX_PROGRAM,
STATE_FRAGMENT_PROGRAM,
STATE_VERTEX_PROGRAM,
STATE_FRAGMENT_PROGRAM,
STATE_ENV,
STATE_LOCAL
STATE_ENV,
STATE_LOCAL
};

View File

@ -74,9 +74,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
}
} else {
GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data;
SS_IND(v[0]->index, vbindex[e0]);
SS_IND(v[1]->index, vbindex[e1]);
SS_IND(v[2]->index, vbindex[e2]);
SS_IND(v[0]->index, (GLuint) vbindex[e0]);
SS_IND(v[1]->index, (GLuint) vbindex[e1]);
SS_IND(v[2]->index, (GLuint) vbindex[e2]);
}
}
}
@ -149,9 +149,9 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
}
} else {
GLfloat *vbindex = (GLfloat *)VB->IndexPtr[0]->data;
SS_IND(v[0]->index, vbindex[e0]);
SS_IND(v[1]->index, vbindex[e1]);
SS_IND(v[2]->index, vbindex[e2]);
SS_IND(v[0]->index, (GLuint) vbindex[e0]);
SS_IND(v[1]->index, (GLuint) vbindex[e1]);
SS_IND(v[2]->index, (GLuint) vbindex[e2]);
}
}
}

View File

@ -137,7 +137,7 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end,
}
if (IND & INDEX) {
v->index = index[0];
v->index = (GLuint) index[0];
STRIDE_F(index, index_stride);
}

View File

@ -160,7 +160,7 @@ build_normal_lengths( struct tnl_vertex_list *node )
GLuint stride = node->vertex_size;
GLuint count = node->count;
len = node->normal_lengths = MALLOC( count * sizeof(GLfloat) );
len = node->normal_lengths = (GLfloat *) MALLOC( count * sizeof(GLfloat) );
if (!len)
return;
@ -177,7 +177,7 @@ build_normal_lengths( struct tnl_vertex_list *node )
static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx )
{
struct tnl_vertex_store *store = MALLOC( sizeof(*store) );
struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store);
store->used = 0;
store->refcount = 1;
return store;
@ -185,7 +185,7 @@ static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx )
static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx )
{
struct tnl_primitive_store *store = MALLOC( sizeof(*store) );
struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store);
store->used = 0;
store->refcount = 1;
return store;
@ -307,7 +307,7 @@ static void _save_wrap_buffers( GLcontext *ctx )
GLint i = tnl->save.prim_count - 1;
GLenum mode;
assert(i < tnl->save.prim_max);
assert(i < (GLint) tnl->save.prim_max);
assert(i >= 0);
/* Close off in-progress primitive.
@ -337,7 +337,7 @@ static void _save_wrap_filled_vertex( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLfloat *data = tnl->save.copied.buffer;
int i;
GLuint i;
/* Emit a glEnd to close off the last vertex list.
*/
@ -467,7 +467,7 @@ static void _save_upgrade_vertex( GLcontext *ctx,
{
GLfloat *data = tnl->save.copied.buffer;
GLfloat *dest = tnl->save.buffer;
GLint j;
GLuint j;
/* Need to note this and fix up at runtime (or loopback):
*/
@ -578,7 +578,7 @@ static void save_attrib_##ATTR##_##N( const GLfloat *v ) \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
\
if ((ATTR) == 0) { \
int i; \
GLuint i; \
\
if (N>0) tnl->save.vbptr[0] = v[0]; \
if (N>1) tnl->save.vbptr[1] = v[1]; \
@ -905,7 +905,7 @@ static void _save_MultiTexCoord4fv( GLenum target, const GLfloat *v )
static void _save_VertexAttrib1fNV( GLuint index, GLfloat x )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR1F( index, x );
else
enum_error();
@ -913,7 +913,7 @@ static void _save_VertexAttrib1fNV( GLuint index, GLfloat x )
static void _save_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR1FV( index, v );
else
enum_error();
@ -921,7 +921,7 @@ static void _save_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
static void _save_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR2F( index, x, y );
else
enum_error();
@ -929,7 +929,7 @@ static void _save_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
static void _save_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR2FV( index, v );
else
enum_error();
@ -938,7 +938,7 @@ static void _save_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
static void _save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
GLfloat z )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR3F( index, x, y, z );
else
enum_error();
@ -946,7 +946,7 @@ static void _save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
static void _save_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR3FV( index, v );
else
enum_error();
@ -955,7 +955,7 @@ static void _save_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
static void _save_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
GLfloat z, GLfloat w )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR4F( index, x, y, z, w );
else
enum_error();
@ -963,7 +963,7 @@ static void _save_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
static void _save_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR4FV( index, v );
else
enum_error();
@ -1173,7 +1173,7 @@ static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode )
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (1) {
int i = tnl->save.prim_count++;
GLuint i = tnl->save.prim_count++;
assert(i < tnl->save.prim_max);
tnl->save.prim[i].mode = mode | PRIM_BEGIN;
@ -1194,14 +1194,14 @@ static void _save_End( void )
{
GET_CURRENT_CONTEXT( ctx );
TNLcontext *tnl = TNL_CONTEXT(ctx);
int i = tnl->save.prim_count - 1;
GLint i = tnl->save.prim_count - 1;
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
tnl->save.prim[i].mode |= PRIM_END;
tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) -
tnl->save.prim[i].start);
if (i == tnl->save.prim_max - 1) {
if (i == (GLint) tnl->save.prim_max - 1) {
_save_compile_vertex_list( ctx );
assert(tnl->save.copied.nr == 0);
}

View File

@ -189,7 +189,8 @@ static void loopback_prim( GLcontext *ctx,
GLint begin = prim->start;
GLint end = begin + prim->count;
GLfloat *data;
GLint j, k;
GLint j;
GLuint k;
if (prim->mode & PRIM_BEGIN) {
glBegin( prim->mode & PRIM_MODE_MASK );

View File

@ -179,7 +179,7 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
* includes operations such as glBegin or glDrawArrays.
*/
_mesa_error( ctx, GL_INVALID_OPERATION, "displaylist recursive begin");
_tnl_loopback_vertex_list( ctx, data );
_tnl_loopback_vertex_list( ctx, (struct tnl_vertex_list *) data );
return;
}
else if (tnl->LoopbackDListCassettes ||
@ -189,7 +189,7 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
*/
_mesa_debug(ctx,
"tnl_playback_vertex_list: loopback dangling attr ref\n");
_tnl_loopback_vertex_list( ctx, data );
_tnl_loopback_vertex_list( ctx, (struct tnl_vertex_list *) data );
return;
}

View File

@ -304,7 +304,7 @@ static GLboolean run_render( GLcontext *ctx,
do
{
GLint i;
GLuint i;
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{

View File

@ -80,7 +80,7 @@ static void _tnl_wrap_filled_vertex( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLfloat *data = tnl->vtx.copied.buffer;
int i;
GLuint i;
/* Run pipeline on current vertices, copy wrapped vertices
* to tnl->copied.
@ -167,7 +167,7 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx,
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint oldsz;
GLint i;
GLuint i;
GLfloat *tmp;
GLint lastcount = tnl->vtx.initial_counter - tnl->vtx.counter;
@ -344,7 +344,7 @@ static void attrib_##ATTR##_##N( const GLfloat *v ) \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
\
if ((ATTR) == 0) { \
int i; \
GLuint i; \
\
if (N>0) tnl->vtx.vbptr[0] = v[0]; \
if (N>1) tnl->vtx.vbptr[1] = v[1]; \
@ -670,7 +670,7 @@ static void _tnl_MultiTexCoord4fv( GLenum target, const GLfloat *v )
static void _tnl_VertexAttrib1fNV( GLuint index, GLfloat x )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR1F( index, x );
else
enum_error();
@ -678,7 +678,7 @@ static void _tnl_VertexAttrib1fNV( GLuint index, GLfloat x )
static void _tnl_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR1FV( index, v );
else
enum_error();
@ -686,7 +686,7 @@ static void _tnl_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
static void _tnl_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR2F( index, x, y );
else
enum_error();
@ -694,7 +694,7 @@ static void _tnl_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
static void _tnl_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR2FV( index, v );
else
enum_error();
@ -703,7 +703,7 @@ static void _tnl_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
static void _tnl_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
GLfloat z )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR3F( index, x, y, z );
else
enum_error();
@ -711,7 +711,7 @@ static void _tnl_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
static void _tnl_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR3FV( index, v );
else
enum_error();
@ -720,7 +720,7 @@ static void _tnl_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
static void _tnl_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
GLfloat z, GLfloat w )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR4F( index, x, y, z, w );
else
enum_error();
@ -728,7 +728,7 @@ static void _tnl_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
static void _tnl_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{
if (index >= VERT_ATTRIB_POS && index < VERT_ATTRIB_MAX)
if (index < VERT_ATTRIB_MAX)
DISPATCH_ATTR4FV( index, v );
else
enum_error();

View File

@ -67,7 +67,7 @@ GLboolean *_tnl_translate_edgeflag( GLcontext *ctx, const GLfloat *data,
GLuint i;
if (!ef)
ef = tnl->vtx.edgeflag_tmp = MALLOC( tnl->vb.Size );
ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size );
for (i = 0 ; i < count ; i++, data += stride)
ef[i] = (data[0] == 1.0);
@ -85,7 +85,7 @@ GLboolean *_tnl_import_current_edgeflag( GLcontext *ctx,
GLuint i;
if (!ef)
ef = tnl->vtx.edgeflag_tmp = MALLOC( tnl->vb.Size );
ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size );
for (i = 0 ; i < count ; i++)
ef[i] = tmp;