-/* $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
#define STRIDE_ARRAY( array, offset ) \
do { \
- char *tmp = (array).Ptr; \
+ char *tmp = (char *) (array).Ptr; \
tmp += (offset) * (array).StrideB; \
(array).Ptr = tmp; \
} while (0)
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,
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,
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,
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,
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,
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,
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,
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,
/* 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])
/* 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)
/* 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)
/* 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)
/* 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)
/* 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)
/* 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)
/* 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)
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) {
*/
typedef struct tfxTexInfo_t
{
- struct tfxTexInfo *next;
+ struct tfxTexInfo_t *next;
struct gl_texture_object *tObj;
GLuint lastTimeUsed;
-/* $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
{
GLint index = get_static_proc_offset(funcName);
if (index >= 0) {
- return (GLboolean) (index == offset); /* bad offset! */
+ return (GLboolean) ((GLuint) index == offset); /* bad offset! */
}
}
_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;
_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;
-/* $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
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);
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) {
-/* $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
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;
}
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;
}
-/* $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
return;
}
- if (width > ctx->Const.MaxColorTableSize) {
+ if (width > (GLsizei) ctx->Const.MaxColorTableSize) {
if (proxy) {
table->Size = 0;
table->IntFormat = (GLenum) 0;
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 */
return;
}
_mesa_unpack_chan_color_span(ctx, width, table->Format,
- table->Table, /* dest */
+ (GLchan *) table->Table, /* dest */
format, type, data,
&ctx->Unpack, 0);
} /* floatTable */
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;
}
else {
GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
GLfloat *tableF;
- GLuint i;
+ GLint i;
ASSERT(table->FloatTable);
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) {
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;
}
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;
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);
}
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];
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);
}
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];
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);
}
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];
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);
}
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];
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);
}
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];
-/* $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
_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);
-/* $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
/* 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;
}
#ifdef DEBUG
if (opcode < (int) OPCODE_DRV_0) {
- assert( (GLint) count == InstSize[opcode] );
+ assert( count == InstSize[opcode] );
}
#endif
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;
}
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 );
-/* $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
static void sort_enums( void )
{
- int i;
+ GLuint i;
index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) );
sorted = 1;
-/* $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
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;
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++) {
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++) {
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;
}
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];
* 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 )
{
}
{
- GLubyte *destBuffer = MALLOC(bytesPerRow * height * depth);
+ GLubyte *destBuffer = (GLubyte *) MALLOC(bytesPerRow * height * depth);
GLubyte *dst;
GLint img, row;
if (!destBuffer)
-/* $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
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 );
-/* $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
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 */
-/* $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
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;
}
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;
}
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;
}
-/* $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
#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
-/* $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
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)");
-/* $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
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 */
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 */
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
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 */
{
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,
{
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,
-/* $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
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;
-/* $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
_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 );
}
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;
}
-/* $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
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];
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];
-/* $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
/* 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);
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 */
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);
-/* $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
#include "swrast/s_context.h"
#include "swrast/swrast.h"
#include "mtypes.h"
-
+#include "mmath.h"
#define SUB_PIXEL 4
if (z < 0.0F)
return 0;
else if (z > CHAN_MAXF)
- return CHAN_MAXF;
+ return (GLchan) CHAN_MAXF;
return (GLchan) (GLint) z;
}
-/* $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
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;
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);
-/* $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
if (z < 0.0F)
return 0;
else if (z > CHAN_MAXF)
- return CHAN_MAXF;
+ return (GLchan) CHAN_MAXF;
return (GLchan) (GLint) z;
}
-/* $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
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];
-/* $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
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);
case GL_MULT:
if (value != 1.0F) {
- GLuint j;
+ GLint j;
/* Leave optimized accum buffer mode */
if (swrast->_IntegerAccumMode)
rescale_accum(ctx);
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];
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++;
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];
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);
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);
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);
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++) {
-/* $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
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];
-/* $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
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;
-/* $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
/* 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];
}
/* 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;
}
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++) {
-/* $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
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++;
}
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;
}
}
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++;
}
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++;
}
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;
}
}
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++;
}
rgb[i][2] = src[i];
}
(*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
- (void *) rgb, NULL);
+ (CONST GLchan (*)[3]) rgb, NULL);
src += rowLength;
destY++;
}
}
destY--;
(*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY,
- (void *) rgb, NULL);
+ (CONST GLchan (*)[3]) rgb, NULL);
src += rowLength;
}
}
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++;
}
rgba[i][3] = *ptr++;
}
(*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (void *) rgba, NULL);
+ (CONST GLchan (*)[4]) rgba, NULL);
src += rowLength*2;
destY++;
}
}
destY--;
(*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY,
- (void *) rgba, NULL);
+ (CONST GLchan (*)[4]) rgba, NULL);
src += rowLength*2;
}
}
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++;
}
_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;
}
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++;
}
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];
/* 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 );
}
}
/* 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);
}
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);
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) ||
-/* $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
_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++) {
-/* $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
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 */
{
/* 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,
-/* $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
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);
}
}
}
-/* $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
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;
-/* $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
# 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
-/* $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
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;
{
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] );
}
}
-/* $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
*/
#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 );
* _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;
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.
*/
/* 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 );
-/* $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
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);
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))
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))
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))
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))
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))
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);
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))
/* 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;
-/* $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
/* Create the TNLcontext structure
*/
- ctx->swtnl_context = tnl = CALLOC( sizeof(TNLcontext) );
+ ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
if (!tnl) {
return GL_FALSE;
-/* $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
/* Private data for the pipeline stage:
*/
- void *private;
+ void *privatePtr;
/* Free private data. May not be null.
*/
-/* $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
*/
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.
-/* $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
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)
{
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;
if (store) {
_mesa_vector1f_free( &store->fogcoord );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = NULL;
}
}
-/* $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
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.
*/
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;
{
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)
_mesa_vector1ui_free( &store->LitIndex[0] );
_mesa_vector1ui_free( &store->LitIndex[1] );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = 0;
}
}
-/* $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
GLvector3f normal;
};
-#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->private)
+#define NORMAL_STAGE_DATA(stage) ((struct normal_stage_data *)stage->privatePtr)
stage->active = ctx->_NeedNormals;
/* Don't clobber the initialize function:
*/
- if (stage->private)
+ if (stage->privatePtr)
stage->run = run_validate_normal_stage;
}
{
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;
if (store) {
_mesa_vector3f_free( &store->normal );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = NULL;
}
}
-/* $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
GLvector1f PointSize;
};
-#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->private)
+#define POINT_STAGE_DATA(stage) ((struct point_stage_data *)stage->privatePtr)
/*
{
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;
if (store) {
_mesa_vector1f_free( &store->PointSize );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = 0;
}
}
-/* $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
};
-#define TEXGEN_STAGE_DATA(stage) ((struct texgen_stage_data *)stage->private)
+#define TEXGEN_STAGE_DATA(stage) ((struct texgen_stage_data *)stage->privatePtr)
/* Something for Feedback? */
}
- if (stage->private)
+ if (stage->privatePtr)
stage->run = run_validate_texgen_stage;
stage->active = 1;
stage->inputs = inputs;
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;
if (store->tmp_f) FREE( store->tmp_f );
if (store->tmp_m) FREE( store->tmp_m );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = NULL;
}
}
-/* $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
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 )
{
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;
if (store->texcoord[i].data)
_mesa_vector4f_free( &store->texcoord[i] );
FREE( store );
- stage->private = 0;
+ stage->privatePtr = 0;
}
}
-/* $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
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)
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;
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;
_mesa_vector4f_free( &store->proj );
ALIGN_FREE( store->clipmask );
FREE(store);
- stage->private = 0;
+ stage->privatePtr = NULL;
stage->run = init_vertex_stage;
}
}