diff options
author | Brian Paul <[email protected]> | 2003-09-19 15:38:15 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-09-19 15:38:15 +0000 |
commit | e4fcea2e06571b71a85b4f100c95d866a82f7c19 (patch) | |
tree | df95d1d9eed897c1dd2fee2923163843ddca3228 /src/mesa/main | |
parent | 74c33393b4ebcc1616c0d8f1b6f43d658aed3f22 (diff) |
Assorted casts to silence g++ warnings.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/arbprogram.c | 6 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.c | 2 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 16 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 2 | ||||
-rw-r--r-- | src/mesa/main/program.c | 9 |
5 files changed, 19 insertions, 16 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index b4ebe01399f..8ebae9d7da7 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 3ae35d5b4d5..e47065415db 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 3a241448d0d..6efe5405dc3 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 6f5f715fc1f..fb67683a396 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 8cc5f6885a4..fa5f301e2af 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; |