fixed a bunch of g++ warnings/errors.  Compiling with g++ can help find lots of potential problems
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c
index 293f475..863f304 100644
--- a/src/mesa/array_cache/ac_import.c
+++ b/src/mesa/array_cache/ac_import.c
@@ -1,4 +1,4 @@
-/* $Id: ac_import.c,v 1.7 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: ac_import.c,v 1.8 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -39,7 +39,7 @@
 
 #define STRIDE_ARRAY( array, offset ) 		\
 do {						\
-   char *tmp = (array).Ptr;			\
+   char *tmp = (char *) (array).Ptr;		\
    tmp += (offset) * (array).StrideB;		\
    (array).Ptr = tmp;				\
 } while (0)
@@ -193,7 +193,7 @@
    ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
    ASSERT(ac->count - ac->start < ctx->Const.MaxArrayLockSize);
    
-   _math_trans_4f( to->Ptr,
+   _math_trans_4f( (GLfloat (*)[4]) to->Ptr,
 		   from->Ptr,
 		   from->StrideB,
 		   from->Type,
@@ -219,7 +219,7 @@
    ASSERT(type == GL_FLOAT);
    ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
 
-   _math_trans_4f( to->Ptr,
+   _math_trans_4f( (GLfloat (*)[4]) to->Ptr,
 		   from->Ptr,
 		   from->StrideB,
 		   from->Type,
@@ -245,7 +245,7 @@
    ASSERT(type == GL_FLOAT);
    ASSERT(stride == 3*sizeof(GLfloat) || stride == 0);
 
-   _math_trans_3f( to->Ptr,
+   _math_trans_3f( (GLfloat (*)[3]) to->Ptr,
 		   from->Ptr,
 		   from->StrideB,
 		   from->Type,
@@ -270,7 +270,7 @@
    ASSERT(type == CHAN_TYPE);
    ASSERT(stride == 4 * sizeof(GLchan) || stride == 0);
 
-   _math_trans_4chan( to->Ptr,
+   _math_trans_4chan( (GLchan (*)[4]) to->Ptr,
 		      from->Ptr,
 		      from->StrideB,
 		      from->Type,
@@ -296,7 +296,7 @@
    ASSERT(type == GL_UNSIGNED_INT);
    ASSERT(stride == sizeof(GLuint) || stride == 0);
 
-   _math_trans_1ui( to->Ptr,
+   _math_trans_1ui( (GLuint *) to->Ptr,
 		    from->Ptr,
 		    from->StrideB,
 		    from->Type,
@@ -320,7 +320,7 @@
    ASSERT(type == CHAN_TYPE);
    ASSERT(stride == 4 * sizeof(GLchan) || stride == 0);
 
-   _math_trans_4chan( to->Ptr,
+   _math_trans_4chan( (GLchan (*)[4]) to->Ptr,
 		      from->Ptr,
 		      from->StrideB,
 		      from->Type,
@@ -345,7 +345,7 @@
    ASSERT(type == GL_FLOAT);
    ASSERT(stride == sizeof(GLfloat) || stride == 0);
 
-   _math_trans_1f( to->Ptr,
+   _math_trans_1f( (GLfloat *) to->Ptr,
 		   from->Ptr,
 		   from->StrideB,
 		   from->Type,
@@ -369,7 +369,7 @@
    ASSERT(type == GL_FLOAT);
    ASSERT(stride == sizeof(GLfloat) || stride == 0);
 
-   _math_trans_1f( to->Ptr,
+   _math_trans_1f( (GLfloat *) to->Ptr,
 		   from->Ptr,
 		   from->StrideB,
 		   from->Type,
@@ -402,13 +402,13 @@
 
    /* Is the request impossible?
     */
-   if (reqsize != 0 && ac->Raw.TexCoord[unit].Size > reqsize)
+   if (reqsize != 0 && ac->Raw.TexCoord[unit].Size > (GLint) reqsize)
       return 0;
 
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.TexCoord[unit].Type != type ||
-       (reqstride != 0 && ac->Raw.TexCoord[unit].StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.TexCoord[unit].StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.TexCoord[unit])
@@ -438,13 +438,13 @@
 
    /* Is the request impossible?
     */
-   if (reqsize != 0 && ac->Raw.Vertex.Size > reqsize)
+   if (reqsize != 0 && ac->Raw.Vertex.Size > (GLint) reqsize)
       return 0;
 
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.Vertex.Type != type ||
-       (reqstride != 0 && ac->Raw.Vertex.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.Vertex.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.Vertex)
@@ -474,7 +474,7 @@
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.Normal.Type != type ||
-       (reqstride != 0 && ac->Raw.Normal.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.Normal.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.Normal)
@@ -504,14 +504,14 @@
 
    /* Is the request impossible?
     */
