summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-03-07 05:06:11 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-03-07 05:06:11 +0000
commitb51b0a847d7e7daaea69f77ab569086ef81c24a2 (patch)
tree165cf8b023e6c7b1f66dacc46a6c37110ef27ea7 /src/mesa/main
parent249aebdd357d20f6326137c967c6b3923bef6c05 (diff)
fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots of potential problems
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/clip.c6
-rw-r--r--src/mesa/main/colortab.c25
-rw-r--r--src/mesa/main/convolve.c4
-rw-r--r--src/mesa/main/dlist.c17
-rw-r--r--src/mesa/main/enums.c4
-rw-r--r--src/mesa/main/image.c23
-rw-r--r--src/mesa/main/image.h4
-rw-r--r--src/mesa/main/imports.c6
-rw-r--r--src/mesa/main/light.c8
-rw-r--r--src/mesa/main/teximage.c89
-rw-r--r--src/mesa/main/texstate.c4
-rw-r--r--src/mesa/main/texstore.c14
-rw-r--r--src/mesa/main/texutil.c6
-rw-r--r--src/mesa/main/varray.c9
14 files changed, 113 insertions, 106 deletions
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index d2bbd8b9a0..14930e2be3 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 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
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 @@ _mesa_GetClipPlane( GLenum plane, GLdouble *equation )
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 f9693c6ba7..c3ba3c50c9 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 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
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 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
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 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
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 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
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 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
else {
GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
GLfloat *tableF;
- GLuint i;
+ GLint i;
ASSERT(table->FloatTable);
@@ -673,7 +673,6 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
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 @@ _mesa_GetColorTable( GLenum target, GLenum format,
}
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 0b1d4113c6..dcc4d59f80 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 @@ void
_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 988bcd13c3..4f93d0d768 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 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list )
/* 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 @@ _mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz )
#ifdef DEBUG
if (opcode < (int) OPCODE_DRV_0) {
- assert( (GLint) count == InstSize[opcode] );
+ assert( count == InstSize[opcode] );
}
#endif
@@ -3992,7 +3992,7 @@ execute_list( GLcontext *ctx, GLuint list )
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 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
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 de18c7c0fe..faaa92c658 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 int compar_nr( const enum_elt **a, const enum_elt **b )
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 89bfcc2759..8fcb5562af 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 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
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 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
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 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
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 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
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 @@ _mesa_pack_rgba_span( GLcontext *ctx,
}
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 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest,
* 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 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
}
{
- 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 7ad693e7e2..12376f1d2f 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 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest,
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 6e0741ab91..d611c6e8d7 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 @@ _mesa_fopen(__GLcontext *gc, const char *path, const char *mode)
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 a7fce7e0f2..1ce12e35ff 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 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
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 @@ _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
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 @@ _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
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 79a4353aba..53fcffb512 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;
-
- 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;
- }
-
-
- 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");
- }
+ GLuint i, j, c;
+ const GLchan *data = (const GLchan *) img->Data;
+
+ 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;
+ }
+
+ 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 91763dc641..d21503ac03 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 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
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 37aadbcb6e..4164e7a0df 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 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
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 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
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 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
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 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
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 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
{
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 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
{
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 b0c6793363..08e991f4aa 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 @@ _mesa_convert_teximage(MesaIntTexFormat dstFormat,
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 fdc2a908ec..6d63bc1195 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_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
_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 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
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;
}