summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-12-06 15:41:43 +0000
committerBrian Paul <[email protected]>2005-12-06 15:41:43 +0000
commit9580179dfb42d5b81ff6ec9704b82a556c7f1229 (patch)
treeae2a55aa82c4efc43ae832abcf316e1773c228bb /src/mesa/tnl
parentd5179613d5302173471a6a910fa9ec235c9ff046 (diff)
C++ fixes, mostly casts (Stephane Conversy)
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_context.c6
-rw-r--r--src/mesa/tnl/t_context.h2
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c8
-rw-r--r--src/mesa/tnl/t_vertex.c5
-rw-r--r--src/mesa/tnl/t_vp_build.c8
5 files changed, 15 insertions, 14 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 30b2947323a..d9777bfe6d7 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -87,11 +87,11 @@ _tnl_CreateContext( GLcontext *ctx )
_tnl_vtx_init( ctx );
if (ctx->_MaintainTnlProgram) {
- tnl->vp_cache = MALLOC(sizeof(*tnl->vp_cache));
+ tnl->vp_cache = (struct tnl_cache *) MALLOC(sizeof(*tnl->vp_cache));
tnl->vp_cache->size = 5;
tnl->vp_cache->n_items = 0;
- tnl->vp_cache->items = MALLOC(tnl->vp_cache->size *
- sizeof(*tnl->vp_cache->items));
+ tnl->vp_cache->items = (struct tnl_cache_item**)
+ _mesa_malloc(tnl->vp_cache->size * sizeof(*tnl->vp_cache->items));
_mesa_memset(tnl->vp_cache->items, 0, tnl->vp_cache->size *
sizeof(*tnl->vp_cache->items));
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index da225b518eb..753f59257a0 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -563,7 +563,7 @@ struct tnl_clipspace_fastpath {
GLuint attr_count;
GLboolean match_strides;
- struct {
+ struct attr_type {
GLuint format;
GLuint size;
GLuint stride;
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 4aa2e80d552..38182c1ba1c 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -582,11 +582,11 @@ static void print_RSW( union instruction op )
static void print_ALU( union instruction op )
{
- _mesa_printf("%s ", _mesa_opcode_string(op.alu.opcode));
+ _mesa_printf("%s ", _mesa_opcode_string((enum prog_opcode) op.alu.opcode));
print_reg(0, op.alu.dst);
_mesa_printf(", ");
print_reg(op.alu.file0, op.alu.idx0);
- if (_mesa_num_inst_src_regs(op.alu.opcode) > 1) {
+ if (_mesa_num_inst_src_regs((enum prog_opcode) op.alu.opcode) > 1) {
_mesa_printf(", ");
print_reg(op.alu.file1, op.alu.idx1);
}
@@ -1082,7 +1082,7 @@ static void cvp_emit_inst( struct compilation *cp,
static void free_tnl_data( struct vertex_program *program )
{
- struct tnl_compiled_program *p = program->TnlData;
+ struct tnl_compiled_program *p = (struct tnl_compiled_program *) program->TnlData;
if (p->compiled_func)
_mesa_free((void *)p->compiled_func);
_mesa_free(p);
@@ -1460,7 +1460,7 @@ static GLboolean init_vertex_program( GLcontext *ctx,
*/
m->VB = VB;
- m->File[0] = ALIGN_MALLOC(REG_MAX * sizeof(GLfloat) * 4, 16);
+ m->File[0] = (GLfloat(*)[4])ALIGN_MALLOC(REG_MAX * sizeof(GLfloat) * 4, 16);
/* Initialize regs where necessary:
*/
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index ca3aad14046..b532a20142c 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -87,7 +87,8 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx,
fastpath->attr_count = vtx->attr_count;
fastpath->match_strides = match_strides;
fastpath->func = vtx->emit;
- fastpath->attr = MALLOC(vtx->attr_count * sizeof(fastpath->attr[0]));
+ fastpath->attr = (struct attr_type *)
+ _mesa_malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
for (i = 0; i < vtx->attr_count; i++) {
fastpath->attr[i].format = vtx->attr[i].format;
@@ -425,7 +426,7 @@ void *_tnl_emit_vertices_to_buffer( GLcontext *ctx,
/* Note: dest should not be adjusted for non-zero 'start' values:
*/
- vtx->emit( ctx, end - start, dest );
+ vtx->emit( ctx, end - start, (GLubyte*) dest );
return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
}
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index 77e105115c8..7e28bbbc3c8 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -514,7 +514,7 @@ static void emit_op3fn(struct tnl_program *p,
return;
}
- inst->Opcode = op;
+ inst->Opcode = (enum prog_opcode) op;
inst->StringPos = 0;
inst->Data = 0;
@@ -1406,7 +1406,7 @@ create_new_program( const struct state_key *key,
p.temp_reserved = ~((1<<max_temps)-1);
p.program->Base.Instructions
- = MALLOC(sizeof(struct prog_instruction) * MAX_INSN);
+ = (struct prog_instruction*) MALLOC(sizeof(struct prog_instruction) * MAX_INSN);
p.program->Base.String = 0;
p.program->Base.NumInstructions =
p.program->Base.NumTemporaries =
@@ -1441,7 +1441,7 @@ static void rehash( struct tnl_cache *cache )
GLuint size, i;
size = cache->size * 3;
- items = MALLOC(size * sizeof(*items));
+ items = (struct tnl_cache_item**) _mesa_malloc(size * sizeof(*items));
_mesa_memset(items, 0, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
@@ -1461,7 +1461,7 @@ static void cache_item( struct tnl_cache *cache,
void *key,
void *data )
{
- struct tnl_cache_item *c = MALLOC(sizeof(*c));
+ struct tnl_cache_item *c = (struct tnl_cache_item*) _mesa_malloc(sizeof(*c));
c->hash = hash;
c->key = key;
c->data = data;