-   if (reqsize != 0 && ac->Raw.Color.Size > reqsize) {
+   if (reqsize != 0 && ac->Raw.Color.Size > (GLint) reqsize) {
       return 0;
    }
 
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.Color.Type != type ||
-       (reqstride != 0 && ac->Raw.Color.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.Color.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.Color)
@@ -542,7 +542,7 @@
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.Index.Type != type ||
-       (reqstride != 0 && ac->Raw.Index.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.Index.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.Index)
@@ -572,13 +572,13 @@
 
    /* Is the request impossible?
     */
-   if (reqsize != 0 && ac->Raw.SecondaryColor.Size > reqsize)
+   if (reqsize != 0 && ac->Raw.SecondaryColor.Size > (GLint) reqsize)
       return 0;
 
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.SecondaryColor.Type != type ||
-       (reqstride != 0 && ac->Raw.SecondaryColor.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.SecondaryColor.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.SecondaryColor)
@@ -608,7 +608,7 @@
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.FogCoord.Type != type ||
-       (reqstride != 0 && ac->Raw.FogCoord.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.FogCoord.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.FogCoord)
@@ -641,7 +641,7 @@
    /* Do we need to pull in a copy of the client data:
     */
    if (ac->Raw.EdgeFlag.Type != type ||
-       (reqstride != 0 && ac->Raw.EdgeFlag.StrideB != reqstride) ||
+       (reqstride != 0 && ac->Raw.EdgeFlag.StrideB != (GLint) reqstride) ||
        reqwriteable) 
    {
       if (!ac->IsCached.EdgeFlag)
@@ -714,7 +714,7 @@
       if (ac->Elts) FREE(ac->Elts);
       while (ac->elt_size < count * sizeof(GLuint)) 
 	 ac->elt_size *= 2;
-      ac->Elts = MALLOC(ac->elt_size);
+      ac->Elts = (GLuint *) MALLOC(ac->elt_size);
    }
 
    switch (new_type) {
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index 7a92f12..1349d50 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -229,7 +229,7 @@
  */
 typedef struct tfxTexInfo_t
 {
-   struct tfxTexInfo *next;
+   struct tfxTexInfo_t *next;
    struct gl_texture_object *tObj;
 
    GLuint lastTimeUsed;
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 90ed9ea..82c48ea 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1,4 +1,4 @@
-/* $Id: glapi.c,v 1.49 2001/01/23 23:35:47 brianp Exp $ */
+/* $Id: glapi.c,v 1.50 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1675,7 +1675,7 @@
    {
       GLint index = get_static_proc_offset(funcName);
       if (index >= 0) {
-         return (GLboolean) (index == offset);  /* bad offset! */
+         return (GLboolean) ((GLuint) index == offset);  /* bad offset! */
       }
    }
 
@@ -1783,7 +1783,7 @@
 _glapi_get_proc_offset(const char *funcName)
 {
    /* search extension functions first */
-   GLint i;
+   GLuint i;
    for (i = 0; i < NumExtEntryPoints; i++) {
       if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
          return ExtEntryTable[i].Offset;
@@ -1803,7 +1803,7 @@
 _glapi_get_proc_address(const char *funcName)
 {
    /* search extension functions first */
-   GLint i;
+   GLuint i;
    for (i = 0; i < NumExtEntryPoints; i++) {
       if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
          return ExtEntryTable[i].Address;
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c
index b9c8506..4599f39 100644
--- a/src/mesa/glapi/glthread.c
+++ b/src/mesa/glapi/glthread.c
@@ -1,4 +1,4 @@
-/* $Id: glthread.c,v 1.6 2000/02/11 21:38:33 brianp Exp $ */
+/* $Id: glthread.c,v 1.7 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -93,7 +93,7 @@
 void *
 _glthread_GetTSD(_glthread_TSD *tsd)
 {
-   if (tsd->initMagic != INIT_MAGIC) {
+   if (tsd->initMagic != (int) INIT_MAGIC) {
       _glthread_InitTSD(tsd);
    }
    return pthread_getspecific(tsd->key);
@@ -103,7 +103,7 @@
 void
 _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 {
-   if (tsd->initMagic != INIT_MAGIC) {
+   if (tsd->initMagic != (int) INIT_MAGIC) {
       _glthread_InitTSD(tsd);
    }
    if (pthread_setspecific(tsd->key, ptr) != 0) {
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index d2bbd8b..14930e2 100644
--- a/src/mesa/main/clip.c
+++ b/src/mesa/main/clip.c
@@ -1,4 +1,4 @@
-/* $Id: clip.c,v 1.20 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: clip.c,v 1.21 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -59,7 +59,7 @@
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
-   if (p < 0 || p >= ctx->Const.MaxClipPlanes) {
+   if (p < 0 || p >= (GLint) ctx->Const.MaxClipPlanes) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glClipPlane" );
       return;
    }
@@ -114,7 +114,7 @@
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    p = (GLint) (plane - GL_CLIP_PLANE0);
-   if (p < 0 || p >= ctx->Const.MaxClipPlanes) {
+   if (p < 0 || p >= (GLint) ctx->Const.MaxClipPlanes) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetClipPlane" );
       return;
    }
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index f9693c6..c3ba3c5 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,4 +1,4 @@
-/* $Id: colortab.c,v 1.35 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: colortab.c,v 1.36 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -314,7 +314,7 @@
       return;
    }
 
-   if (width > ctx->Const.MaxColorTableSize) {
+   if (width > (GLsizei) ctx->Const.MaxColorTableSize) {
       if (proxy) {
          table->Size = 0;
          table->IntFormat = (GLenum) 0;
@@ -344,7 +344,7 @@
          if (floatTable) {
             GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
             GLfloat *tableF;
-            GLuint i;
+            GLint i;
 
             _mesa_unpack_float_color_span(ctx, width, table->Format,
                                           tempTab,  /* dest */
@@ -411,7 +411,7 @@
                return;
             }
             _mesa_unpack_chan_color_span(ctx, width, table->Format,
-                                         table->Table,  /* dest */
+                                         (GLchan *) table->Table,  /* dest */
                                          format, type, data,
                                          &ctx->Unpack, 0);
          } /* floatTable */
@@ -514,7 +514,7 @@
    comps = _mesa_components_in_format(table->Format);
    assert(comps > 0);  /* error should have been caught sooner */
 
-   if (start + count > table->Size) {
+   if (start + count > (GLint) table->Size) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
       return;
    }
@@ -532,7 +532,7 @@
    else {
       GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
       GLfloat *tableF;
-      GLuint i;
+      GLint i;
 
       ASSERT(table->FloatTable);
 
@@ -673,7 +673,6 @@
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
    struct gl_color_table *table = NULL;
    GLchan rgba[MAX_COLOR_TABLE_SIZE][4];
-   GLint i;
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    if (ctx->NewState) {
@@ -713,6 +712,7 @@
       case GL_ALPHA:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = 0;
                rgba[i][GCOMP] = 0;
@@ -722,6 +722,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = 0;
                rgba[i][GCOMP] = 0;
@@ -733,6 +734,7 @@
       case GL_LUMINANCE:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
                rgba[i][GCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
@@ -742,6 +744,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = tableUB[i];
                rgba[i][GCOMP] = tableUB[i];
@@ -753,6 +756,7 @@
       case GL_LUMINANCE_ALPHA:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = (GLint) (tableF[i*2+0] * CHAN_MAXF);
                rgba[i][GCOMP] = (GLint) (tableF[i*2+0] * CHAN_MAXF);
@@ -762,6 +766,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = tableUB[i*2+0];
                rgba[i][GCOMP] = tableUB[i*2+0];
@@ -773,6 +778,7 @@
       case GL_INTENSITY:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
                rgba[i][GCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
@@ -782,6 +788,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = tableUB[i];
                rgba[i][GCOMP] = tableUB[i];
@@ -793,6 +800,7 @@
       case GL_RGB:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = (GLint) (tableF[i*3+0] * CHAN_MAXF);
                rgba[i][GCOMP] = (GLint) (tableF[i*3+1] * CHAN_MAXF);
@@ -802,6 +810,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = tableUB[i*3+0];
                rgba[i][GCOMP] = tableUB[i*3+1];
@@ -813,6 +822,7 @@
       case GL_RGBA:
          if (table->FloatTable) {
             const GLfloat *tableF = (const GLfloat *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = (GLint) (tableF[i*4+0] * CHAN_MAXF + 0.5F);
                rgba[i][GCOMP] = (GLint) (tableF[i*4+1] * CHAN_MAXF + 0.5F);
@@ -822,6 +832,7 @@
          }
          else {
             const GLchan *tableUB = (const GLchan *) table->Table;
+            GLuint i;
             for (i = 0; i < table->Size; i++) {
                rgba[i][RCOMP] = tableUB[i*4+0];
                rgba[i][GCOMP] = tableUB[i*4+1];
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index 0b1d411..dcc4d59 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -1,4 +1,4 @@
-/* $Id: convolve.c,v 1.20 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: convolve.c,v 1.21 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -564,7 +564,7 @@
 _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
 {
    const struct gl_convolution_attrib *filter;
-   GLint row;
+   GLuint row;
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 988bcd1..4f93d0d 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,4 +1,4 @@
-/* $Id: dlist.c,v 1.65 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: dlist.c,v 1.66 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -329,8 +329,8 @@
 
       /* check for extension opcodes first */
 
-      int i = (int)n[0].opcode - (int)OPCODE_DRV_0;
-      if (i >= 0 && i < ctx->listext.nr_opcodes) {
+      GLint i = (GLint) n[0].opcode - (GLint) OPCODE_DRV_0;
+      if (i >= 0 && i < (GLint) ctx->listext.nr_opcodes) {
 	 ctx->listext.opcode[i].destroy(ctx, &n[1]);
 	 n += ctx->listext.opcode[i].size;
       }
@@ -658,7 +658,7 @@
 
 #ifdef DEBUG
    if (opcode < (int) OPCODE_DRV_0) {
-      assert( (GLint) count == InstSize[opcode] );
+      assert( count == InstSize[opcode] );
    }
 #endif
 
@@ -3992,7 +3992,7 @@
       OpCode opcode = n[0].opcode;
       int i = (int)n[0].opcode - (int)OPCODE_DRV_0;
 
-      if (i >= 0 && i < ctx->listext.nr_opcodes) {
+      if (i >= 0 && i < (GLint) ctx->listext.nr_opcodes) {
 	 ctx->listext.opcode[i].execute(ctx, &n[1]);
 	 n += ctx->listext.opcode[i].size;
       }
@@ -5917,12 +5917,13 @@
    done = n ? GL_FALSE : GL_TRUE;
    while (!done) {
       OpCode opcode = n[0].opcode;
-      int i = (int)n[0].opcode - (int)OPCODE_DRV_0;
+      GLint i = (GLint) n[0].opcode - (GLint) OPCODE_DRV_0;
 
-      if (i >= 0 && i < ctx->listext.nr_opcodes) {
+      if (i >= 0 && i < (GLint) ctx->listext.nr_opcodes) {
 	 ctx->listext.opcode[i].print(ctx, &n[1]);
 	 n += ctx->listext.opcode[i].size;
-      } else {
+      }
+      else {
 	 switch (opcode) {
          case OPCODE_ACCUM:
             fprintf(f,"accum %s %g\n", enum_string(n[1].e), n[2].f );
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index de18c7c..faaa92c 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -1,4 +1,4 @@
-/* $Id: enums.c,v 1.12 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: enums.c,v 1.13 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -862,7 +862,7 @@
 
 static void sort_enums( void )
 {
-   int i;
+   GLuint i;
    index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) );
    sorted = 1;
 
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 89bfcc2..8fcb556 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.57 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: image.c,v 1.58 2001/03/07 05:06:11 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -620,9 +620,9 @@
    width_in_bytes = CEILING( width, 8 );
    dst = buffer;
    for (row = 0; row < height; row++) {
-      GLubyte *src = _mesa_image_address( packing, pixels, width, height,
-                                          GL_COLOR_INDEX, GL_BITMAP,
-                                          0, row, 0 );
+      const GLubyte *src = (const GLubyte *)
+         _mesa_image_address(packing, pixels, width, height,
+                             GL_COLOR_INDEX, GL_BITMAP, 0, row, 0);
       if (!src) {
          FREE(buffer);
          return NULL;
@@ -640,7 +640,7 @@
          if (packing->LsbFirst) {
             GLubyte srcMask = 1 << (packing->SkipPixels & 0x7);
             GLubyte dstMask = 128;
-            GLubyte *s = src;
+            const GLubyte *s = src;
             GLubyte *d = dst;
             *d = 0;
             for (i = 0; i < width; i++) {
@@ -667,7 +667,7 @@
          else {
             GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7);
             GLubyte dstMask = 128;
-            GLubyte *s = src;
+            const GLubyte *s = src;
             GLubyte *d = dst;
             *d = 0;
             for (i = 0; i < width; i++) {
@@ -715,9 +715,8 @@
    width_in_bytes = CEILING( width, 8 );
    src = source;
    for (row = 0; row < height; row++) {
-      GLubyte *dst = _mesa_image_address( packing, dest, width, height,
-                                          GL_COLOR_INDEX, GL_BITMAP,
-                                          0, row, 0 );
+      GLubyte *dst = (GLubyte *) _mesa_image_address( packing, dest,
+                       width, height, GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
       if (!dst)
          return;
 
@@ -1725,7 +1724,7 @@
    }
    else if (transferOps == 0 && dstFormat == GL_RGB && dstType == CHAN_TYPE) {
       /* common simple case */
-      GLint i;
+      GLuint i;
       GLchan *dest = (GLchan *) dstAddr;
       for (i = 0; i < n; i++) {
          dest[0] = srcRgba[i][RCOMP];
@@ -3591,7 +3590,7 @@
  * Pack an array of depth values.  The values are floats in [0,1].
  */
 void
-_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
+_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest,
                        GLenum dstType, const GLfloat *depthSpan,
                        const struct gl_pixelstore_attrib *dstPacking )
 {
@@ -3738,7 +3737,7 @@
    }
 
    {
-      GLubyte *destBuffer = MALLOC(bytesPerRow * height * depth);
+      GLubyte *destBuffer = (GLubyte *) MALLOC(bytesPerRow * height * depth);
       GLubyte *dst;
       GLint img, row;
       if (!destBuffer)
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 7ad693e..12376f1 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -1,4 +1,4 @@
-/* $Id: image.h,v 1.16 2001/02/17 18:41:01 brianp Exp $ */
+/* $Id: image.h,v 1.17 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -156,7 +156,7 @@
                          const struct gl_pixelstore_attrib *srcPacking );
 
 extern void
-_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
+_mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest,
                        GLenum dstType, const GLfloat *depthSpan,
                        const struct gl_pixelstore_attrib *dstPacking );
 
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 6e0741a..d611c6e 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -1,4 +1,4 @@
-/* $Id: imports.c,v 1.6 2001/03/02 16:01:22 brianp Exp $ */
+/* $Id: imports.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -130,14 +130,14 @@
 static int
 _mesa_fclose(__GLcontext *gc, void *stream)
 {
-   return fclose(stream);
+   return fclose((FILE *) stream);
 }
 
 static int
 _mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
 {
    /* XXX fix this */
-   return fprintf(stream, fmt);
+   return fprintf((FILE *) stream, fmt);
 }
 
 /* XXX this really is driver-specific and can't be here */
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index a7fce7e..1ce12e3 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $Id: light.c,v 1.39 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: light.c,v 1.40 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -90,7 +90,7 @@
    GLint i = (GLint) (light - GL_LIGHT0);
    struct gl_light *l = &ctx->Light.Light[i];
 
-   if (i < 0 || i >= ctx->Const.MaxLights) {
+   if (i < 0 || i >= (GLint) ctx->Const.MaxLights) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glLight" );
       return;
    }
@@ -265,7 +265,7 @@
    GLint l = (GLint) (light - GL_LIGHT0);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (l < 0 || l >= ctx->Const.MaxLights) {
+   if (l < 0 || l >= (GLint) ctx->Const.MaxLights) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightfv" );
       return;
    }
@@ -316,7 +316,7 @@
    GLint l = (GLint) (light - GL_LIGHT0);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (l < 0 || l >= ctx->Const.MaxLights) {
+   if (l < 0 || l >= (GLint) ctx->Const.MaxLights) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetLightiv" );
       return;
    }
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 79a4353..53fcffb 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.82 2001/03/05 22:18:23 brianp Exp $ */
+/* $Id: teximage.c,v 1.83 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -56,50 +56,49 @@
 #ifdef DEBUG
 static void PrintTexture(const struct gl_texture_image *img)
 {
-  int i, j, c;
-  GLchan *data = img->Data;
+   GLuint i, j, c;
+   const GLchan *data = (const GLchan *) img->Data;
 
-  if (!data) {
-     printf("No texture data\n");
-     return;
-  }
+   if (!data) {
+      printf("No texture data\n");
+      return;
+   }
 
-  switch (img->Format) {
-     case GL_ALPHA:
-     case GL_LUMINANCE:
-     case GL_INTENSITY:
-     case GL_COLOR_INDEX:
-        c = 1;
-        break;
-     case GL_LUMINANCE_ALPHA:
-        c = 2;
-        break;
-     case GL_RGB:
-        c = 3;
-        break;
-     case GL_RGBA:
-        c = 4;
-        break;
-     default:
-        _mesa_problem(NULL, "error in PrintTexture\n");
-        return;
-  }
+   switch (img->Format) {
+      case GL_ALPHA:
+      case GL_LUMINANCE:
+      case GL_INTENSITY:
+      case GL_COLOR_INDEX:
+         c = 1;
+         break;
+      case GL_LUMINANCE_ALPHA:
+         c = 2;
+         break;
+      case GL_RGB:
+         c = 3;
+         break;
+      case GL_RGBA:
+         c = 4;
+         break;
+      default:
+         _mesa_problem(NULL, "error in PrintTexture\n");
+         return;
+   }
 
-
-  for (i = 0; i < img->Height; i++) {
-    for (j = 0; j < img->Width; j++) {
-      if (c==1)
-        printf("%02x  ", data[0]);
-      else if (c==2)
-        printf("%02x%02x  ", data[0], data[1]);
-      else if (c==3)
-        printf("%02x%02x%02x  ", data[0], data[1], data[2]);
-      else if (c==4)
-        printf("%02x%02x%02x%02x  ", data[0], data[1], data[2], data[3]);
-      data += c;
-    }
-    printf("\n");
-  }
+   for (i = 0; i < img->Height; i++) {
+      for (j = 0; j < img->Width; j++) {
+         if (c==1)
+            printf("%02x  ", data[0]);
+         else if (c==2)
+            printf("%02x%02x  ", data[0], data[1]);
+         else if (c==3)
+            printf("%02x%02x%02x  ", data[0], data[1], data[2]);
+         else if (c==4)
+            printf("%02x%02x%02x%02x  ", data[0], data[1], data[2], data[3]);
+         data += c;
+      }
+      printf("\n");
+   }
 }
 #endif
 
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 91763dc..d21503a 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.35 2001/03/03 20:33:28 brianp Exp $ */
+/* $Id: texstate.c,v 1.36 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1165,7 +1165,7 @@
       case GL_SHADOW_AMBIENT_SGIX:
          if (ctx->Extensions.SGIX_shadow_ambient) {
             /* XXX range? */
-            *params = CHAN_TO_FLOAT(obj->ShadowAmbient);
+            *params = (GLint) CHAN_TO_FLOAT(obj->ShadowAmbient);
          }
          else {
             _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname)");
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 37aadbc..4164e7a 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1,4 +1,4 @@
-/* $Id: texstore.c,v 1.9 2001/03/03 20:33:28 brianp Exp $ */
+/* $Id: texstore.c,v 1.10 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -820,7 +820,7 @@
       return;      /* out of memory */
 
    /* unpack image, apply transfer ops and store in texImage->Data */
-   _mesa_transfer_teximage(ctx, 1, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 1, texImage->Format, (GLchan *) texImage->Data,
                            width, 1, 1, 0, 0, 0,
                            0, /* dstRowStride */
                            0, /* dstImageStride */
@@ -873,7 +873,7 @@
       return;      /* out of memory */
 
    /* unpack image, apply transfer ops and store in texImage->Data */
-   _mesa_transfer_teximage(ctx, 2, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 2, texImage->Format, (GLchan *) texImage->Data,
                            width, height, 1, 0, 0, 0,
                            texImage->Width * components * sizeof(GLchan),
                            0, /* dstImageStride */
@@ -921,7 +921,7 @@
       return;      /* out of memory */
 
    /* unpack image, apply transfer ops and store in texImage->Data */
-   _mesa_transfer_teximage(ctx, 3, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 3, texImage->Format, (GLchan *) texImage->Data,
                            width, height, depth, 0, 0, 0,
                            texImage->Width * components * sizeof(GLchan),
                            texImage->Width * texImage->Height * components
@@ -943,7 +943,7 @@
                           struct gl_texture_object *texObj,
                           struct gl_texture_image *texImage)
 {
-   _mesa_transfer_teximage(ctx, 1, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 1, texImage->Format, (GLchan *) texImage->Data,
                            width, 1, 1, /* src size */
                            xoffset, 0, 0, /* dest offsets */
                            0, /* dstRowStride */
@@ -966,7 +966,7 @@
 {
    const GLint components = components_in_intformat(texImage->IntFormat);
    const GLint compSize = _mesa_sizeof_type(texImage->Type);
-   _mesa_transfer_teximage(ctx, 2, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 2, texImage->Format, (GLchan *) texImage->Data,
                            width, height, 1, /* src size */
                            xoffset, yoffset, 0, /* dest offsets */
                            texImage->Width * components * compSize,
@@ -989,7 +989,7 @@
 {
    const GLint components = components_in_intformat(texImage->IntFormat);
    const GLint compSize = _mesa_sizeof_type(texImage->Type);
-   _mesa_transfer_teximage(ctx, 3, texImage->Format, texImage->Data,
+   _mesa_transfer_teximage(ctx, 3, texImage->Format, (GLchan *) texImage->Data,
                            width, height, depth, /* src size */
                            xoffset, yoffset, xoffset, /* dest offsets */
                            texImage->Width * components * compSize,
diff --git a/src/mesa/main/texutil.c b/src/mesa/main/texutil.c
index b0c6793..08e991f 100644
--- a/src/mesa/main/texutil.c
+++ b/src/mesa/main/texutil.c
@@ -1,4 +1,4 @@
-/* $Id: texutil.c,v 1.12 2001/03/03 20:33:28 brianp Exp $ */
+/* $Id: texutil.c,v 1.13 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -135,10 +135,6 @@
                GLubyte *dst = (GLubyte *) dstImage;
                GLint row;
                for (row = 0; row < dstHeight; row++) {
-		  GLuint i;
-		  for (i = 0 ; i < dstWidth ; i++)
-		     fprintf(stderr, "%02x ", src[i]);
-		  fprintf(stderr, "\n");
                   MEMCPY(dst, src, dstWidth * sizeof(GLubyte));
                   dst += dstRowStride;
                   src += srcStride;
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index fdc2a90..6d63bc1 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1,4 +1,4 @@
-/* $Id: varray.c,v 1.37 2001/03/03 20:33:28 brianp Exp $ */
+/* $Id: varray.c,v 1.38 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -654,14 +654,14 @@
          _mesa_TexCoordPointer( tcomps, GL_FLOAT, stride,
 				(GLubyte *) pointer + i * coffset );
       }
-      for (i = factor; i < ctx->Const.MaxTextureUnits; i++) {
+      for (i = factor; i < (GLint) ctx->Const.MaxTextureUnits; i++) {
          _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) );
          _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY );
       }
    }
    else {
       GLint i;
-      for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+      for (i = 0; i < (GLint) ctx->Const.MaxTextureUnits; i++) {
          _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) );
          _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY );
       }
@@ -707,7 +707,8 @@
    if (MESA_VERBOSE & VERBOSE_API)
       fprintf(stderr, "glLockArrays %d %d\n", first, count);
 
-   if (first == 0 && count > 0 && count <= ctx->Const.MaxArrayLockSize) {
+   if (first == 0 && count > 0 &&
+       count <= (GLint) ctx->Const.MaxArrayLockSize) {
       ctx->Array.LockFirst = first;
       ctx->Array.LockCount = count;
    } 
diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c
index a4ae039..c182bbf 100644
--- a/src/mesa/math/m_eval.c
+++ b/src/mesa/math/m_eval.c
@@ -1,4 +1,4 @@
-/* $Id: m_eval.c,v 1.1 2000/12/26 05:09:31 keithw Exp $ */
+/* $Id: m_eval.c,v 1.2 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -89,7 +89,7 @@
       for(i=2, cp+=2*dim, powert=t*t; i<order; i++, powert*=t, cp +=dim)
       {
 	 bincoeff *= order-i;
-	 bincoeff *= inv_tab[i];
+	 bincoeff *= (GLuint) inv_tab[i];
 
 	 for(k=0; k<dim; k++)
 	    out[k] = s*out[k] + bincoeff*powert*cp[k];
@@ -147,7 +147,7 @@
 		i++, poweru*=u, ucp +=uinc)
 	    {
 	       bincoeff *= uorder-i;
-	       bincoeff *= inv_tab[i];
+	       bincoeff *= (GLuint) inv_tab[i];
 
 	       for(k=0; k<dim; k++)
 		  cp[j*dim+k] = s*cp[j*dim+k] + bincoeff*poweru*ucp[k];
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 5340403..8f8320f 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1,4 +1,4 @@
-/* $Id: m_matrix.c,v 1.6 2001/02/05 18:48:52 brianp Exp $ */
+/* $Id: m_matrix.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -766,16 +766,16 @@
 
    /* Do the real work
     */
-   if (mask == MASK_IDENTITY) {
+   if (mask == (GLuint) MASK_IDENTITY) {
       mat->type = MATRIX_IDENTITY;
    }
-   else if ((mask & MASK_2D_NO_ROT) == MASK_2D_NO_ROT) {
+   else if ((mask & MASK_2D_NO_ROT) == (GLuint) MASK_2D_NO_ROT) {
       mat->type = MATRIX_2D_NO_ROT;
       
       if ((mask & MASK_NO_2D_SCALE) != MASK_NO_2D_SCALE)
 	 mat->flags = MAT_FLAG_GENERAL_SCALE;
    }
-   else if ((mask & MASK_2D) == MASK_2D) {
+   else if ((mask & MASK_2D) == (GLuint) MASK_2D) {
       GLfloat mm = DOT2(m, m);
       GLfloat m4m4 = DOT2(m+4,m+4);
       GLfloat mm4 = DOT2(m,m+4);
@@ -794,7 +794,7 @@
 	 mat->flags |= MAT_FLAG_ROTATION;
 
    }
-   else if ((mask & MASK_3D_NO_ROT) == MASK_3D_NO_ROT) {
+   else if ((mask & MASK_3D_NO_ROT) == (GLuint) MASK_3D_NO_ROT) {
       mat->type = MATRIX_3D_NO_ROT;
 
       /* Check for scale */
@@ -808,7 +808,7 @@
 	 mat->flags |= MAT_FLAG_GENERAL_SCALE;
       }
    }
-   else if ((mask & MASK_3D) == MASK_3D) {
+   else if ((mask & MASK_3D) == (GLuint) MASK_3D) {
       GLfloat c1 = DOT3(m,m);
       GLfloat c2 = DOT3(m+4,m+4);
       GLfloat c3 = DOT3(m+8,m+8);
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index ac368aa..cfaea45 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -1,4 +1,4 @@
-/* $Id: s_aaline.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
+/* $Id: s_aaline.c,v 1.5 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -31,7 +31,7 @@
 #include "swrast/s_context.h"
 #include "swrast/swrast.h"
 #include "mtypes.h"
-
+#include "mmath.h"
 
 
 #define SUB_PIXEL 4
@@ -170,7 +170,7 @@
    if (z < 0.0F)
       return 0;
    else if (z > CHAN_MAXF)
-      return CHAN_MAXF;
+      return (GLchan) CHAN_MAXF;
    return (GLchan) (GLint) z;
 }
 
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index a98fbfd..91d588e 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_aalinetemp.h,v 1.5 2001/01/29 23:38:41 brianp Exp $ */
+/* $Id: s_aalinetemp.h,v 1.6 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -41,7 +41,7 @@
    const GLfloat fy = (GLfloat) iy;
    const GLfloat coverage = compute_coveragef(line, ix, iy);
    GLdepth z;
-   GLfloat fog;
+   GLfixed fog;
    GLchan red, green, blue, alpha;
    GLint frac, indx, index;
    GLchan specRed, specGreen, specBlue;
@@ -60,9 +60,9 @@
    z = 0.0;
 #endif
 #ifdef DO_FOG
-   fog = solve_plane(fx, fy, line->fPlane);
+   fog = FloatToFixed( solve_plane(fx, fy, line->fPlane) );
 #else
-   fog = 0.0;
+   fog = 0;
 #endif
 #ifdef DO_RGBA
    red   = solve_plane_chan(fx, fy, line->rPlane);
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index d9a11b0..423318d 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -1,4 +1,4 @@
-/* $Id: s_aatriangle.c,v 1.7 2001/02/16 18:14:41 keithw Exp $ */
+/* $Id: s_aatriangle.c,v 1.8 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -123,7 +123,7 @@
    if (z < 0.0F)
       return 0;
    else if (z > CHAN_MAXF)
-      return CHAN_MAXF;
+      return (GLchan) CHAN_MAXF;
    return (GLchan) (GLint) z;
 }
 
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index febc46f..26e1352 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_aatritemp.h,v 1.6 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_aatritemp.h,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -437,7 +437,7 @@
             for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
                if (ctx->Texture.Unit[unit]._ReallyEnabled) {
                   GLint j;
-                  for (j = 0; j < n; j++) {
+                  for (j = 0; j < (GLint) n; j++) {
                      s[unit][j] = s[unit][j + left];
                      t[unit][j] = t[unit][j + left];
                      u[unit][j] = u[unit][j + left];
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index d7f7dd9..0b8c611 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -1,4 +1,4 @@
-/* $Id: s_accum.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_accum.c,v 1.6 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -276,7 +276,7 @@
       case GL_ADD:
          if (value != 0.0F) {
 	    const GLaccum intVal = (GLaccum) (value * acc_scale);
-	    GLuint j;
+	    GLint j;
             /* Leave optimized accum buffer mode */
             if (swrast->_IntegerAccumMode)
                rescale_accum(ctx);
@@ -293,7 +293,7 @@
 
       case GL_MULT:
          if (value != 1.0F) {
-	    GLuint j;
+	    GLint j;
             /* Leave optimized accum buffer mode */
             if (swrast->_IntegerAccumMode)
                rescale_accum(ctx);
@@ -325,13 +325,13 @@
 
          if (swrast->_IntegerAccumMode) {
             /* simply add integer color values into accum buffer */
-            GLuint j;
+            GLint j;
             GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
             assert(swrast->_IntegerAccumScaler > 0.0);
             assert(swrast->_IntegerAccumScaler <= 1.0);
             for (j = 0; j < height; j++) {
                
-               GLuint i, i4;
+               GLint i, i4;
                _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
                for (i = i4 = 0; i < width; i++, i4+=4) {
                   acc[i4+0] += rgba[i][RCOMP];
@@ -349,10 +349,10 @@
             const GLfloat gscale = value * acc_scale / fChanMax;
             const GLfloat bscale = value * acc_scale / fChanMax;
             const GLfloat ascale = value * acc_scale / fChanMax;
-            GLuint j;
+            GLint j;
             for (j=0;j<height;j++) {
                GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
-               GLuint i;
+               GLint i;
                _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
                for (i=0;i<width;i++) {
                   *acc += (GLaccum) ( (GLfloat) rgba[i][RCOMP] * rscale );  acc++;
@@ -390,12 +390,12 @@
          RENDER_START(ctx);
          if (swrast->_IntegerAccumMode) {
             /* just copy values into accum buffer */
-            GLuint j;
+            GLint j;
             GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
             assert(swrast->_IntegerAccumScaler > 0.0);
             assert(swrast->_IntegerAccumScaler <= 1.0);
             for (j = 0; j < height; j++) {
-               GLuint i, i4;
+               GLint i, i4;
                _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
                for (i = i4 = 0; i < width; i++, i4 += 4) {
                   acc[i4+0] = rgba[i][RCOMP];
@@ -414,7 +414,7 @@
             const GLfloat bscale = value * acc_scale / fChanMax;
             const GLfloat ascale = value * acc_scale / fChanMax;
             const GLfloat d = 3.0 / acc_scale;
-            GLuint i, j;
+            GLint i, j;
             for (j = 0; j < height; j++) {
                GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4;
                _mesa_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba);
@@ -446,7 +446,7 @@
             static GLfloat prevMult = 0.0;
             const GLfloat mult = swrast->_IntegerAccumScaler;
             const GLint max = MIN2((GLint) (256 / mult), 32767);
-            GLuint j;
+            GLint j;
             if (mult != prevMult) {
                for (j = 0; j < max; j++)
                   multTable[j] = (GLint) ((GLfloat) j * mult + 0.5F);
@@ -457,7 +457,7 @@
             assert(swrast->_IntegerAccumScaler <= 1.0);
             for (j = 0; j < height; j++) {
                const GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos*4;
-               GLuint i, i4;
+               GLint i, i4;
                for (i = i4 = 0; i < width; i++, i4 += 4) {
                   ASSERT(acc[i4+0] < max);
                   ASSERT(acc[i4+1] < max);
@@ -486,7 +486,7 @@
             const GLfloat gscale = value / acc_scale * fChanMax;
             const GLfloat bscale = value / acc_scale * fChanMax;
             const GLfloat ascale = value / acc_scale * fChanMax;
-            GLuint i, j;
+            GLint i, j;
             for (j=0;j<height;j++) {
                const GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos*4;
                for (i=0;i<width;i++) {
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index c64bdcc..9dc01e8 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -1,4 +1,4 @@
-/* $Id: s_buffers.c,v 1.5 2001/02/13 23:58:38 brianp Exp $ */
+/* $Id: s_buffers.c,v 1.6 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -124,7 +124,7 @@
    else {
       /* Color index mode */
       ASSERT((ctx->Color.IndexMask & ((1 << ctx->Visual.indexBits) - 1))
-             == ((1 << ctx->Visual.indexBits) - 1));
+             == (GLuint) ((1 << ctx->Visual.indexBits) - 1));
       if (ctx->Visual.indexBits == 8) {
          /* 8-bit clear */
          GLubyte span[MAX_WIDTH];
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 22fcd3c..7af64ff0 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,4 +1,4 @@
-/* $Id: s_copypix.c,v 1.13 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.14 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -430,7 +430,7 @@
       if (transferOps) {
          const GLfloat scale = (1.0F / CHAN_MAXF);
          GLfloat rgbaFloat[MAX_WIDTH][4];
-         GLuint k;
+         GLint k;
          /* convert chan to float */
          for (k = 0; k < width; k++) {
             rgbaFloat[k][RCOMP] = (GLfloat) rgba[k][RCOMP] * scale;
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 1266d31..b051cdc 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1,4 +1,4 @@
-/* $Id: s_depth.c,v 1.6 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_depth.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1367,14 +1367,14 @@
       /* read from software depth buffer */
       if (ctx->Visual.depthBits <= 16) {
          const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
-         GLuint i;
+         GLint i;
          for (i = 0; i < n; i++) {
             depth[i] = zptr[i];
          }
       }
       else {
          const GLuint *zptr = Z_ADDRESS32( ctx, x, y );
-         GLuint i;
+         GLint i;
          for (i = 0; i < n; i++) {
             depth[i] = zptr[i];
          }
@@ -1439,14 +1439,14 @@
       /* read from software depth buffer */
       if (ctx->Visual.depthBits <= 16) {
          const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
-         GLuint i;
+         GLint i;
          for (i = 0; i < n; i++) {
             depth[i] = (GLfloat) zptr[i] * scale;
          }
       }
       else {
          const GLuint *zptr = Z_ADDRESS32( ctx, x, y );
-         GLuint i;
+         GLint i;
          for (i = 0; i < n; i++) {
             depth[i] = (GLfloat) zptr[i] * scale;
          }
@@ -1455,7 +1455,7 @@
    else if (ctx->Driver.ReadDepthSpan) {
       /* read from hardware depth buffer */
       GLdepth d[MAX_WIDTH];
-      GLuint i;
+      GLint i;
       assert(n <= MAX_WIDTH);
       (*ctx->Driver.ReadDepthSpan)( ctx, n, x, y, d );
       for (i = 0; i < n; i++) {
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 68caa3a..0943d31 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: s_drawpix.c,v 1.11 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.12 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -211,7 +211,7 @@
                GLint row;
                for (row=0; row<drawHeight; row++) {
                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
-                                               (void *) src, NULL);
+                                              (CONST GLchan (*)[4]) src, NULL);
                   src += rowLength * 4;
                   destY++;
                }
@@ -222,7 +222,7 @@
                for (row=0; row<drawHeight; row++) {
                   destY--;
                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
-                                              (void *) src, NULL);
+                                              (CONST GLchan (*)[4]) src, NULL);
                   src += rowLength * 4;
                }
             }
@@ -231,7 +231,7 @@
                GLint row;
                for (row=0; row<drawHeight; row++) {
                   _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
-                                            zSpan, 0, (void *) src, zoomY0);
+                                  zSpan, 0, (CONST GLchan (*)[4]) src, zoomY0);
                   src += rowLength * 4;
                   destY++;
                }
@@ -248,7 +248,7 @@
                GLint row;
                for (row=0; row<drawHeight; row++) {
                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
-                                              (void *) src, NULL);
+                                              (CONST GLchan (*)[3]) src, NULL);
                   src += rowLength * 3;
                   destY++;
                }
@@ -259,7 +259,7 @@
                for (row=0; row<drawHeight; row++) {
                   destY--;
                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
-                                              (void *) src, NULL);
+                                              (CONST GLchan (*)[3]) src, NULL);
                   src += rowLength * 3;
                }
             }
@@ -268,7 +268,7 @@
                GLint row;
                for (row=0; row<drawHeight; row++) {
                   _mesa_write_zoomed_rgb_span(ctx, drawWidth, destX, destY,
-                                           zSpan, 0, (void *) src, zoomY0);
+                                        zSpan, 0, (GLchan (*)[3]) src, zoomY0);
                   src += rowLength * 3;
                   destY++;
                }
@@ -293,7 +293,7 @@
                      rgb[i][2] = src[i];
 		  }
                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
-                                              (void *) rgb, NULL);
+                                              (CONST GLchan (*)[3]) rgb, NULL);
                   src += rowLength;
                   destY++;
                }
@@ -311,7 +311,7 @@
                   }
                   destY--;
                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
-                                              (void *) rgb, NULL);
+                                              (CONST GLchan (*)[3]) rgb, NULL);
                   src += rowLength;
                }
             }
@@ -327,7 +327,7 @@
                      rgb[i][2] = src[i];
 		  }
                   _mesa_write_zoomed_rgb_span(ctx, drawWidth, destX, destY,
-                                           zSpan, 0, (void *) rgb, zoomY0);
+                                  zSpan, 0, (CONST GLchan (*)[3]) rgb, zoomY0);
                   src += rowLength;
                   destY++;
                }
@@ -354,7 +354,7 @@
                      rgba[i][3] = *ptr++;
 		  }
                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
-                                               (void *) rgba, NULL);
+                                             (CONST GLchan (*)[4]) rgba, NULL);
                   src += rowLength*2;
                   destY++;
                }
@@ -374,7 +374,7 @@
                   }
                   destY--;
                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
-                                               (void *) rgba, NULL);
+                                             (CONST GLchan (*)[4]) rgba, NULL);
                   src += rowLength*2;
                }
             }
@@ -392,7 +392,7 @@
                      rgba[i][3] = *ptr++;
 		  }
                   _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
-                                            zSpan, 0, (void *) rgba, zoomY0);
+                                 zSpan, 0, (CONST GLchan (*)[4]) rgba, zoomY0);
                   src += rowLength*2;
                   destY++;
                }
@@ -426,7 +426,7 @@
                   _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
                   destY--;
                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
-                                               (const GLchan (*)[4]) rgba, 
+                                               (CONST GLchan (*)[4]) rgba, 
                                                NULL);
                   src += rowLength;
                }
@@ -439,7 +439,7 @@
                   ASSERT(drawWidth < MAX_WIDTH);
                   _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba);
                   _mesa_write_zoomed_rgba_span(ctx, drawWidth, destX, destY,
-                                            zSpan, 0, (void *) rgba, zoomY0);
+                                 zSpan, 0, (CONST GLchan (*)[4]) rgba, zoomY0);
                   src += rowLength;
                   destY++;
                }
@@ -631,8 +631,9 @@
       GLint row;
       for (row = 0; row < height; row++, y++) {
          GLdepth zspan[MAX_WIDTH];
-         const GLushort *zptr = _mesa_image_address(&ctx->Unpack,
-                pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
+         const GLushort *zptr = (const GLushort *)
+            _mesa_image_address(&ctx->Unpack, pixels, width, height,
+                                GL_DEPTH_COMPONENT, type, 0, row, 0);
          GLint i;
          for (i = 0; i < width; i++)
             zspan[i] = zptr[i];
@@ -644,8 +645,9 @@
       /* Special case: directly write 32-bit depth values */
       GLint row;
       for (row = 0; row < height; row++, y++) {
-         const GLuint *zptr = _mesa_image_address(&ctx->Unpack,
-                pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
+         const GLuint *zptr = (const GLuint *)
+            _mesa_image_address(&ctx->Unpack, pixels, width, height,
+                                GL_DEPTH_COMPONENT, type, 0, row, 0);
          _mesa_write_rgba_span( ctx, width, x, y, zptr, 0, rgba, GL_BITMAP );
       }
    }
@@ -662,7 +664,7 @@
          /* clamp depth values to [0,1] and convert from floats to integers */
          {
             const GLfloat zs = ctx->DepthMaxF;
-            GLuint i;
+            GLint i;
             for (i = 0; i < drawWidth; i++) {
                zspan[i] = (GLdepth) (fspan[i] * zs);
             }
@@ -765,7 +767,7 @@
       for (row = 0; row < height; row++) {
          const GLvoid *source = _mesa_image_address(unpack,
                   pixels, width, height, format, type, 0, row, 0);
-         _mesa_unpack_float_color_span(ctx, width, GL_RGBA, (void *) dest,
+         _mesa_unpack_float_color_span(ctx, width, GL_RGBA, (GLfloat *) dest,
                                       format, type, source, unpack,
                                       transferOps & IMAGE_PRE_CONVOLUTION_BITS,
                                       GL_FALSE);
@@ -801,7 +803,7 @@
       for (row = 0; row < height; row++, y++) {
          const GLvoid *source = _mesa_image_address(unpack,
                   pixels, width, height, format, type, 0, row, 0);
-         _mesa_unpack_chan_color_span(ctx, width, GL_RGBA, (void*) rgba,
+         _mesa_unpack_chan_color_span(ctx, width, GL_RGBA, (GLchan *) rgba,
                                       format, type, source, unpack,
                                       transferOps);
          if ((ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) ||
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index 7c2d519..debca65 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -1,4 +1,4 @@
-/* $Id: s_fog.c,v 1.9 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_fog.c,v 1.10 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -89,7 +89,7 @@
 _mesa_fog_ci_pixels( const GLcontext *ctx,
                      GLuint n, const GLfixed fog[], GLuint index[] )
 {
-   GLuint idx = ctx->Fog.Index;
+   GLuint idx = (GLuint) ctx->Fog.Index;
    GLuint i;
 
    for (i=0;i<n;i++) {
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index da7ad03..60d7f45 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_pointtemp.h,v 1.3 2001/01/30 16:38:20 brianp Exp $ */
+/* $Id: s_pointtemp.h,v 1.4 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -200,10 +200,10 @@
       iRadius = iSize / 2;
       if (iSize & 1) {
          /* odd size */
-         xmin = vert->win[0] - iRadius;
-         xmax = vert->win[0] + iRadius;
-         ymin = vert->win[1] - iRadius;
-         ymax = vert->win[1] + iRadius;
+         xmin = (GLint) (vert->win[0] - iRadius);
+         xmax = (GLint) (vert->win[0] + iRadius);
+         ymin = (GLint) (vert->win[1] - iRadius);
+         ymax = (GLint) (vert->win[1] + iRadius);
       }
       else {
          /* even size */
@@ -281,8 +281,8 @@
 
    {
       /* size == 1 */
-      GLint x = vert->win[0];
-      GLint y = vert->win[1];
+      GLint x = (GLint) vert->win[0];
+      GLint y = (GLint) vert->win[1];
 #if ((FLAGS & (SPECULAR | TEXTURE)) == (SPECULAR | TEXTURE))
       PB_WRITE_MULTITEX_SPEC_PIXEL(PB, x, y, z, fog,
                                    red, green, blue, alpha,
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 4ca5af4..9ed58f4 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,4 +1,4 @@
-/* $Id: s_readpix.c,v 1.8 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.9 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -155,7 +155,8 @@
          dest = _mesa_image_address(packing, pixels, width, height,
                                     GL_DEPTH_COMPONENT, type, 0, j, 0);
 
-         _mesa_pack_depth_span(ctx, readWidth, dest, type, depth, &ctx->Pack);
+         _mesa_pack_depth_span(ctx, readWidth, (GLdepth *) dest, type,
+                               depth, &ctx->Pack);
       }
    }
 }
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index a69bd3c..ac6f0dd 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.c,v 1.8 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.9 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1260,7 +1260,7 @@
          GLint y;
          for (y = 0; y < height; y++) {
             GLstencil stencil[MAX_WIDTH];
-            GLuint i;
+            GLint i;
             (*ctx->Driver.ReadStencilSpan)(ctx, width, x, y, stencil);
             for (i = 0; i < width; i++) {
                stencil[i] = (stencil[i] & invMask) | clearVal;
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 254907d..254f0fd 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_tritemp.h,v 1.11 2001/03/03 00:37:27 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.12 2001/03/07 05:06:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -725,7 +725,7 @@
 #  endif
                }
 	       {
-		  ffog = FloatToFixed(vLower->fog) * 256 + dfogdx * adjx + dfogdy * adjy + FIXED_HALF;
+		  ffog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx + dfogdy * adjy) + FIXED_HALF;
 		  fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx);
 	       }
 #endif
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index b15d7d9..6eaeb9c 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 @@
    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 3ed8c97..2ea04ce 100644
--- a/src/mesa/swrast_setup/ss_triangle.c
+++ b/src/mesa/swrast_setup/ss_triangle.c
@@ -236,15 +236,16 @@
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
    SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts;
-   int i;
+   GLuint i;
    
    if (VB->Elts) {
-      for(i=first;i<last;i++) 
-	 if(VB->ClipMask[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;i<last;i++) 
-	 if(VB->ClipMask[i]==0)
+   }
+   else {
+      for (i = first; i < last; i++) 
+	 if (VB->ClipMask[i] == 0)
 	    _swrast_Point( ctx, &verts[i] );
    }
 }
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c
index 32dfcb0..cfc5e5d 100644
--- a/src/mesa/tnl/t_array_api.c
+++ b/src/mesa/tnl/t_array_api.c
@@ -1,4 +1,4 @@
-/* $Id: t_array_api.c,v 1.8 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_array_api.c,v 1.9 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -56,10 +56,10 @@
     */
 #if 1
    if (_tnl_hard_begin( ctx, mode )) {
-      GLuint j;
+      GLint j;
       for (j = 0 ; j < count ; ) {
 	 struct immediate *IM = TNL_CURRENT_IM(ctx);
-	 GLuint nr = MIN2( IMM_MAXDATA - IM->Start, count - j );
+	 GLuint nr = MIN2( IMM_MAXDATA - IM->Start, (GLuint) (count - j) );
 	 GLuint sf = IM->Flag[IM->Start];
 
 	 _tnl_fill_immediate_drawarrays( ctx, IM, j, j+nr );
@@ -98,11 +98,11 @@
     * _tnl_array_element for each index in the list.
     */
    if (_tnl_hard_begin( ctx, mode )) {
-      GLuint i,j;
+      GLint i, j;
       for (j = 0 ; j < count ; ) {
 	 struct immediate *IM = TNL_CURRENT_IM(ctx);
 	 GLuint start = IM->Start;
-	 GLuint nr = MIN2( IMM_MAXDATA - start, count - j ) + start;
+	 GLint nr = MIN2( (GLint) (IMM_MAXDATA - start), count - j ) + start;
 	 GLuint sf = IM->Flag[start];
 	 IM->FlushElt |= 1;
 
@@ -179,14 +179,17 @@
    if (tnl->pipeline.build_state_changes)
       _tnl_validate_pipeline( ctx );
 
-   if (!ctx->CompileFlag && count - start < ctx->Const.MaxArrayLockSize) {
+   if (!ctx->CompileFlag && count - start < (GLint) ctx->Const.MaxArrayLockSize) {
       FLUSH_CURRENT( ctx, 0 );
 
       if (ctx->Array.LockCount)
       {
-	 if (start < ctx->Array.LockFirst) start = ctx->Array.LockFirst;
-	 if (count > ctx->Array.LockCount) count = ctx->Array.LockCount;
-	 if (start >= count) return;
+	 if (start < (GLint) ctx->Array.LockFirst)
+            start = ctx->Array.LockFirst;
+	 if (count > (GLint) ctx->Array.LockCount)
+            count = ctx->Array.LockCount;
+	 if (start >= count)
+            return;
 
 	 /* Locked drawarrays.  Reuse any previously transformed data.
 	  */
@@ -325,13 +328,14 @@
       /* Scan the index list and see if we can use the locked path anyway.
        */
       GLuint max_elt = 0;
-      GLuint i;
+      GLint i;
 
       for (i = 0 ; i < count ; i++) 
-	 if (ui_indices[i] > max_elt) max_elt = ui_indices[i];
+	 if (ui_indices[i] > max_elt)
+            max_elt = ui_indices[i];
 
       if (max_elt < ctx->Const.MaxArrayLockSize && /* can we use it? */
-	  max_elt < count) 	                   /* do we want to use it? */
+	  max_elt < (GLuint) count) 	           /* do we want to use it? */
 	 _tnl_draw_range_elements( ctx, mode, 0, max_elt+1, count, ui_indices );
       else
 	 _tnl_draw_elements( ctx, mode, count, ui_indices );
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c
index e3d2b3c..90cc0e5 100644
--- a/src/mesa/tnl/t_array_import.c
+++ b/src/mesa/tnl/t_array_import.c
@@ -1,4 +1,4 @@
-/* $Id: t_array_import.c,v 1.9 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: t_array_import.c,v 1.10 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -57,8 +57,8 @@
 			   writeable, 
 			   &is_writeable);
       
-   inputs->Obj.data = tmp->Ptr;
-   inputs->Obj.start = (GLfloat *)tmp->Ptr;
+   inputs->Obj.data = (GLfloat (*)[4]) tmp->Ptr;
+   inputs->Obj.start = (GLfloat *) tmp->Ptr;
    inputs->Obj.stride = tmp->StrideB;
    inputs->Obj.size = tmp->Size;
    inputs->Obj.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
@@ -80,8 +80,8 @@
 			   stride ? 3*sizeof(GLfloat) : 0, writeable, 
 			   &is_writeable);
       
-   inputs->Normal.data = tmp->Ptr;
-   inputs->Normal.start = (GLfloat *)tmp->Ptr;
+   inputs->Normal.data = (GLfloat (*)[3]) tmp->Ptr;
+   inputs->Normal.start = (GLfloat *) tmp->Ptr;
    inputs->Normal.stride = tmp->StrideB;
    inputs->Normal.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->Normal.stride != 3*sizeof(GLfloat))
@@ -106,8 +106,8 @@
 			  writeable, 
 			  &is_writeable);
       
-   inputs->Color.data = tmp->Ptr;
-   inputs->Color.start = (GLchan *)tmp->Ptr;
+   inputs->Color.data = (GLchan (*)[4]) tmp->Ptr;
+   inputs->Color.start = (GLchan *) tmp->Ptr;
    inputs->Color.stride = tmp->StrideB;
    inputs->Color.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->Color.stride != 4*sizeof(GLchan))
@@ -131,8 +131,8 @@
 				   writeable, 
 				   &is_writeable);
       
-   inputs->SecondaryColor.data = tmp->Ptr;
-   inputs->SecondaryColor.start = (GLchan *)tmp->Ptr;
+   inputs->SecondaryColor.data = (GLchan (*)[4]) tmp->Ptr;
+   inputs->SecondaryColor.start = (GLchan *) tmp->Ptr;
    inputs->SecondaryColor.stride = tmp->StrideB;
    inputs->SecondaryColor.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->SecondaryColor.stride != 4*sizeof(GLubyte))
@@ -153,8 +153,8 @@
 			     stride ? sizeof(GLfloat) : 0, writeable, 
 			     &is_writeable);
       
-   inputs->FogCoord.data = tmp->Ptr;
-   inputs->FogCoord.start = (GLfloat *)tmp->Ptr;
+   inputs->FogCoord.data = (GLfloat *) tmp->Ptr;
+   inputs->FogCoord.start = (GLfloat *) tmp->Ptr;
    inputs->FogCoord.stride = tmp->StrideB;
    inputs->FogCoord.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->FogCoord.stride != sizeof(GLfloat))
@@ -175,8 +175,8 @@
 			  stride ? sizeof(GLuint) : 0, writeable, 
 			  &is_writeable);
       
-   inputs->Index.data = tmp->Ptr;
-   inputs->Index.start = (GLuint *)tmp->Ptr;
+   inputs->Index.data = (GLuint *) tmp->Ptr;
+   inputs->Index.start = (GLuint *) tmp->Ptr;
    inputs->Index.stride = tmp->StrideB;
    inputs->Index.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->Index.stride != sizeof(GLuint))
@@ -201,8 +201,8 @@
 			     writeable, 
 			     &is_writeable);
       
-   inputs->TexCoord[i].data = tmp->Ptr;
-   inputs->TexCoord[i].start = (GLfloat *)tmp->Ptr;
+   inputs->TexCoord[i].data = (GLfloat (*)[4]) tmp->Ptr;
+   inputs->TexCoord[i].start = (GLfloat *) tmp->Ptr;
    inputs->TexCoord[i].stride = tmp->StrideB;
    inputs->TexCoord[i].size = tmp->Size;
    inputs->TexCoord[i].flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
@@ -226,8 +226,8 @@
 			     0, 
 			     &is_writeable);
       
-   inputs->EdgeFlag.data = tmp->Ptr;
-   inputs->EdgeFlag.start = (GLubyte *)tmp->Ptr;
+   inputs->EdgeFlag.data = (GLubyte *) tmp->Ptr;
+   inputs->EdgeFlag.start = (GLubyte *) tmp->Ptr;
    inputs->EdgeFlag.stride = tmp->StrideB;
    inputs->EdgeFlag.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE);
    if (inputs->EdgeFlag.stride != sizeof(GLubyte))
@@ -320,8 +320,8 @@
 /*  	   start, count, ctx->Array.LockFirst, ctx->Array.LockCount); */
 
    if (ctx->Array.LockCount) {
-      ASSERT(start == ctx->Array.LockFirst);
-      ASSERT(count == ctx->Array.LockCount);
+      ASSERT(start == (GLint) ctx->Array.LockFirst);
+      ASSERT(count == (GLint) ctx->Array.LockCount);
    }
    
    imports = tnl->pipeline.inputs;
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 843db0e..71bbfd6 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -1,4 +1,4 @@
-/* $Id: t_context.c,v 1.11 2001/01/13 18:28:20 keithw Exp $ */
+/* $Id: t_context.c,v 1.12 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -84,7 +84,7 @@
 
    /* Create the TNLcontext structure
     */
-   ctx->swtnl_context = tnl = CALLOC( sizeof(TNLcontext) );
+   ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
 
    if (!tnl) {
       return GL_FALSE;
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index e15cef3..de6e052 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -1,4 +1,4 @@
-/* $Id: t_context.h,v 1.15 2001/02/20 18:28:52 keithw Exp $ */
+/* $Id: t_context.h,v 1.16 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -315,7 +315,7 @@
 
    /* Private data for the pipeline stage:
     */
-   void *private;
+   void *privatePtr;
 
    /* Free private data.  May not be null.
     */
diff --git a/src/mesa/tnl/t_imm_alloc.c b/src/mesa/tnl/t_imm_alloc.c
index b63d009..3aa0df7 100644
--- a/src/mesa/tnl/t_imm_alloc.c
+++ b/src/mesa/tnl/t_imm_alloc.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_alloc.c,v 1.3 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: t_imm_alloc.c,v 1.4 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -64,8 +64,10 @@
     */
    IM->TexCoord[0] = IM->TexCoord0;
 
-   for (j = 1; j < ctx->Const.MaxTextureUnits; j++) 
-      IM->TexCoord[j] = ALIGN_MALLOC( IMM_SIZE * sizeof(GLfloat) * 4, 32 );
+   for (j = 1; j < ctx->Const.MaxTextureUnits; j++) {
+      IM->TexCoord[j] = (GLfloat (*)[4])
+         ALIGN_MALLOC( IMM_SIZE * sizeof(GLfloat) * 4, 32 );
+   }
 
    /* KW: Removed initialization of normals as these are now treated
     * identically to all other data types.
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index e5302cb..c39806d 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_fog.c,v 1.6 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: t_vb_fog.c,v 1.7 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -47,7 +47,7 @@
    GLvector1f input;		/* points into VB->EyePtr Z values */
 };
 
-#define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->private)
+#define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->privatePtr)
 
 #define FOG_EXP_TABLE_SIZE 256
 #define FOG_MAX (5.0)
@@ -199,7 +199,7 @@
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct fog_stage_data *store;
-   stage->private = MALLOC(sizeof(*store));
+   stage->privatePtr = MALLOC(sizeof(*store));
    store = FOG_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -223,7 +223,7 @@
    if (store) {
       _mesa_vector1f_free( &store->fogcoord );
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = NULL;
    }
 }
 
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index 6ccb1b0..d7d1d26 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_light.c,v 1.10 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_vb_light.c,v 1.11 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -55,7 +55,7 @@
    light_func *light_func_tab;
 };
 
-#define LIGHT_STAGE_DATA(stage) ((struct light_stage_data *)(stage->private))
+#define LIGHT_STAGE_DATA(stage) ((struct light_stage_data *)(stage->privatePtr))
 
 /* Tables for all the shading functions.
  */
@@ -209,7 +209,7 @@
    struct light_stage_data *store;
    GLuint size = tnl->vb.Size;
 
-   stage->private = MALLOC(sizeof(*store));
+   stage->privatePtr = MALLOC(sizeof(*store));
    store = LIGHT_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -241,7 +241,7 @@
 {
    stage->active = ctx->Light.Enabled;
    if (stage->active) {
-      if (stage->private)
+      if (stage->privatePtr)
 	 stage->run = run_validate_lighting;
       stage->inputs = VERT_NORM|VERT_MATERIAL;
       if (ctx->Light._NeedVertices) 
@@ -268,7 +268,7 @@
       _mesa_vector1ui_free( &store->LitIndex[0] );      
       _mesa_vector1ui_free( &store->LitIndex[1] );      
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = 0;
    }
 }
 
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c
index 3d02cae..4f9503b 100644
--- a/src/mesa/tnl/t_vb_normals.c
+++ b/src/mesa/tnl/t_vb_normals.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_normals.c,v 1.5 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: t_vb_normals.c,v 1.6 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -48,7 +48,7 @@
    GLvector3f normal;
 };
 
-#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->private)
+#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->privatePtr)
 
 
 
@@ -131,7 +131,7 @@
    stage->active = ctx->_NeedNormals;
    /* Don't clobber the initialize function:
     */
-   if (stage->private) 
+   if (stage->privatePtr) 
       stage->run = run_validate_normal_stage;
 }
 
@@ -141,7 +141,7 @@
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct normal_stage_data *store;
-   stage->private = MALLOC(sizeof(*store));
+   stage->privatePtr = MALLOC(sizeof(*store));
    store = NORMAL_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -162,7 +162,7 @@
    if (store) {
       _mesa_vector3f_free( &store->normal );
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = NULL;
    }
 }
 
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index 94a9dc2..a27e002 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_points.c,v 1.2 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_vb_points.c,v 1.3 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -37,7 +37,7 @@
    GLvector1f PointSize;	
 };
 
-#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->private)
+#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->privatePtr)
 
 
 /*
@@ -84,7 +84,7 @@
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
    struct point_stage_data *store;
-   stage->private = MALLOC(sizeof(*store));
+   stage->privatePtr = MALLOC(sizeof(*store));
    store = POINT_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -104,7 +104,7 @@
    if (store) {
       _mesa_vector1f_free( &store->PointSize );
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = 0;
    }
 }
 
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c
index 8394c50..daded26 100644
--- a/src/mesa/tnl/t_vb_texgen.c
+++ b/src/mesa/tnl/t_vb_texgen.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_texgen.c,v 1.4 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: t_vb_texgen.c,v 1.5 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -74,7 +74,7 @@
 };
 
 
-#define TEXGEN_STAGE_DATA(stage) ((struct texgen_stage_data *)stage->private)
+#define TEXGEN_STAGE_DATA(stage) ((struct texgen_stage_data *)stage->privatePtr)
 
 
 
@@ -620,7 +620,7 @@
 	    /* Something for Feedback? */
 	 }
 
-      if (stage->private)
+      if (stage->privatePtr)
 	 stage->run = run_validate_texgen_stage;
       stage->active = 1;
       stage->inputs = inputs;
@@ -640,7 +640,7 @@
    struct texgen_stage_data *store;
    GLuint i;
 
-   stage->private = CALLOC(sizeof(*store));
+   stage->privatePtr = CALLOC(sizeof(*store));
    store = TEXGEN_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -673,7 +673,7 @@
       if (store->tmp_f) FREE( store->tmp_f );
       if (store->tmp_m) FREE( store->tmp_m );
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = NULL;
    }
 }
 
diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c
index ca5707f..49fb2e1 100644
--- a/src/mesa/tnl/t_vb_texmat.c
+++ b/src/mesa/tnl/t_vb_texmat.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_texmat.c,v 1.2 2001/03/03 20:33:31 brianp Exp $ */
+/* $Id: t_vb_texmat.c,v 1.3 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -53,7 +53,7 @@
    GLvector4f texcoord[MAX_TEXTURE_UNITS];
 };
 
-#define TEXMAT_STAGE_DATA(stage) ((struct texmat_stage_data *)stage->private)
+#define TEXMAT_STAGE_DATA(stage) ((struct texmat_stage_data *)stage->privatePtr)
 
 static void check_texmat( GLcontext *ctx, struct gl_pipeline_stage *stage )
 {
@@ -104,7 +104,7 @@
    struct texmat_stage_data *store;
    GLuint i;
 
-   stage->private = CALLOC(sizeof(*store));
+   stage->privatePtr = CALLOC(sizeof(*store));
    store = TEXMAT_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -129,7 +129,7 @@
 	 if (store->texcoord[i].data)
 	    _mesa_vector4f_free( &store->texcoord[i] );
       FREE( store );
-      stage->private = 0;
+      stage->privatePtr = 0;
    }
 }
   
diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c
index 0279d13..ad8a2a2 100644
--- a/src/mesa/tnl/t_vb_vertex.c
+++ b/src/mesa/tnl/t_vb_vertex.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_vertex.c,v 1.5 2001/03/03 20:57:00 brianp Exp $ */
+/* $Id: t_vb_vertex.c,v 1.6 2001/03/07 05:06:13 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -60,7 +60,7 @@
    GLvector4f *save_projptr;
 };
 
-#define VERTEX_STAGE_DATA(stage) ((struct vertex_stage_data *)stage->private)
+#define VERTEX_STAGE_DATA(stage) ((struct vertex_stage_data *)stage->privatePtr)
 
 
 
@@ -133,7 +133,7 @@
 static GLboolean run_vertex_stage( GLcontext *ctx, 
 				   struct gl_pipeline_stage *stage )
 {
-   struct vertex_stage_data *store = (struct vertex_stage_data *)stage->private;
+   struct vertex_stage_data *store = (struct vertex_stage_data *)stage->privatePtr;
    TNLcontext *tnl = TNL_CONTEXT(ctx); 
    struct vertex_buffer *VB = &tnl->vb; 
    
@@ -262,7 +262,7 @@
    struct vertex_stage_data *store;
    GLuint size = VB->Size;
 
-   stage->private = CALLOC(sizeof(*store));
+   stage->privatePtr = CALLOC(sizeof(*store));
    store = VERTEX_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
@@ -295,7 +295,7 @@
       _mesa_vector4f_free( &store->proj );
       ALIGN_FREE( store->clipmask );
       FREE(store);
-      stage->private = 0;
+      stage->privatePtr = NULL;
       stage->run = init_vertex_stage;
    }
 }