From e4fcea2e06571b71a85b4f100c95d866a82f7c19 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Sep 2003 15:38:15 +0000 Subject: Assorted casts to silence g++ warnings. --- src/mesa/array_cache/ac_context.c | 34 +++++++++++++++++----------------- src/mesa/glapi/glapi.c | 4 ++-- src/mesa/main/arbprogram.c | 6 ++++-- src/mesa/main/bufferobj.c | 2 +- src/mesa/main/dlist.c | 16 ++++++++-------- src/mesa/main/extensions.c | 2 +- src/mesa/main/program.c | 9 +++++---- src/mesa/swrast/s_aatriangle.c | 1 + src/mesa/swrast/s_nvfragprog.c | 2 +- src/mesa/swrast_setup/ss_vb.c | 2 +- src/mesa/tnl/t_imm_alloc.c | 4 ++-- src/mesa/tnl/t_imm_elt.c | 2 +- src/mesa/tnl/t_imm_eval.c | 2 +- src/mesa/tnl/t_imm_fixup.c | 8 ++++---- src/mesa/tnl/t_vb_light.c | 4 ++-- 15 files changed, 51 insertions(+), 47 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/array_cache/ac_context.c b/src/mesa/array_cache/ac_context.c index b259d5d071..e22f771b67 100644 --- a/src/mesa/array_cache/ac_context.c +++ b/src/mesa/array_cache/ac_context.c @@ -48,7 +48,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; + cl->Ptr = (GLubyte *) ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -60,7 +60,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; + cl->Ptr = (GLubyte *) ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -72,7 +72,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; + cl->Ptr = (GLubyte *) ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -84,7 +84,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) &ctx->Current.Attrib[VERT_ATTRIB_FOG]; + cl->Ptr = (GLubyte *) &ctx->Current.Attrib[VERT_ATTRIB_FOG]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -96,7 +96,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_UNSIGNED_INT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) &ctx->Current.Index; + cl->Ptr = (GLubyte *) &ctx->Current.Index; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -109,7 +109,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i]; + cl->Ptr = (GLubyte *) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -122,7 +122,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_UNSIGNED_BYTE; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) &ctx->Current.EdgeFlag; + cl->Ptr = (GLubyte *) &ctx->Current.EdgeFlag; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -135,7 +135,7 @@ static void _ac_fallbacks_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 0; - cl->Ptr = (void *) ctx->Current.Attrib[i]; + cl->Ptr = (GLubyte *) ctx->Current.Attrib[i]; cl->Enabled = 1; cl->Flags = CA_CLIENT_DATA; /* hack */ #if FEATURE_ARB_vertex_buffer_object @@ -160,7 +160,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 4 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -172,7 +172,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 3 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -184,7 +184,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 4 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -196,7 +196,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 4 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -208,7 +208,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -220,7 +220,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_UNSIGNED_INT; cl->Stride = 0; cl->StrideB = sizeof(GLuint); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -233,7 +233,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 4 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -246,7 +246,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_UNSIGNED_BYTE; cl->Stride = 0; cl->StrideB = sizeof(GLubyte); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object @@ -259,7 +259,7 @@ static void _ac_cache_init( GLcontext *ctx ) cl->Type = GL_FLOAT; cl->Stride = 0; cl->StrideB = 4 * sizeof(GLfloat); - cl->Ptr = MALLOC( cl->StrideB * size ); + cl->Ptr = (GLubyte *) MALLOC( cl->StrideB * size ); cl->Enabled = 1; cl->Flags = 0; #if FEATURE_ARB_vertex_buffer_object diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 85330dd667..cfa2f8f628 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -673,10 +673,10 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset) if (ExtEntryTable[i].Offset == offset) { return GL_TRUE; /* offsets match */ } - else if (ExtEntryTable[i].Offset == ~0 + else if (ExtEntryTable[i].Offset == (GLuint) ~0 && offset < DISPATCH_TABLE_SIZE) { /* need to patch-up the dispatch code */ - if (offset != ~0) { + if (offset != (GLuint) ~0) { fill_in_entrypoint_offset(ExtEntryTable[i].Address, offset); ExtEntryTable[i].Offset = offset; } diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index b4ebe01399..8ebae9d7da 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -196,7 +196,8 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)"); return; } - _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); + _mesa_parse_arb_vertex_program(ctx, target, (const GLubyte *) string, + len, prog); } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { @@ -205,7 +206,8 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)"); return; } - _mesa_parse_arb_fragment_program(ctx, target, string, len, prog); + _mesa_parse_arb_fragment_program(ctx, target, (const GLubyte *) string, + len, prog); } else { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)"); diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 3ae35d5b4d..e47065415d 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -226,7 +226,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size ); if ( new_data != NULL ) { - bufObj->Data = new_data; + bufObj->Data = (GLubyte *) new_data; bufObj->Size = size; bufObj->Usage = usage; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 3a241448d0..6efe5405dc 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4219,8 +4219,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint *ids) { GET_CURRENT_CONTEXT(ctx); Node *n; - GLuint *idCopy; - idCopy = _mesa_malloc(num * sizeof(GLuint)); + GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); if (!idCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); return; @@ -4357,9 +4356,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, { GET_CURRENT_CONTEXT(ctx); Node *n; - GLubyte *nameCopy; - - nameCopy = _mesa_malloc(len); + GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); if (!nameCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); return; @@ -5251,10 +5248,12 @@ execute_list( GLcontext *ctx, GLuint list ) } break; case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - (*ctx->Exec->RequestResidentProgramsNV)(n[1].ui, n[2].data); + (*ctx->Exec->RequestResidentProgramsNV)(n[1].ui, + (GLuint *) n[2].data); break; case OPCODE_LOAD_PROGRAM_NV: - (*ctx->Exec->LoadProgramNV)(n[1].e, n[2].ui, n[3].i, n[4].data); + (*ctx->Exec->LoadProgramNV)(n[1].e, n[2].ui, n[3].i, + (const GLubyte *) n[4].data); break; case OPCODE_PROGRAM_PARAMETER4F_NV: (*ctx->Exec->ProgramParameter4fNV)(n[1].e, n[2].ui, n[3].f, @@ -5271,7 +5270,8 @@ execute_list( GLcontext *ctx, GLuint list ) n[4].f, n[5].f, n[6].f); break; case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - (*ctx->Exec->ProgramNamedParameter4fNV)(n[1].ui, n[2].i, n[3].data, + (*ctx->Exec->ProgramNamedParameter4fNV)(n[1].ui, n[2].i, + (const GLubyte *) n[3].data, n[4].f, n[5].f, n[6].f, n[7].f); break; #endif diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 6f5f715fc1..fb67683a39 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -423,7 +423,7 @@ _mesa_make_extension_string( GLcontext *ctx ) extStrLen += _mesa_strlen(default_extensions[i].name) + 1; } } - s = _mesa_malloc(extStrLen); + s = (GLubyte *) _mesa_malloc(extStrLen); /* second, build the extension string */ extStrLen = 0; diff --git a/src/mesa/main/program.c b/src/mesa/main/program.c index 8cc5f6885a..fa5f301e2a 100644 --- a/src/mesa/main/program.c +++ b/src/mesa/main/program.c @@ -260,9 +260,10 @@ add_parameter(struct program_parameter_list *paramList, { const GLuint n = paramList->NumParameters; - paramList->Parameters = _mesa_realloc(paramList->Parameters, - n * sizeof(struct program_parameter), - (n + 1) * sizeof(struct program_parameter)); + paramList->Parameters = (struct program_parameter *) + _mesa_realloc(paramList->Parameters, + n * sizeof(struct program_parameter), + (n + 1) * sizeof(struct program_parameter)); if (!paramList->Parameters) { /* out of memory */ paramList->NumParameters = 0; @@ -1011,7 +1012,7 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, #endif /* make null-terminated copy of registerName */ - len = MIN2(len, sizeof(reg) - 1); + len = MIN2((unsigned int) len, sizeof(reg) - 1); _mesa_memcpy(reg, registerName, len); reg[len] = 0; diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 4f2af74dbf..b05a7ea28d 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -31,6 +31,7 @@ #include "glheader.h" #include "context.h" #include "colormac.h" +#include "context.h" #include "macros.h" #include "imports.h" #include "s_aatriangle.h" diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index c0c097a8d7..332edc5c86 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -121,7 +121,7 @@ get_register_pointer( GLcontext *ctx, src = ctx->FragmentProgram.Parameters[source->Index]; break; case PROGRAM_NAMED_PARAM: - ASSERT(source->Index < program->Parameters->NumParameters); + ASSERT(source->Index < (GLint) program->Parameters->NumParameters); src = program->Parameters->Parameters[source->Index].Values; break; case PROGRAM_STATE_VAR: diff --git a/src/mesa/swrast_setup/ss_vb.c b/src/mesa/swrast_setup/ss_vb.c index 29bad8eefe..869d519832 100644 --- a/src/mesa/swrast_setup/ss_vb.c +++ b/src/mesa/swrast_setup/ss_vb.c @@ -46,7 +46,7 @@ static void do_import( struct vertex_buffer *VB, GLuint count = VB->Count; if (!to->Ptr) { - to->Ptr = ALIGN_MALLOC( VB->Size * 4 * sizeof(GLchan), 32 ); + to->Ptr = (GLubyte *) ALIGN_MALLOC( VB->Size * 4 * sizeof(GLchan), 32 ); to->Type = CHAN_TYPE; } diff --git a/src/mesa/tnl/t_imm_alloc.c b/src/mesa/tnl/t_imm_alloc.c index 8ffb182fd1..a8b3d72914 100644 --- a/src/mesa/tnl/t_imm_alloc.c +++ b/src/mesa/tnl/t_imm_alloc.c @@ -59,14 +59,14 @@ real_alloc_immediate( GLcontext *ctx ) /* Only allocate space for vertex positions right now. Color, texcoord, * etc storage will be allocated as needed. */ - immed->Attrib[VERT_ATTRIB_POS] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + immed->Attrib[VERT_ATTRIB_POS] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); /* Enable this to allocate all attribute arrays up front */ if (0) { int i; for (i = 1; i < VERT_ATTRIB_MAX; i++) { - immed->Attrib[i] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + immed->Attrib[i] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); } } diff --git a/src/mesa/tnl/t_imm_elt.c b/src/mesa/tnl/t_imm_elt.c index fdecef61af..9157ca4871 100644 --- a/src/mesa/tnl/t_imm_elt.c +++ b/src/mesa/tnl/t_imm_elt.c @@ -619,7 +619,7 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM, ASSERT(IM->Attrib[VERT_ATTRIB_POS]); for (attr = 1; attr < VERT_ATTRIB_MAX; attr++) { if ((translate & (1 << attr)) && !IM->Attrib[attr]) { - IM->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + IM->Attrib[attr] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!IM->Attrib[attr]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing2"); return; diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index 560e0c5933..69bbbffce8 100644 --- a/src/mesa/tnl/t_imm_eval.c +++ b/src/mesa/tnl/t_imm_eval.c @@ -507,7 +507,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) /* Allocate vertex attribute storage now */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { if ((req & (1 << attr)) && !store->Attrib[attr]) { - store->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + store->Attrib[attr] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!store->Attrib[attr]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "evaluator processing"); return; diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index a11fec80b7..7cfacd4c0d 100644 --- a/src/mesa/tnl/t_imm_fixup.c +++ b/src/mesa/tnl/t_imm_fixup.c @@ -155,7 +155,7 @@ copy_from_current( GLcontext *ctx, struct immediate *IM, for (attrib = 0, attribBit = 1; attrib < 16; attrib++, attribBit <<= 1) { if (copyMask & attribBit) { if (!IM->Attrib[attrib]) { - IM->Attrib[attrib] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + IM->Attrib[attrib] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!IM->Attrib[attrib]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing3"); return; @@ -229,7 +229,7 @@ _tnl_fixup_input( GLcontext *ctx, struct immediate *IM ) const GLuint attrBit = 1 << attr; if (fixup & attrBit) { if (!IM->Attrib[attr]) { - IM->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + IM->Attrib[attr] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!IM->Attrib[attr]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing"); return; @@ -409,7 +409,7 @@ _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next ) /* Allocate attribute arrays in the destination immediate struct */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { if ((copy & (1 << attr)) && !next->Attrib[attr]) { - next->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + next->Attrib[attr] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!next->Attrib[attr]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing"); return; @@ -546,7 +546,7 @@ _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM ) const GLuint attrBit = 1 << attr; if (fixup & attrBit) { if (!IM->Attrib[attr]) { - IM->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + IM->Attrib[attr] = (GLfloat (*)[4]) _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); if (!IM->Attrib[attr]) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing"); } diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 154c3d2961..ccbcba1f2a 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -69,7 +69,7 @@ static void import_color_material( GLcontext *ctx, GLuint count = VB->Count; if (!to->Ptr) { - to->Ptr = ALIGN_MALLOC( VB->Size * 4 * sizeof(GLfloat), 32 ); + to->Ptr = (GLubyte *) ALIGN_MALLOC( VB->Size * 4 * sizeof(GLfloat), 32 ); to->Type = GL_FLOAT; } @@ -248,7 +248,7 @@ static GLboolean run_validate_lighting( GLcontext *ctx, static void alloc_4chan( struct gl_client_array *a, GLuint sz ) { - a->Ptr = ALIGN_MALLOC( sz * sizeof(GLchan) * 4, 32 ); + a->Ptr = (GLubyte *) ALIGN_MALLOC( sz * sizeof(GLchan) * 4, 32 ); a->Size = 4; a->Type = CHAN_TYPE; a->Stride = 0; -- cgit v1.2.3