summaryrefslogtreecommitdiff
path: root/src/mesa/math
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-01-05 13:03:05 -0700
committerBrian Paul <brianp@vmware.com>2016-01-05 13:03:05 -0700
commitdce1e1a8eb871945f875c17d0e9b687a29835530 (patch)
tree79fc5a74c9d21198e2eae066e11bf5412d6c1baa /src/mesa/math
parent95d412181d1bc32fb94df92198e3fd0a4a368ac4 (diff)
mesa: minor clean-up of some memcpy/sizeof() calls in m_matrix.c
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Diffstat (limited to 'src/mesa/math')
-rw-r--r--src/mesa/math/m_matrix.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 6522200b345..b3cfcd26a14 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -654,7 +654,7 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat )
if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 )
return GL_FALSE;
- memcpy( out, Identity, 16 * sizeof(GLfloat) );
+ memcpy( out, Identity, sizeof(Identity) );
MAT(out,0,0) = 1.0F / MAT(in,0,0);
MAT(out,1,1) = 1.0F / MAT(in,1,1);
MAT(out,2,2) = 1.0F / MAT(in,2,2);
@@ -687,7 +687,7 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat )
if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0)
return GL_FALSE;
- memcpy( out, Identity, 16 * sizeof(GLfloat) );
+ memcpy( out, Identity, sizeof(Identity) );
MAT(out,0,0) = 1.0F / MAT(in,0,0);
MAT(out,1,1) = 1.0F / MAT(in,1,1);
@@ -709,7 +709,7 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat )
if (MAT(in,2,3) == 0)
return GL_FALSE;
- memcpy( out, Identity, 16 * sizeof(GLfloat) );
+ memcpy( out, Identity, sizeof(Identity) );
MAT(out,0,0) = 1.0F / MAT(in,0,0);
MAT(out,1,1) = 1.0F / MAT(in,1,1);
@@ -802,7 +802,7 @@ _math_matrix_rotate( GLmatrix *mat,
s = sinf( angle * M_PI / 180.0 );
c = cosf( angle * M_PI / 180.0 );
- memcpy(m, Identity, sizeof(GLfloat)*16);
+ memcpy(m, Identity, sizeof(Identity));
optimized = GL_FALSE;
#define M(row,col) m[col*4+row]
@@ -1136,8 +1136,8 @@ _math_matrix_viewport(GLmatrix *m, const float scale[3],
void
_math_matrix_set_identity( GLmatrix *mat )
{
- memcpy( mat->m, Identity, 16*sizeof(GLfloat) );
- memcpy( mat->inv, Identity, 16*sizeof(GLfloat) );
+ memcpy( mat->m, Identity, sizeof(Identity) );
+ memcpy( mat->inv, Identity, sizeof(Identity) );
mat->type = MATRIX_IDENTITY;
mat->flags &= ~(MAT_DIRTY_FLAGS|
@@ -1437,7 +1437,7 @@ _math_matrix_is_dirty( const GLmatrix *m )
void
_math_matrix_copy( GLmatrix *to, const GLmatrix *from )
{
- memcpy( to->m, from->m, sizeof(Identity) );
+ memcpy(to->m, from->m, 16 * sizeof(GLfloat));
memcpy(to->inv, from->inv, 16 * sizeof(GLfloat));
to->flags = from->flags;
to->type = from->type;