summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-11-08 15:28:08 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-11-08 15:28:08 +0000
commit99f16d01dd508ccac9d37488bf83a7aed5c05832 (patch)
tree27f8875a375f92a39d82ac822a92894cdcc21db4 /src
parent19f90e35ff1419169a2d3522e55e4de05b7ab14c (diff)
changes to silence MSVC warnings
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/attrib.c6
-rw-r--r--src/mesa/main/blend.c58
-rw-r--r--src/mesa/main/polygon.c4
-rw-r--r--src/mesa/main/rastpos.c4
-rw-r--r--src/mesa/main/stencil.c9
5 files changed, 39 insertions, 42 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 669c4c2f74..e346538eea 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.9 1999/11/08 07:36:43 brianp Exp $ */
+/* $Id: attrib.c,v 1.10 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -581,10 +581,10 @@ void gl_PopAttrib( GLcontext* ctx )
break;
case GL_FOG_BIT:
{
- GLboolean anyChange = (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
+ GLboolean anyChange = (GLboolean) (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
MEMCPY( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) );
if (anyChange && ctx->Driver.Fogfv) {
- const GLfloat mode = ctx->Fog.Mode;
+ const GLfloat mode = (GLfloat) ctx->Fog.Mode;
const GLfloat density = ctx->Fog.Density;
const GLfloat start = ctx->Fog.Start;
const GLfloat end = ctx->Fog.End;
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index fb5336a816..357d1265c2 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -1,4 +1,4 @@
-/* $Id: blend.c,v 1.6 1999/11/08 07:36:43 brianp Exp $ */
+/* $Id: blend.c,v 1.7 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -259,10 +259,10 @@ void gl_BlendEquation( GLcontext *ctx, GLenum mode )
void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green,
GLclampf blue, GLclampf alpha )
{
- ctx->Color.BlendColor[0] = CLAMP( red, 0.0, 1.0 );
- ctx->Color.BlendColor[1] = CLAMP( green, 0.0, 1.0 );
- ctx->Color.BlendColor[2] = CLAMP( blue, 0.0, 1.0 );
- ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0, 1.0 );
+ ctx->Color.BlendColor[0] = CLAMP( red, 0.0F, 1.0F );
+ ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F );
+ ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F );
+ ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0F, 1.0F );
}
@@ -301,10 +301,10 @@ static void blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
ASSERT(g <= 255);
ASSERT(b <= 255);
ASSERT(a <= 255);
- rgba[i][RCOMP] = r;
- rgba[i][GCOMP] = g;
- rgba[i][BCOMP] = b;
- rgba[i][ACOMP] = a;
+ rgba[i][RCOMP] = (GLubyte) r;
+ rgba[i][GCOMP] = (GLubyte) g;
+ rgba[i][BCOMP] = (GLubyte) b;
+ rgba[i][ACOMP] = (GLubyte) a;
}
}
}
@@ -330,10 +330,10 @@ static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLint g = rgba[i][GCOMP] + dest[i][GCOMP];
GLint b = rgba[i][BCOMP] + dest[i][BCOMP];
GLint a = rgba[i][ACOMP] + dest[i][ACOMP];
- rgba[i][RCOMP] = MIN2( r, 255 );
- rgba[i][GCOMP] = MIN2( g, 255 );
- rgba[i][BCOMP] = MIN2( b, 255 );
- rgba[i][ACOMP] = MIN2( a, 255 );
+ rgba[i][RCOMP] = (GLubyte) MIN2( r, 255 );
+ rgba[i][GCOMP] = (GLubyte) MIN2( g, 255 );
+ rgba[i][BCOMP] = (GLubyte) MIN2( b, 255 );
+ rgba[i][ACOMP] = (GLubyte) MIN2( a, 255 );
}
}
}
@@ -352,10 +352,10 @@ static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i=0;i<n;i++) {
if (mask[i]) {
- rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
- rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
+ rgba[i][RCOMP] = (GLubyte) MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = (GLubyte) MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = (GLubyte) MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = (GLubyte) MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
@@ -374,10 +374,10 @@ static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[],
for (i=0;i<n;i++) {
if (mask[i]) {
- rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
- rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
- rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
- rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
+ rgba[i][RCOMP] = (GLubyte) MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
+ rgba[i][GCOMP] = (GLubyte) MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
+ rgba[i][BCOMP] = (GLubyte) MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
+ rgba[i][ACOMP] = (GLubyte) MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
}
}
}
@@ -399,10 +399,10 @@ static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[],
GLint g = (rgba[i][GCOMP] * dest[i][GCOMP]) >> 8;
GLint b = (rgba[i][BCOMP] * dest[i][BCOMP]) >> 8;
GLint a = (rgba[i][ACOMP] * dest[i][ACOMP]) >> 8;
- rgba[i][RCOMP] = r;
- rgba[i][GCOMP] = g;
- rgba[i][BCOMP] = b;
- rgba[i][ACOMP] = a;
+ rgba[i][RCOMP] = (GLubyte) r;
+ rgba[i][GCOMP] = (GLubyte) g;
+ rgba[i][BCOMP] = (GLubyte) b;
+ rgba[i][ACOMP] = (GLubyte) a;
}
}
}
@@ -695,10 +695,10 @@ static void blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
}
/* final clamping */
- rgba[i][RCOMP] = (GLint) CLAMP( r, 0.0F, 255.0F );
- rgba[i][GCOMP] = (GLint) CLAMP( g, 0.0F, 255.0F );
- rgba[i][BCOMP] = (GLint) CLAMP( b, 0.0F, 255.0F );
- rgba[i][ACOMP] = (GLint) CLAMP( a, 0.0F, 255.0F );
+ rgba[i][RCOMP] = (GLubyte) (GLint) CLAMP( r, 0.0F, 255.0F );
+ rgba[i][GCOMP] = (GLubyte) (GLint) CLAMP( g, 0.0F, 255.0F );
+ rgba[i][BCOMP] = (GLubyte) (GLint) CLAMP( b, 0.0F, 255.0F );
+ rgba[i][ACOMP] = (GLubyte) (GLint) CLAMP( a, 0.0F, 255.0F );
}
}
}
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index ca284c2fff..eebbaa886f 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -1,4 +1,4 @@
-/* $Id: polygon.c,v 1.5 1999/11/08 07:36:44 brianp Exp $ */
+/* $Id: polygon.c,v 1.6 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -82,7 +82,7 @@ void gl_FrontFace( GLcontext *ctx, GLenum mode )
}
ctx->Polygon.FrontFace = mode;
- ctx->Polygon.FrontBit = (mode == GL_CW);
+ ctx->Polygon.FrontBit = (GLboolean) (mode == GL_CW);
ctx->NewState |= NEW_POLYGON;
if (ctx->Driver.FrontFace)
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 217cfc0ce5..eeca646f2f 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -1,4 +1,4 @@
-/* $Id: rastpos.c,v 1.2 1999/10/08 09:27:11 keithw Exp $ */
+/* $Id: rastpos.c,v 1.3 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -107,7 +107,7 @@ void gl_RasterPos4f( GLcontext *ctx,
}
/* compute raster distance */
- ctx->Current.RasterDistance =
+ ctx->Current.RasterDistance = (GLfloat)
GL_SQRT( eye[0]*eye[0] + eye[1]*eye[1] + eye[2]*eye[2] );
/* apply projection matrix: clip = Proj * eye */
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 1a05ab2cca..4510d7f4fc 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -1,4 +1,4 @@
-/* $Id: stencil.c,v 1.7 1999/11/05 06:43:10 brianp Exp $ */
+/* $Id: stencil.c,v 1.8 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -42,9 +42,6 @@
#include "stencil.h"
#include "types.h"
#include "enable.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
@@ -340,7 +337,7 @@ static void apply_stencil_op_to_span( GLcontext *ctx,
for (i=0;i<n;i++) {
if (mask[i]) {
GLstencil s = stencil[i];
- stencil[i] = ~s;
+ stencil[i] = (GLstencil) ~s;
}
}
}
@@ -500,7 +497,7 @@ GLint gl_stencil_span( GLcontext *ctx,
}
break;
case GL_NOTEQUAL:
- r = ctx->Stencil.Ref & ctx->Stencil.ValueMask;
+ r = (GLstencil) (ctx->Stencil.Ref & ctx->Stencil.ValueMask);
for (i=0;i<n;i++) {
if (mask[i]) {
s = (GLstencil) (stencil[i] & ctx->Stencil.ValueMask);