cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fc4f755c28ef70709a38a910edb750e11c0ddd9f

commit fc4f755c28ef70709a38a910edb750e11c0ddd9f
Author: Oleksandr Shcherbina <o.shcherb...@samsung.com>
Date:   Wed May 13 15:32:10 2015 +0200

    evas: fix coverity CID 1297159 and CID 1297158.
    
    Reviewers: Hermet, b.devichev, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2494
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/evas/include/evas_3d_utils.h | 33 +++++++++++++--------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/src/lib/evas/include/evas_3d_utils.h 
b/src/lib/evas/include/evas_3d_utils.h
index 87bf708..828348d 100644
--- a/src/lib/evas/include/evas_3d_utils.h
+++ b/src/lib/evas/include/evas_3d_utils.h
@@ -1151,33 +1151,26 @@ evas_mat3_invserse(Evas_Mat3 *out, const Evas_Mat3 *mat)
 }
 
 static inline void
-evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x, const 
Evas_Real p_y)
-{
-   Evas_Real        *d = &out->m[0];
-   memset(d, 0x00, sizeof(Evas_Mat3));
-   d[0] = 1;
-   d[2] = p_x;
-   d[4] = 1;
-   d[5] = p_y;
-   d[8] = 1;
-   if (p_x || p_y)
+evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x,
+                                                                const 
Evas_Real p_y)
+{
+   evas_mat3_identity_set(out);
+   out->m[2] = p_x;
+   out->m[5] = p_y;
+   if ((fabs(p_x) > FLT_EPSILON) ||
+       (fabs(p_y) > FLT_EPSILON))
      out->flags = 0;
-   else
-     out->flags = EVAS_MATRIX_IS_IDENTITY;
 }
 
 static inline void
 evas_mat3_set_scale_transform(Evas_Mat3 *out, Evas_Real s_x, Evas_Real s_y)
 {
-   Evas_Real        *d = &out->m[0];
-   memset(d, 0x00, sizeof(Evas_Mat3));
-   d[0] = s_x;
-   d[4] = s_y;
-   d[8] = 1;
-   if (s_x != 1.0 || s_y != 1.0)
+   evas_mat3_identity_set(out);
+   out->m[0] = s_x;
+   out->m[4] = s_y;
+   if ((fabs(s_x - 1.0) > FLT_EPSILON) ||
+       (fabs(s_y - 1.0) > FLT_EPSILON))
      out->flags = 0;
-   else
-     out->flags = EVAS_MATRIX_IS_IDENTITY;
 }
 
 /* 2x2 matrix */

-- 


Reply via email to