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 <cedric@osg.samsung.com>
This commit is contained in:
Oleksandr Shcherbina 2015-05-13 15:32:10 +02:00 committed by Cedric BAIL
parent f6a39ab571
commit fc4f755c28
1 changed files with 12 additions and 19 deletions

View File

@ -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_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_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 */