From b51b0a847d7e7daaea69f77ab569086ef81c24a2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Mar 2001 05:06:11 +0000 Subject: fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots of potential problems --- src/mesa/swrast_setup/ss_context.c | 4 ++-- src/mesa/swrast_setup/ss_triangle.c | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mesa/swrast_setup') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index b15d7d9803..6eaeb9c527 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -1,4 +1,4 @@ -/* $Id: ss_context.c,v 1.11 2001/02/16 18:14:41 keithw Exp $ */ +/* $Id: ss_context.c,v 1.12 2001/03/07 05:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -98,7 +98,7 @@ _swsetup_CreateContext( GLcontext *ctx ) if (!swsetup) return GL_FALSE; - swsetup->verts = ALIGN_MALLOC( sizeof(SWvertex) * tnl->vb.Size, 32); + swsetup->verts = (SWvertex *) ALIGN_MALLOC( sizeof(SWvertex) * tnl->vb.Size, 32); if (!swsetup->verts) { FREE(swsetup); return GL_FALSE; diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 3ed8c97fb6..2ea04ce0aa 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -236,15 +236,16 @@ static void swsetup_points( GLcontext *ctx, GLuint first, GLuint last ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - int i; + GLuint i; if (VB->Elts) { - for(i=first;iClipMask[VB->Elts[i]]==0) + for (i = first; i < last; i++) + if (VB->ClipMask[VB->Elts[i]] == 0) _swrast_Point( ctx, &verts[VB->Elts[i]] ); - } else { - for(i=first;iClipMask[i]==0) + } + else { + for (i = first; i < last; i++) + if (VB->ClipMask[i] == 0) _swrast_Point( ctx, &verts[i] ); } } -- cgit v1.2.3