summaryrefslogtreecommitdiffstats
path: root/src/mesa/math
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2012-09-03 19:44:00 -0700
committerMatt Turner <[email protected]>2012-09-05 22:28:50 -0700
commit2b7a972e3f36bfcdc6fbe2b59d7ffdcde49c9405 (patch)
tree4b9504b4799e9d29363690fb9083ac4bbcf78d51 /src/mesa/math
parent812931f602ff913a51a608a9b1b6826b7f2bfae0 (diff)
Don't cast the return value of malloc/realloc
This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
Diffstat (limited to 'src/mesa/math')
-rw-r--r--src/mesa/math/m_debug_norm.c2
-rw-r--r--src/mesa/math/m_debug_xform.c2
-rw-r--r--src/mesa/math/m_matrix.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c
index dc768f30642..00efa336d43 100644
--- a/src/mesa/math/m_debug_norm.c
+++ b/src/mesa/math/m_debug_norm.c
@@ -208,7 +208,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
(void) cycles;
- mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
+ mat->m = _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
mat->inv = m = mat->m;
init_matrix( m );
diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c
index 7d815664a14..2cceaa2f86e 100644
--- a/src/mesa/math/m_debug_xform.c
+++ b/src/mesa/math/m_debug_xform.c
@@ -183,7 +183,7 @@ static int test_transform_function( transform_func func, int psize,
return 0;
}
- mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
+ mat->m = _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
mat->type = mtypes[mtype];
m = mat->m;
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index b9f22d796b7..bcd2cae4a50 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1468,10 +1468,10 @@ _math_matrix_loadf( GLmatrix *mat, const GLfloat *m )
void
_math_matrix_ctr( GLmatrix *m )
{
- m->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
+ m->m = _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
if (m->m)
memcpy( m->m, Identity, sizeof(Identity) );
- m->inv = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
+ m->inv = _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
if (m->inv)
memcpy( m->inv, Identity, sizeof(Identity) );
m->type = MATRIX_IDENTITY;