aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-06 08:48:23 +0200
committermarha <marha@users.sourceforge.net>2012-09-06 08:48:23 +0200
commitaa10a08696cae93799fcddae3f0245ceee905e01 (patch)
tree950730c362229584b5e60fc1fe309325b7ba66b1 /mesalib/src/mesa/vbo
parentaf1e359cc622a0c53d5632fb03ef9bd4c17de897 (diff)
downloadvcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.tar.gz
vcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.tar.bz2
vcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.zip
xserver mesa git update 6 sep 2012
Diffstat (limited to 'mesalib/src/mesa/vbo')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c2
-rw-r--r--mesalib/src/mesa/vbo/vbo_primitive_restart.c6
-rw-r--r--mesalib/src/mesa/vbo/vbo_rebase.c10
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c6
4 files changed, 9 insertions, 15 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index 781e360d2..ded711b9f 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -1179,7 +1179,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
ctx->Shared->NullBufferObj);
ASSERT(!exec->vtx.buffer_map);
- exec->vtx.buffer_map = (GLfloat *)_mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64);
+ exec->vtx.buffer_map = _mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
vbo_exec_vtxfmt_init( exec );
diff --git a/mesalib/src/mesa/vbo/vbo_primitive_restart.c b/mesalib/src/mesa/vbo/vbo_primitive_restart.c
index 18d851c1e..6f9d61c9b 100644
--- a/mesalib/src/mesa/vbo/vbo_primitive_restart.c
+++ b/mesalib/src/mesa/vbo/vbo_primitive_restart.c
@@ -86,7 +86,7 @@ find_sub_primitives(const void *elements, unsigned element_size,
GLuint scan_index;
unsigned scan_num;
- sub_prims = (struct sub_primitive *)
+ sub_prims =
malloc(max_prims * sizeof(struct sub_primitive));
if (!sub_prims) {
@@ -226,8 +226,6 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
}
}
- if (sub_prims) {
- free(sub_prims);
- }
+ free(sub_prims);
}
diff --git a/mesalib/src/mesa/vbo/vbo_rebase.c b/mesalib/src/mesa/vbo/vbo_rebase.c
index fff9df0c2..d0bf6c59d 100644
--- a/mesalib/src/mesa/vbo/vbo_rebase.c
+++ b/mesalib/src/mesa/vbo/vbo_rebase.c
@@ -146,7 +146,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
/* If we can just tell the hardware or the TNL to interpret our
* indices with a different base, do so.
*/
- tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims);
+ tmp_prims = malloc(sizeof(*prim) * nr_prims);
for (i = 0; i < nr_prims; i++) {
tmp_prims[i] = prim[i];
@@ -195,7 +195,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
else {
/* Otherwise the primitives need adjustment.
*/
- tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims);
+ tmp_prims = malloc(sizeof(*prim) * nr_prims);
for (i = 0; i < nr_prims; i++) {
/* If this fails, it could indicate an application error:
@@ -242,11 +242,9 @@ void vbo_rebase_prims( struct gl_context *ctx,
ctx->Array._DrawArrays = saved_arrays;
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
- if (tmp_indices)
- free(tmp_indices);
+ free(tmp_indices);
- if (tmp_prims)
- free(tmp_prims);
+ free(tmp_prims);
}
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index 636aa1fdb..f7936610c 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -1577,10 +1577,8 @@ vbo_destroy_vertex_list(struct gl_context *ctx, void *data)
if (--node->prim_store->refcount == 0)
free(node->prim_store);
- if (node->current_data) {
- free(node->current_data);
- node->current_data = NULL;
- }
+ free(node->current_data);
+ node->current_data = NULL;
}