return buf;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- if (EINA_DBL_CMP(param->info.d.def, EDJE_EXTERNAL_DOUBLE_UNSET)) return NULL;
+ if (EINA_DBL_EQ(param->info.d.def, EDJE_EXTERNAL_DOUBLE_UNSET)) return NULL;
snprintf(buf, buflen, "%g", param->info.d.def);
return buf;
break;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- if (EINA_DBL_CMP(param->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET))
+ if (EINA_DBL_EQ(param->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET))
{
if (machine) printf("MIN: %g\n", param->info.d.min);
else printf(", min: %g", param->info.d.min);
}
- if (EINA_DBL_CMP(param->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET))
+ if (EINA_DBL_EQ(param->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET))
{
if (machine) printf("MAX: %g\n", param->info.d.max);
else printf(", max: %g", param->info.d.max);
}
- if (EINA_DBL_CMP(param->info.d.step, EDJE_EXTERNAL_DOUBLE_UNSET))
+ if (EINA_DBL_EQ(param->info.d.step, EDJE_EXTERNAL_DOUBLE_UNSET))
{
if (machine) printf("STEP: %g\n", param->info.d.step);
else printf(", step: %g", param->info.d.step);
_parse_style_attr(node, key, value);
}
- if (!EINA_DBL_CMP(rect->rx, 0) && EINA_DBL_CMP(rect->ry, 0)) rect->ry = rect->rx;
- if (!EINA_DBL_CMP(rect->ry, 0) && EINA_DBL_CMP(rect->rx, 0)) rect->rx = rect->ry;
+ if (!EINA_DBL_EQ(rect->rx, 0) && EINA_DBL_EQ(rect->ry, 0)) rect->ry = rect->rx;
+ if (!EINA_DBL_EQ(rect->ry, 0) && EINA_DBL_EQ(rect->rx, 0)) rect->rx = rect->ry;
return EINA_TRUE;
}
double val = 0.0;
val = elm_spinner_value_get(obj);
- if (EINA_DBL_CMP(val, 1.0))
+ if (EINA_DBL_EQ(val, 1.0))
elm_bg_color_set(o_bg, 255, 255, 255);
- else if (EINA_DBL_CMP(val, 2.0))
+ else if (EINA_DBL_EQ(val, 2.0))
elm_bg_color_set(o_bg, 255, 0, 0);
- else if (EINA_DBL_CMP(val, 3.0))
+ else if (EINA_DBL_EQ(val, 3.0))
elm_bg_color_set(o_bg, 0, 0, 255);
- else if (EINA_DBL_CMP(val, 4.0))
+ else if (EINA_DBL_EQ(val, 4.0))
elm_bg_color_set(o_bg, 0, 255, 0);
}
if (mx < 1) mx = 1; // quick hack to keep curl line visible
- if (EINA_DBL_CMP(mgrad, 0.0)) // special horizontal case
+ if (EINA_DBL_EQ(mgrad, 0.0)) // special horizontal case
mgrad = 0.001; // quick dirty hack for now
// else
{
_shared_string_get(fd->path), _shared_string_get(fd->key));
printf("LoadOpts: Region: %d,%d-%dx%d\n",
fd->lo.region.x, fd->lo.region.y, fd->lo.region.w, fd->lo.region.h);
- if (!EINA_DBL_CMP(fd->lo.dpi, 0))
+ if (!EINA_DBL_EQ(fd->lo.dpi, 0))
printf(" DPI: %f\n");
else
printf(" DPI: 0\n");
printf(" height %d\n", id->opts.emile.h);
printf(" degree %d\n", id->opts.emile.degree);
printf(" scale_down_by %d\n", id->opts.emile.scale_down_by);
- if (!EINA_DBL_CMP(id->opts.emile.dpi, 0.0))
+ if (!EINA_DBL_EQ(id->opts.emile.dpi, 0.0))
printf(" dpi %.2f\n", id->opts.emile.dpi);
else
printf(" dpi 0\n");
#include <float.h>
-#define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON)
+#define EINA_FLT_EQ(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON)
#define RS R_VAL(src + s_idx)
#define GS G_VAL(src + s_idx)
l = *lightness;
s = *saturation;
- if (EINA_FLT_CMP(s, 0))
+ if (EINA_FLT_EQ(s, 0))
{
/* achromatic case */
*hue = l;
else
s = 0;
- if (EINA_FLT_CMP(s, 0))
+ if (EINA_FLT_EQ(s, 0))
h = 0;
else
{
d = fmod(t0, ft);
if (tick)
{
- if (!EINA_FLT_CMP(pframetime, ft))
+ if (!EINA_FLT_EQ(pframetime, ft))
{
t = (ft - d) * 1000000000.0;
t_ft = ft * 1000000000.0;
for (int i = 0; i < LIMIT; i++)
{
current_slope = _cubic_bezier_slope_get(guess_t, x1, x2);
- if (EINA_FLT_CMP(current_slope, 0.0)) return guess_t;
+ if (EINA_FLT_EQ(current_slope, 0.0)) return guess_t;
current_x = _cubic_bezier_calc(guess_t, x1, x2) - a;
change = current_x / current_slope;
guess_t -= change;
double x2,
double y2)
{
- if (EINA_FLT_CMP(x1, y1) &&
- EINA_FLT_CMP(x2, y2))
+ if (EINA_FLT_EQ(x1, y1) &&
+ EINA_FLT_EQ(x2, y2))
return pos;
return _cubic_bezier_calc(_cubic_bezier_t_get(pos, x1, x2), y1, y2);
}
{
EINA_MAIN_LOOP_CHECK_RETURN;
if (frametime < 0.0) frametime = 0.0;
- if (EINA_FLT_CMP(animators_frametime, frametime)) return ;
+ if (EINA_FLT_EQ(animators_frametime, frametime)) return ;
animators_frametime = frametime;
_end_tick();
if (_have_animators()) _begin_tick();
int max_fd, ret, err_no;
t = NULL;
- if ((!ECORE_FINITE(timeout)) || (EINA_FLT_CMP(timeout, 0.0))) /* finite() tests for NaN, too big, too small, and infinity. */
+ if ((!ECORE_FINITE(timeout)) || (EINA_FLT_EQ(timeout, 0.0))) /* finite() tests for NaN, too big, too small, and infinity. */
{
tv.tv_sec = 0;
tv.tv_usec = 0;
if (wait >= 0.0)
{
/* finite() tests for NaN, too big, too small, and infinity. */
- if ((!ECORE_FINITE(timeout)) || (EINA_FLT_CMP(timeout, 0.0)))
+ if ((!ECORE_FINITE(timeout)) || (EINA_FLT_EQ(timeout, 0.0)))
{
tv.tv_sec = 0;
tv.tv_usec = 0;
else
{
t = ecore_time_get();
- if (!EINA_FLT_CMP(interval, poll_cur_interval))
+ if (!EINA_FLT_EQ(interval, poll_cur_interval))
{
t -= last_tick; /* time since we last ticked */
/* delete the timer and reset it to tick off in the new
ret = eina_hash_find(_ecore_thread_global_hash, key);
LRWKU(_ecore_thread_global_hash_lock);
if ((ret) ||
- (!EINA_FLT_CMP(seconds, 0.0)) ||
+ (!EINA_FLT_EQ(seconds, 0.0)) ||
((seconds > 0) && (tm <= ecore_time_get())))
break;
LKL(_ecore_thread_global_hash_mutex);
tim = ecore_time_get();
rtime += t;
frames++;
- if (EINA_DBL_CMP(rlapse, 0.0))
+ if (EINA_DBL_EQ(rlapse, 0.0))
{
rlapse = tim;
flapse = frames;
{
int fx, fy, fw, fh;
- if ((EINA_DBL_CMP(mx, 0.0)) &&
- (EINA_DBL_CMP(my, 0.0)))
+ if ((EINA_DBL_EQ(mx, 0.0)) &&
+ (EINA_DBL_EQ(my, 0.0)))
{
mx = x;
my = y;
ecore_fb_input_device_threshold_click_set(Ecore_Fb_Input_Device *dev, double threshold)
{
if (!dev) return;
- if ((EINA_DBL_CMP(threshold, dev->mouse.threshold)) ||
- (EINA_DBL_CMP(threshold, 0.0))) return;
+ if ((EINA_DBL_EQ(threshold, dev->mouse.threshold)) ||
+ (EINA_DBL_EQ(threshold, 0.0))) return;
dev->mouse.threshold = threshold;
}
//if up event not occurs from under layers of ecore
//up event is generated by ecore
if (_last_events_enable &&
- !EINA_DBL_CMP(_last_events_timeout, 0))
+ !EINA_DBL_EQ(_last_events_timeout, 0))
{
if (eel->timer) ecore_timer_del(eel->timer);
eel->timer = NULL;
pd->linear.l = pd->linear.dx * pd->linear.dx + pd->linear.dy * pd->linear.dy;
pd->linear.off = 0;
- if (!EINA_DBL_CMP(pd->linear.l, 0.0))
+ if (!EINA_DBL_EQ(pd->linear.l, 0.0))
{
pd->linear.dx /= pd->linear.l;
pd->linear.dy /= pd->linear.l;
pd->radial.cy = pd->grd->radial.y;
pd->radial.cradius = pd->grd->radius;
- if (EINA_DBL_CMP(pd->grd->focal.x, 0.0))
+ if (EINA_DBL_EQ(pd->grd->focal.x, 0.0))
pd->radial.fx = pd->grd->radial.x;
else
pd->radial.fx = pd->grd->focal.x;
- if (EINA_DBL_CMP(pd->grd->focal.y, 0.0))
+ if (EINA_DBL_EQ(pd->grd->focal.y, 0.0))
pd->radial.fy = pd->grd->radial.y;
else
pd->radial.fy = pd->grd->focal.y;
uint32_t *end;
int t_fixed, inc_fixed;
- if (EINA_DBL_CMP(g_data->linear.l, 0.0))
+ if (EINA_DBL_EQ(g_data->linear.l, 0.0))
{
t = inc = 0;
}
root = evas_vg_container_add(NULL);
efl_vg_dup(root, vector->vg);
- if (!EINA_DBL_CMP(vector->w, 0) &&
- !EINA_DBL_CMP(vector->h, 0))
+ if (!EINA_DBL_EQ(vector->w, 0) &&
+ !EINA_DBL_EQ(vector->h, 0))
{
_apply_transformation(root, width, height, vector);
}
#define COS(a) cos(a)
#define SIN(a) sin(a)
#define PI 3.14159265358979323846
-#define EQ(a, b) EINA_DBL_CMP(a, b)
-#define NEQ(a, b) !EINA_DBL_CMP(a, b)
+#define EQ(a, b) EINA_DBL_EQ(a, b)
+#define NEQ(a, b) !EINA_DBL_EQ(a, b)
#endif
return EINA_TRUE;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
- if (!EINA_DBL_CMP(info->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET) &&
+ if (!EINA_DBL_EQ(info->info.d.min, EDJE_EXTERNAL_DOUBLE_UNSET) &&
(info->info.d.min > param->d))
return EINA_FALSE;
- if (!EINA_DBL_CMP(info->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET) &&
+ if (!EINA_DBL_EQ(info->info.d.max, EDJE_EXTERNAL_DOUBLE_UNSET) &&
(info->info.d.max < param->d))
return EINA_FALSE;
eina_strbuf_append(txt, "font_source=");
eina_strbuf_append(txt, fontsource);
}
- if (!EINA_DBL_CMP(tag->font_size, 0))
+ if (!EINA_DBL_EQ(tag->font_size, 0))
{
char font_size[32];
EAPI void
edje_password_show_last_timeout_set(double password_show_last_timeout)
{
- if (EINA_DBL_CMP(_edje_password_show_last_timeout, password_show_last_timeout)) return;
+ if (EINA_DBL_EQ(_edje_password_show_last_timeout, password_show_last_timeout)) return;
_edje_password_show_last_timeout = password_show_last_timeout;
}
double radians, cos_angle, sin_angle, tc, ts, t;
if (angle < 0.00001) return 0;
- if (EINA_FLT_CMP(angle, 90.0)) return 1;
+ if (EINA_FLT_EQ(angle, 90.0)) return 1;
radians = (angle/180) * M_PI;
double angles[2] = { angle, angle + length };
Point *points[2];
- if (!EINA_FLT_CMP(w, 0.0) || !EINA_FLT_CMP(h, 0.0))
+ if (!EINA_FLT_EQ(w, 0.0) || !EINA_FLT_EQ(h, 0.0))
{
if (start_point)
{
else if (sweep_length < -360) sweep_length = -360;
// Special case fast paths
- if (EINA_FLT_CMP(start_angle, 0))
+ if (EINA_FLT_EQ(start_angle, 0))
{
- if (EINA_FLT_CMP(sweep_length, 360))
+ if (EINA_FLT_EQ(sweep_length, 360))
{
for (i = 11; i >= 0; --i)
curves[(*point_count)++] = points[i];
return points[12];
}
- else if (EINA_FLT_CMP(sweep_length, -360))
+ else if (EINA_FLT_EQ(sweep_length, -360))
{
for (i = 1; i <= 12; ++i)
curves[(*point_count)++] = points[i];
}
// avoid empty start segment
- if (EINA_FLT_CMP(start_t, 1.0))
+ if (EINA_FLT_EQ(start_t, 1.0))
{
start_t = 0;
start_segment += delta;
}
// avoid empty end segment
- if (EINA_FLT_CMP(end_t, 0.0))
+ if (EINA_FLT_EQ(end_t, 0.0))
{
end_t = 1;
end_segment -= delta;
points[j + 3].x, points[j + 3].y);
// empty arc?
- if (start_segment == end_segment && (EINA_FLT_CMP(start_t, end_t)))
+ if (start_segment == end_segment && (EINA_FLT_EQ(start_t, end_t)))
return start_point;
res = b;
distance = efreet_icon_size_distance(icon->icons[i], size);
if (distance > minimal_distance) continue;
// prefer downsizing
- if ((EINA_DBL_CMP(distance, minimal_distance)) &&
+ if ((EINA_DBL_EQ(distance, minimal_distance)) &&
(icon->icons[i]->normal < ret_size))
continue;
double biggest = 1.0;
double t = 1.0;
- if (l >= len)// || (EINA_DBL_CMP(len, l)))
+ if (l >= len)// || (EINA_DBL_EQ(len, l)))
return t;
t *= 0.5;
_eina_bezier_split_left(&right, t, &left);
ll = eina_bezier_length_get(&left);
- if (EINA_DBL_CMP(ll, l))
+ if (EINA_DBL_EQ(ll, l))
break;
if (ll < l)
Eina_Bezier bezier;
double t;
- if (EINA_DBL_CMP(t0, 0.0) &&
- EINA_DBL_CMP(t1, 1.0))
+ if (EINA_DBL_EQ(t0, 0.0) &&
+ EINA_DBL_EQ(t1, 1.0))
{
*result = *b;
return;
EAPI Eina_Matrix_Type
eina_matrix3_type_get(const Eina_Matrix3 *m)
{
- if (!EINA_DBL_CMP(MATRIX_ZX(m), 0.0) ||
- !EINA_DBL_CMP(MATRIX_ZY(m), 0.0) ||
- !EINA_DBL_CMP(MATRIX_ZZ(m), 1.0))
+ if (!EINA_DBL_EQ(MATRIX_ZX(m), 0.0) ||
+ !EINA_DBL_EQ(MATRIX_ZY(m), 0.0) ||
+ !EINA_DBL_EQ(MATRIX_ZZ(m), 1.0))
return EINA_MATRIX_TYPE_PROJECTIVE;
else
{
- if (EINA_DBL_CMP(MATRIX_XX(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_XY(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_XZ(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YX(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YY(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_YZ(m), 0.0))
+ if (EINA_DBL_EQ(MATRIX_XX(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_XY(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_XZ(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YX(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YY(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_YZ(m), 0.0))
return EINA_MATRIX_TYPE_IDENTITY;
else
return EINA_MATRIX_TYPE_AFFINE;
EAPI Eina_Matrix_Type
eina_matrix4_type_get(const Eina_Matrix4 *m)
{
- if (EINA_DBL_CMP(MATRIX_XX(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_XY(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_XZ(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_XW(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YX(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YY(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_YZ(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YW(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_ZX(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_ZY(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_ZZ(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_ZW(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_WX(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_WY(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_WZ(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_WW(m), 1.0))
+ if (EINA_DBL_EQ(MATRIX_XX(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_XY(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_XZ(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_XW(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YX(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YY(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_YZ(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YW(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_ZX(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_ZY(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_ZZ(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_ZW(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_WX(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_WY(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_WZ(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_WW(m), 1.0))
return EINA_MATRIX_TYPE_IDENTITY;
return EINA_MATRIX_TYPE_AFFINE;
}
{
double xrr, yrr;
- if (!EINA_DBL_CMP(MATRIX_ZX(m), 0.0) &&
- !EINA_DBL_CMP(MATRIX_ZY(m), 0.0))
+ if (!EINA_DBL_EQ(MATRIX_ZX(m), 0.0) &&
+ !EINA_DBL_EQ(MATRIX_ZY(m), 0.0))
{
xrr = (x * MATRIX_XX(m) + y * MATRIX_XY(m) + MATRIX_XZ(m));
yrr = (x * MATRIX_YX(m) + y * MATRIX_YY(m) + MATRIX_YZ(m));
/* determinant */
scalar = eina_matrix3_determinant(m);
- if (EINA_DBL_CMP(scalar, 0.0))
+ if (EINA_DBL_EQ(scalar, 0.0))
{
eina_matrix3_identity(m2);
return;
EAPI Eina_Bool
eina_matrix3_equal(const Eina_Matrix3 *m1, const Eina_Matrix3 *m2)
{
- if (!EINA_DBL_CMP(m1->xx, m2->xx) ||
- !EINA_DBL_CMP(m1->xy, m2->xy) ||
- !EINA_DBL_CMP(m1->xz, m2->xz) ||
- !EINA_DBL_CMP(m1->yx, m2->yx) ||
- !EINA_DBL_CMP(m1->yy, m2->yy) ||
- !EINA_DBL_CMP(m1->yz, m2->yz) ||
- !EINA_DBL_CMP(m1->zx, m2->zx) ||
- !EINA_DBL_CMP(m1->zy, m2->zy) ||
- !EINA_DBL_CMP(m1->zz, m2->zz))
+ if (!EINA_DBL_EQ(m1->xx, m2->xx) ||
+ !EINA_DBL_EQ(m1->xy, m2->xy) ||
+ !EINA_DBL_EQ(m1->xz, m2->xz) ||
+ !EINA_DBL_EQ(m1->yx, m2->yx) ||
+ !EINA_DBL_EQ(m1->yy, m2->yy) ||
+ !EINA_DBL_EQ(m1->yz, m2->yz) ||
+ !EINA_DBL_EQ(m1->zx, m2->zx) ||
+ !EINA_DBL_EQ(m1->zy, m2->zy) ||
+ !EINA_DBL_EQ(m1->zz, m2->zz))
return EINA_FALSE;
return EINA_TRUE;
}
double ey = QUAD_Y0(q) - QUAD_Y1(q) + QUAD_Y2(q) - QUAD_Y3(q);
/* paralellogram */
- if (EINA_DBL_CMP(ex, 0.0) && EINA_DBL_CMP(ey, 0.0))
+ if (EINA_DBL_EQ(ex, 0.0) && EINA_DBL_EQ(ey, 0.0))
{
/* create the affine matrix */
MATRIX_XX(m) = QUAD_X1(q) - QUAD_X0(q);
double dy2 = QUAD_Y3(q) - QUAD_Y2(q); // y3 - y2
double den = (dx1 * dy2) - (dx2 * dy1);
- if (EINA_DBL_CMP(den, 0.0))
+ if (EINA_DBL_EQ(den, 0.0))
return EINA_FALSE;
MATRIX_ZX(m) = ((ex * dy2) - (dx2 * ey)) / den;
eina_matrix3_inverse(&tmp, m);
/* make the projective matrix3 always have 1 on zz */
- if (!EINA_DBL_CMP(MATRIX_ZZ(m), 1.0))
+ if (!EINA_DBL_EQ(MATRIX_ZZ(m), 1.0))
{
eina_matrix3_divide(m, MATRIX_ZZ(m));
}
EAPI Eina_Matrix_Type
eina_matrix2_type_get(const Eina_Matrix2 *m)
{
- if (EINA_DBL_CMP(MATRIX_XX(m), 1.0) &&
- EINA_DBL_CMP(MATRIX_XY(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YX(m), 0.0) &&
- EINA_DBL_CMP(MATRIX_YY(m), 1.0))
+ if (EINA_DBL_EQ(MATRIX_XX(m), 1.0) &&
+ EINA_DBL_EQ(MATRIX_XY(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YX(m), 0.0) &&
+ EINA_DBL_EQ(MATRIX_YY(m), 1.0))
return EINA_MATRIX_TYPE_IDENTITY;
return EINA_MATRIX_TYPE_AFFINE;
}
det = MATRIX_XX(mat) * MATRIX_YY(mat) - MATRIX_YX(mat) * MATRIX_XY(mat);
- if (EINA_DBL_CMP(det, 0.0))
+ if (EINA_DBL_EQ(det, 0.0))
return;
det = 1.0 / det;
const Eina_Quaternion *b,
double pos)
{
- if (EINA_DBL_CMP(pos, 0.0))
+ if (EINA_DBL_EQ(pos, 0.0))
{
*out = *a;
return ;
}
- else if (EINA_DBL_CMP(pos, 1.0))
+ else if (EINA_DBL_EQ(pos, 1.0))
{
*out = *b;
return ;
double dot;
double pos1, pos2;
- if (EINA_DBL_CMP(pos, 0.0))
+ if (EINA_DBL_EQ(pos, 0.0))
{
*out = *a;
return ;
}
- else if (EINA_DBL_CMP(pos, 1.0))
+ else if (EINA_DBL_EQ(pos, 1.0))
{
*out = *b;
return ;
Eina_Quaternion not_normalize;
double dot;
- if (EINA_DBL_CMP(pos, 0.0))
+ if (EINA_DBL_EQ(pos, 0.0))
{
*out = *a;
return ;
}
- else if (EINA_DBL_CMP(pos, 1.0))
+ else if (EINA_DBL_EQ(pos, 1.0))
{
*out = *b;
return ;
Eina_Matrix4 n, pm;
double det, factor;
- if (EINA_DBL_CMP(m->ww, 0.0)) return EINA_FALSE;
+ if (EINA_DBL_EQ(m->ww, 0.0)) return EINA_FALSE;
// Normalize the matrix.
factor = 1 / m->ww;
// apply skew
// rm is a identity 4x4 matrix initially
- if (!EINA_DBL_CMP(skew->z, 0.0))
+ if (!EINA_DBL_EQ(skew->z, 0.0))
{
Eina_Matrix4 cp;
tmp = cp;
}
- if (!EINA_DBL_CMP(skew->y, 0.0))
+ if (!EINA_DBL_EQ(skew->y, 0.0))
{
Eina_Matrix4 cp;
tmp = cp;
}
- if (!EINA_DBL_CMP(skew->x, 0.0))
+ if (!EINA_DBL_EQ(skew->x, 0.0))
{
Eina_Matrix4 cp;
EAPI void
eina_quaternion_homogeneous_regulate(Eina_Quaternion *out, const Eina_Quaternion *v)
{
- if (!EINA_DBL_CMP(v->w, 0.0))
+ if (!EINA_DBL_EQ(v->w, 0.0))
{
double scale = 1.0 / v->w;
* @brief Safe comparison of float
* @param a First member to compar
* @param b Second member to compar
+ * @since 1.19
*
* @return @c true if two floats match
*/
-#define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON)
+#define EINA_FLT_EQ(a, b) (!!(fabsf((float)a - (float)b) <= FLT_EPSILON))
/**
* @brief Determine if a float is nonzero
* @brief Safe comparison of double
* @param a First member to compar
* @param b Second member to compar
+ * @since 1.19
*
* @return @c true if two double match
*/
-#define EINA_DBL_CMP(a, b) (fabs((double)a - (double)b) <= DBL_EPSILON)
+#define EINA_DBL_EQ(a, b) (!!(fabs((double)a - (double)b) <= DBL_EPSILON))
/**
* @brief Determine if a double is nonzero
if (extra < 0) extra = 0;
- if (EINA_DBL_CMP(weight[!horiz], 0))
+ if (EINA_DBL_EQ(weight[!horiz], 0))
{
if (box_fill[!horiz])
{
else if (align_y < 0.0)
align_y = 0.0;
- if ((EINA_DBL_CMP(align_x, sd->align_x)) && (EINA_DBL_CMP(align_y, sd->align_y))) return;
+ if ((EINA_DBL_EQ(align_x, sd->align_x)) && (EINA_DBL_EQ(align_y, sd->align_y))) return;
sd->align_x = align_x;
sd->align_y = align_y;
efl_gfx_size_hint_combined_min_get(obj, &mnw, &mnh);
fw = fh = EINA_FALSE;
- if (EINA_DBL_CMP(ax, -1)) {fw = 1; ax = 0.5; }
- if (EINA_DBL_CMP(ay, -1)) {fh = 1; ay = 0.5; }
+ if (EINA_DBL_EQ(ax, -1)) {fw = 1; ax = 0.5; }
+ if (EINA_DBL_EQ(ay, -1)) {fh = 1; ay = 0.5; }
if (rtl) ax = 1.0 - ax;
ww = mnw;
- if (!EINA_DBL_CMP(wx, 0))
+ if (!EINA_DBL_EQ(wx, 0))
{
if (ww <= w - linew) ww = w - linew;
else ww = w;
elm_object_disabled_set(sd->slider,
(!seekable) | elm_widget_disabled_get(data));
elm_slider_min_max_set(sd->slider, 0, length);
- if ((!EINA_DBL_CMP(elm_slider_value_get(sd->slider), pos)) &&
+ if ((!EINA_DBL_EQ(elm_slider_value_get(sd->slider), pos)) &&
(!sd->dragging))
elm_slider_value_set(sd->slider, pos);
}
ELM_PLAYER_DATA_GET(data, sd);
pos = elm_slider_value_get(sd->slider);
- if (!EINA_FLT_CMP(pos, elm_video_play_position_get(sd->video)))
+ if (!EINA_FLT_EQ(pos, elm_video_play_position_get(sd->video)))
elm_video_play_position_set(sd->video, pos);
}
ELM_PLAYER_DATA_GET(data, sd);
vol = elm_slider_value_get(sd->vslider) / 100.0;
- if (!EINA_DBL_CMP(vol, elm_video_audio_level_get(sd->video)))
+ if (!EINA_DBL_EQ(vol, elm_video_audio_level_get(sd->video)))
elm_video_audio_level_set(sd->video, vol);
}
elm_popup_align_get(obj, &horizontal, &vertical);
evas_object_geometry_get(sd->parent, NULL, NULL, &w, &h);
- if (EINA_DBL_CMP(horizontal, ELM_NOTIFY_ALIGN_FILL))
+ if (EINA_DBL_EQ(horizontal, ELM_NOTIFY_ALIGN_FILL))
minw = w;
- if (EINA_DBL_CMP(vertical, ELM_NOTIFY_ALIGN_FILL))
+ if (EINA_DBL_EQ(vertical, ELM_NOTIFY_ALIGN_FILL))
minh = h;
edje_object_size_min_restricted_calc(elm_layout_edje_get(sd->content_area),
&minw, &minh, minw, minh);
elm_notify_align_get(obj, &horizontal, &vertical);
- if ((EINA_DBL_CMP(horizontal, 0.5)) && (EINA_DBL_CMP(vertical, 0.0)))
+ if ((EINA_DBL_EQ(horizontal, 0.5)) && (EINA_DBL_EQ(vertical, 0.0)))
orient = ELM_NOTIFY_ORIENT_TOP;
- else if ((EINA_DBL_CMP(horizontal, 0.5)) && (EINA_DBL_CMP(vertical, 0.5)))
+ else if ((EINA_DBL_EQ(horizontal, 0.5)) && (EINA_DBL_EQ(vertical, 0.5)))
orient = ELM_NOTIFY_ORIENT_CENTER;
- else if ((EINA_DBL_CMP(horizontal, 0.5)) && (EINA_DBL_CMP(vertical, 1.0)))
+ else if ((EINA_DBL_EQ(horizontal, 0.5)) && (EINA_DBL_EQ(vertical, 1.0)))
orient = ELM_NOTIFY_ORIENT_BOTTOM;
- else if ((EINA_DBL_CMP(horizontal, 0.0)) && (EINA_DBL_CMP(vertical, 0.5)))
+ else if ((EINA_DBL_EQ(horizontal, 0.0)) && (EINA_DBL_EQ(vertical, 0.5)))
orient = ELM_NOTIFY_ORIENT_LEFT;
- else if ((EINA_DBL_CMP(horizontal, 1.0)) && (EINA_DBL_CMP(vertical, 0.5)))
+ else if ((EINA_DBL_EQ(horizontal, 1.0)) && (EINA_DBL_EQ(vertical, 0.5)))
orient = ELM_NOTIFY_ORIENT_RIGHT;
- else if ((EINA_DBL_CMP(horizontal, 0.0)) && (EINA_DBL_CMP(vertical, 0.0)))
+ else if ((EINA_DBL_EQ(horizontal, 0.0)) && (EINA_DBL_EQ(vertical, 0.0)))
orient = ELM_NOTIFY_ORIENT_TOP_LEFT;
- else if ((EINA_DBL_CMP(horizontal, 1.0)) && (EINA_DBL_CMP(vertical, 0.0)))
+ else if ((EINA_DBL_EQ(horizontal, 1.0)) && (EINA_DBL_EQ(vertical, 0.0)))
orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;
- else if ((EINA_DBL_CMP(horizontal, 0.0)) && (EINA_DBL_CMP(vertical, 1.0)))
+ else if ((EINA_DBL_EQ(horizontal, 0.0)) && (EINA_DBL_EQ(vertical, 1.0)))
orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;
- else if ((EINA_DBL_CMP(horizontal, 1.0)) && (EINA_DBL_CMP(vertical, 1.0)))
+ else if ((EINA_DBL_EQ(horizontal, 1.0)) && (EINA_DBL_EQ(vertical, 1.0)))
orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
else
orient = ELM_NOTIFY_ORIENT_TOP;
edje_object_part_drag_value_get
(wd->resize_obj, "elm.drag_button_base", &pos, NULL);
- if (EINA_DBL_CMP(pos, 0.0))
+ if (EINA_DBL_EQ(pos, 0.0))
efl_event_callback_legacy_call
(obj, ELM_ACTIONSLIDER_EVENT_POS_CHANGED, !elm_widget_mirrored_get(obj) ? "left" : "right");
- else if (EINA_DBL_CMP(pos, 1.0))
+ else if (EINA_DBL_EQ(pos, 1.0))
efl_event_callback_legacy_call
(obj, ELM_ACTIONSLIDER_EVENT_POS_CHANGED, !elm_widget_mirrored_get(obj) ? "right" : "left");
else if (pos >= 0.45 && pos <= 0.55)
adjusted_final = (!elm_widget_mirrored_get(obj)) ?
sd->final_position : 1.0 - sd->final_position;
- if ((EINA_DBL_CMP(adjusted_final, 0.0)) ||
- (EINA_DBL_CMP(adjusted_final, 0.5) && cur_position >= adjusted_final))
+ if ((EINA_DBL_EQ(adjusted_final, 0.0)) ||
+ (EINA_DBL_EQ(adjusted_final, 0.5) && cur_position >= adjusted_final))
{
new_position = cur_position - move_amount;
flag_finish_animation = EINA_TRUE;
}
}
- else if ((EINA_DBL_CMP(adjusted_final, 1.0)) ||
- (EINA_DBL_CMP(adjusted_final, 0.5) && cur_position < adjusted_final))
+ else if ((EINA_DBL_EQ(adjusted_final, 1.0)) ||
+ (EINA_DBL_EQ(adjusted_final, 0.5) && cur_position < adjusted_final))
{
new_position = cur_position + move_amount;
_text_get(obj, &left, &right, ¢er);
- if ((!EINA_DBL_CMP(sd->final_position, 0)) &&
+ if ((!EINA_DBL_EQ(sd->final_position, 0)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_LEFT))
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_SELECTED, (char *)left);
- else if ((EINA_DBL_CMP(sd->final_position, 0.5)) &&
+ else if ((EINA_DBL_EQ(sd->final_position, 0.5)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_CENTER))
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_SELECTED, (char *)center);
- else if ((EINA_DBL_CMP(sd->final_position, 1)) &&
+ else if ((EINA_DBL_EQ(sd->final_position, 1)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_RIGHT))
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_SELECTED, (char *)right);
_text_get(obj, &left, &right, ¢er);
if ((sd->enabled_position & ELM_ACTIONSLIDER_LEFT) &&
- ((!elm_widget_mirrored_get(obj) && EINA_DBL_CMP(position, 0.0)) ||
- (elm_widget_mirrored_get(obj) && EINA_DBL_CMP(position, 1.0))))
+ ((!elm_widget_mirrored_get(obj) && EINA_DBL_EQ(position, 0.0)) ||
+ (elm_widget_mirrored_get(obj) && EINA_DBL_EQ(position, 1.0))))
{
sd->final_position = 0;
efl_event_callback_legacy_call
}
if ((sd->enabled_position & ELM_ACTIONSLIDER_RIGHT) &&
- ((!elm_widget_mirrored_get(obj) && EINA_DBL_CMP(position, 1)) ||
- (elm_widget_mirrored_get(obj) && EINA_DBL_CMP(position, 0))))
+ ((!elm_widget_mirrored_get(obj) && EINA_DBL_EQ(position, 1)) ||
+ (elm_widget_mirrored_get(obj) && EINA_DBL_EQ(position, 0))))
{
sd->final_position = 1;
efl_event_callback_legacy_call
if (!strcmp(emission, "elm,action,down,right"))
{
- if (EINA_DBL_CMP(sd->final_position, 0.0))
+ if (EINA_DBL_EQ(sd->final_position, 0.0))
{
if (sd->enabled_position & ELM_ACTIONSLIDER_CENTER)
{
sd->final_position = 1.0;
}
}
- else if (EINA_DBL_CMP(sd->final_position, 0.5) &&
+ else if (EINA_DBL_EQ(sd->final_position, 0.5) &&
(sd->enabled_position & ELM_ACTIONSLIDER_RIGHT))
{
efl_event_callback_legacy_call
}
else
{
- if (EINA_DBL_CMP(sd->final_position, 1.0))
+ if (EINA_DBL_EQ(sd->final_position, 1.0))
{
if (sd->enabled_position & ELM_ACTIONSLIDER_CENTER)
{
sd->final_position = 0.0;
}
}
- else if (EINA_DBL_CMP(sd->final_position, 0.5) &&
+ else if (EINA_DBL_EQ(sd->final_position, 0.5) &&
(sd->enabled_position & ELM_ACTIONSLIDER_LEFT))
{
efl_event_callback_legacy_call
_text_get(obj, &left, &right, ¢er);
- if ((EINA_DBL_CMP(sd->final_position, 0.0)) &&
+ if ((EINA_DBL_EQ(sd->final_position, 0.0)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_LEFT))
ret = left;
- if ((EINA_DBL_CMP(sd->final_position, 0.5)) &&
+ if ((EINA_DBL_EQ(sd->final_position, 0.5)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_CENTER))
ret = center;
- if ((EINA_DBL_CMP(sd->final_position, 1.0)) &&
+ if ((EINA_DBL_EQ(sd->final_position, 1.0)) &&
(sd->enabled_position & ELM_ACTIONSLIDER_RIGHT))
ret = right;
return;
}
- if (EINA_DBL_CMP(sd->ar_initial_timeout, t)) return;
+ if (EINA_DBL_EQ(sd->ar_initial_timeout, t)) return;
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
sd->ar_initial_timeout = t;
}
return;
}
- if (EINA_DBL_CMP(sd->ar_gap_timeout, t)) return;
+ if (EINA_DBL_EQ(sd->ar_gap_timeout, t)) return;
sd->ar_gap_timeout = t;
if ((sd->repeating) && (sd->timer)) ecore_timer_interval_set(sd->timer, t);
_drag_anim_start(st);
else
{
- if (!EINA_DBL_CMP(st->anim_tm, 0.0))
+ if (!EINA_DBL_EQ(st->anim_tm, 0.0))
{
// even if we don't manage the icons animation, we have
// to wait until it is finished before beginning drag.
}
fclose(f);
- if (!EINA_DBL_CMP(dump.distance, 0)) r->info.distance = dump.distance;
+ if (!EINA_DBL_EQ(dump.distance, 0)) r->info.distance = dump.distance;
if (dump.description)
{
eina_stringshare_replace(&r->info.waypoints, dump.description);
left = elm_layout_content_get(obj, "left");
right = elm_layout_content_get(obj, "right");
- if (((sd->orientation == EFL_ORIENT_HORIZONTAL) && (EINA_DBL_CMP(h, 0.0))) ||
- ((sd->orientation == EFL_ORIENT_VERTICAL) && (EINA_DBL_CMP(w, 0.0))))
+ if (((sd->orientation == EFL_ORIENT_HORIZONTAL) && (EINA_DBL_EQ(h, 0.0))) ||
+ ((sd->orientation == EFL_ORIENT_VERTICAL) && (EINA_DBL_EQ(w, 0.0))))
{
return elm_widget_focus_next_get(right, dir, next, next_item);
}
Eina_Bool an = EINA_FALSE;
if (zoom <= (1.0 / 256.0)) zoom = (1.0 / 256.0);
- if (EINA_DBL_CMP(zoom, sd->zoom)) return;
+ if (EINA_DBL_EQ(zoom, sd->zoom)) return;
sd->zoom = zoom;
sd->size.ow = sd->size.w;
z = (double)sd->size.imw / pw;
else
z = (double)sd->size.imh / ph;
- if (!EINA_DBL_CMP(z, sd->zoom))
+ if (!EINA_DBL_EQ(z, sd->zoom))
zoom_changed = 1;
sd->zoom = z;
sd->size.nw = pw;
}
else if ((sd->size.imw < rw) && (sd->size.imh < rh))
{
- if (!EINA_DBL_CMP(sd->zoom, 1)) zoom_changed = 1;
+ if (!EINA_DBL_EQ(sd->zoom, 1)) zoom_changed = 1;
sd->zoom = 1;
sd->size.nw = sd->size.imw;
sd->size.nh = sd->size.imh;
z = (double)sd->size.imw / pw;
else
z = (double)sd->size.imh / ph;
- if (EINA_DBL_CMP(z, sd->zoom))
+ if (EINA_DBL_EQ(z, sd->zoom))
zoom_changed = 1;
sd->zoom = z;
sd->size.nw = pw;
EOLIAN static void
_elm_progressbar_efl_ui_progress_progress_value_set(Eo *obj, Elm_Progressbar_Data *sd, double val)
{
- if (EINA_DBL_CMP(sd->val, val)) return;
+ if (EINA_DBL_EQ(sd->val, val)) return;
elm_progressbar_part_value_set(obj, "elm.cur.progressbar", val);
}
cur_weight += ((f_x - c_x) - x) * ((f_x - c_x) - x);
if ((f_y - c_y) > y)
cur_weight += ((f_y - c_y) - y) * ((f_y - c_y) - y);
- if (EINA_DBL_CMP(cur_weight, 0.0))
+ if (EINA_DBL_EQ(cur_weight, 0.0))
{
elm_widget_focus_steal(cur, NULL);
eina_list_free(can_focus_list);
ethumb_client_orientation_set(_elm_ethumb_client, sd->thumb.orient);
if (sd->thumb.tw && sd->thumb.th)
ethumb_client_size_set(_elm_ethumb_client, sd->thumb.tw, sd->thumb.th);
- if (!EINA_DBL_CMP(sd->thumb.cropx, 0) && !EINA_DBL_CMP(sd->thumb.cropy, 0))
+ if (!EINA_DBL_EQ(sd->thumb.cropx, 0) && !EINA_DBL_EQ(sd->thumb.cropy, 0))
ethumb_client_crop_align_set(_elm_ethumb_client, sd->thumb.cropx, sd->thumb.cropy);
if (sd->thumb.quality)
ethumb_client_quality_set(_elm_ethumb_client, sd->thumb.quality);
if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
f = EMBRYO_CELL_TO_FLOAT(params[1]);
ff = EMBRYO_CELL_TO_FLOAT(params[2]);
- if (EINA_FLT_CMP(ff, 0.0))
+ if (EINA_FLT_EQ(ff, 0.0))
{
- if (EINA_FLT_CMP(f, 0.0))
+ if (EINA_FLT_EQ(f, 0.0))
return EMBRYO_FLOAT_TO_CELL(0.0f);
else if (f < 0.0)
return EMBRYO_FLOAT_TO_CELL(-MAXFLOAT);
if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
f = EMBRYO_CELL_TO_FLOAT(params[1]);
ff = EMBRYO_CELL_TO_FLOAT(params[2]);
- if (EINA_FLT_CMP(f, ff)) return 0;
+ if (EINA_FLT_EQ(f, ff)) return 0;
else if (f > ff)
return 1;
return -1;
embryo_program_error_set(ep, EMBRYO_ERROR_DOMAIN);
return 0;
}
- if (EINA_FLT_CMP(ff, 10.0))
+ if (EINA_FLT_EQ(ff, 10.0))
f = log10f(f);
- else if (EINA_FLT_CMP(ff, 2.0))
+ else if (EINA_FLT_EQ(ff, 2.0))
f = log2f(f);
else
{
tf = logf(ff);
- if (EINA_FLT_CMP(tf, 0.0))
+ if (EINA_FLT_EQ(tf, 0.0))
f = 0.0;
else f = (logf(f) / tf);
}
int npos = 0, nlen = 0;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
- if (!EINA_DBL_CMP(pos, sd->pos)) npos = 1;
- if (!EINA_DBL_CMP(len, sd->len)) nlen = 1;
+ if (!EINA_DBL_EQ(pos, sd->pos)) npos = 1;
+ if (!EINA_DBL_EQ(len, sd->len)) nlen = 1;
sd->pos = pos;
sd->len = len;
if (npos)
}
if (h > 0) tmp = (double)w / (double)h;
else tmp = 1.0;
- if (!EINA_DBL_CMP(ratio, tmp)) tmp = ratio;
- if (!EINA_DBL_CMP(tmp, sd->ratio))
+ if (!EINA_DBL_EQ(ratio, tmp)) tmp = ratio;
+ if (!EINA_DBL_EQ(tmp, sd->ratio))
{
sd->ratio = tmp;
changed = 1;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->open = 1;
- if (!EINA_DBL_CMP(sd->remember_jump, 0.0))
+ if (!EINA_DBL_EQ(sd->remember_jump, 0.0))
emotion_object_position_set(obj, sd->remember_jump);
if (sd->remember_play != sd->play)
emotion_object_play_set(obj, sd->remember_play);
Efl_Canvas_Video_Data *sd;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
- if ((!EINA_DBL_CMP(sd->fill.w, w)) ||
- (!EINA_DBL_CMP(sd->fill.h, h)))
+ if ((!EINA_DBL_EQ(sd->fill.w, w)) ||
+ (!EINA_DBL_EQ(sd->fill.h, h)))
{
Evas_Coord ow, oh;
*w = e->tw;
*h = e->th;
- if (EINA_FLT_CMP(ia, 0))
+ if (EINA_FLT_EQ(ia, 0))
return;
a = e->tw / (float)e->th;
*fx = 0;
*fy = 0;
- if (EINA_FLT_CMP(ia, 0))
+ if (EINA_FLT_EQ(ia, 0))
return;
a = e->tw / (float)e->th;
if (e1->Param != e2->Param) \
return EINA_TRUE;
#define CHECK_FLT_DELTA(Param) \
- if (!EINA_FLT_CMP(e1->Param, e2->Param)) \
+ if (!EINA_FLT_EQ(e1->Param, e2->Param)) \
return EINA_TRUE;
EAPI Eina_Bool
return e1->Param - e2->Param;
#define CMP_FLT_PARAM(Param) \
- if (!EINA_FLT_CMP(e1->Param, e2->Param)) \
+ if (!EINA_FLT_EQ(e1->Param, e2->Param)) \
return e1->Param - e2->Param;
EAPI int
if ((!lo) ||
(lo &&
(lo->emile.scale_down_by == 0) &&
- (EINA_DBL_CMP(lo->emile.dpi, 0.0)) &&
+ (EINA_DBL_EQ(lo->emile.dpi, 0.0)) &&
((lo->emile.w == 0) || (lo->emile.h == 0)) &&
((lo->emile.region.w == 0) || (lo->emile.region.h == 0)) &&
(lo->emile.orientation == 0)
if ((!lo) ||
(lo &&
(lo->emile.scale_down_by == 0) &&
- (EINA_DBL_CMP(lo->emile.dpi, 0.0)) &&
+ (EINA_DBL_EQ(lo->emile.dpi, 0.0)) &&
((lo->emile.w == 0) || (lo->emile.h == 0)) &&
((lo->emile.region.w == 0) || (lo->emile.region.h == 0)) &&
((lo->emile.scale_load.dst_w == 0) || (lo->emile.scale_load.dst_h == 0)) &&
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
- if (EINA_DBL_CMP(dpi, o->load_opts->dpi)) return;
+ if (EINA_DBL_EQ(dpi, o->load_opts->dpi)) return;
evas_object_async_block(obj);
EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
low->dpi = dpi;
return EINA_FALSE; // TODO
case EFL_INPUT_VALUE_WHEEL_DIRECTION:
- if (EINA_DBL_CMP(val, 0.0))
+ if (EINA_DBL_EQ(val, 0.0))
pd->wheel.dir = EFL_ORIENT_VERTICAL;
else
pd->wheel.dir = EFL_ORIENT_HORIZONTAL;
Evas_Real ref_value)
{
if (pd->alpha_comparison == comparison &&
- (EINA_DBL_CMP(pd->alpha_ref_value, ref_value)))
+ (EINA_DBL_EQ(pd->alpha_ref_value, ref_value)))
return;
pd->alpha_comparison = comparison;
pd->alpha_ref_value = ref_value;
_evas_canvas3d_mesh_shadows_constant_bias_set(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd,
Evas_Real bias)
{
- if (!EINA_DBL_CMP(pd->shadows_constant_bias, bias))
+ if (!EINA_DBL_EQ(pd->shadows_constant_bias, bias))
{
pd->shadows_constant_bias = bias;
evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_MESH_SHADOWS_CONSTANT_BIAS, NULL);
GET_NEXT_COLOR
/*Get another color if color equal with background color*/
- if ((EINA_DBL_CMP(bg_color->r, (double)red)) &&
- (EINA_DBL_CMP(bg_color->g, (double)green)) &&
- (EINA_DBL_CMP(bg_color->b, (double)blue)))
+ if ((EINA_DBL_EQ(bg_color->r, (double)red)) &&
+ (EINA_DBL_EQ(bg_color->g, (double)green)) &&
+ (EINA_DBL_EQ(bg_color->b, (double)blue)))
{
GET_NEXT_COLOR
}
Evas_Real x,
Evas_Real y)
{
- if (!EINA_DBL_CMP(x, 0.0)) pd->tex_scale.x = x;
- if (!EINA_DBL_CMP(y, 0.0)) pd->tex_scale.y = y;
+ if (!EINA_DBL_EQ(x, 0.0)) pd->tex_scale.x = x;
+ if (!EINA_DBL_EQ(y, 0.0)) pd->tex_scale.y = y;
}
EOLIAN static void
}
}
}
- else if ((EINA_DBL_CMP(pdmesh->index_count, 0.0)) &&
+ else if ((EINA_DBL_EQ(pdmesh->index_count, 0.0)) &&
pdmesh->vertex_count != 0)
{
if (pdmesh->assembly == EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES)
tmp_x -= obj->cur->geometry.x;
tmp_y -= obj->cur->geometry.y;
- if (!EINA_DBL_CMP(obj_w, src_w))
+ if (!EINA_DBL_EQ(obj_w, src_w))
tmp_x = (tmp_x * (src_w / obj_w));
- if (!EINA_DBL_CMP(obj_h, src_h))
+ if (!EINA_DBL_EQ(obj_h, src_h))
tmp_y = (tmp_y * (src_h / obj_h));
tmp_x += src->cur->geometry.x;
evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev);
if (!e || !ev) return;
- if (EINA_DBL_CMP(fx, 0.0)) fx = x;
- if (EINA_DBL_CMP(fy, 0.0)) fy = y;
+ if (EINA_DBL_EQ(fx, 0.0)) fx = x;
+ if (EINA_DBL_EQ(fy, 0.0)) fy = y;
ev->action = action;
ev->tool = d;
evas_object_async_block(obj);
if ((cur_state != pd->data->state.cur.name) ||
- (!EINA_DBL_CMP(cur_val, pd->data->state.cur.value)) ||
+ (!EINA_DBL_EQ(cur_val, pd->data->state.cur.value)) ||
(next_state != pd->data->state.next.name) ||
- (!EINA_DBL_CMP(next_val, pd->data->state.next.value)) ||
- (!EINA_DBL_CMP(pos, pd->data->state.pos)))
+ (!EINA_DBL_EQ(next_val, pd->data->state.next.value)) ||
+ (!EINA_DBL_EQ(pos, pd->data->state.pos)))
{
Evas_Object_Filter_Data *fcow = FCOW_BEGIN(pd);
fcow->changed = 1;
y = p->y - cy;
z = p->z - cz;
- if (!EINA_DBL_CMP(rz, 0.0))
+ if (!EINA_DBL_EQ(rz, 0.0))
{
xx = x * cos(rz);
yy = x * sin(rz);
y = yy + (y * cos(rz));
}
- if (!EINA_DBL_CMP(ry, 0.0))
+ if (!EINA_DBL_EQ(ry, 0.0))
{
xx = x * cos(ry);
zz = x * sin(ry);
z = zz + (z * cos(ry));
}
- if (!EINA_DBL_CMP(rx, 0.0))
+ if (!EINA_DBL_EQ(rx, 0.0))
{
zz = z * cos(rx);
yy = z * sin(rx);
ln = (nx * nx) + (ny * ny) + (nz * nz);
ln = sqrt(ln);
- if (!EINA_DBL_CMP(ln, 0.0))
+ if (!EINA_DBL_EQ(ln, 0.0))
{
nx /= ln;
ny /= ln;
ln = (x * x) + (y * y) + (z * z);
ln = sqrt(ln);
- if (!EINA_DBL_CMP(ln, 0.0))
+ if (!EINA_DBL_EQ(ln, 0.0))
{
x /= ln;
y /= ln;
(opt->obj, &padding_l, &padding_r, NULL, NULL);
req_w += padding_l + padding_r;
- if (EINA_DBL_CMP(weight_x, 0.0))
+ if (EINA_DBL_EQ(weight_x, 0.0))
{
int child_w;
(opt->obj, NULL, NULL, &padding_t, &padding_b);
req_h += padding_t + padding_b;
- if (EINA_DBL_CMP(weight_y, 0.0))
+ if (EINA_DBL_EQ(weight_y, 0.0))
{
int child_h;
EOLIAN static void
_evas_box_align_set(Eo *o, Evas_Object_Box_Data *priv, double horizontal, double vertical)
{
- if ((EINA_DBL_CMP(priv->align.h, horizontal)) &&
- (EINA_DBL_CMP(priv->align.v, vertical)))
+ if ((EINA_DBL_EQ(priv->align.h, horizontal)) &&
+ (EINA_DBL_EQ(priv->align.v, vertical)))
return;
priv->align.h = horizontal;
priv->align.v = vertical;
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- if (EINA_DBL_CMP(scale, o->cur->border.scale)) return;
+ if (EINA_DBL_EQ(scale, o->cur->border.scale)) return;
evas_object_async_block(obj);
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
state_write->border.scale = scale;
else bt--;
}
}
- if (!EINA_DBL_CMP(o->cur->border.scale, 1.0))
+ if (!EINA_DBL_EQ(o->cur->border.scale, 1.0))
{
bsl = ((double)bl * o->cur->border.scale);
bsr = ((double)br * o->cur->border.scale);
(o->cur->border.t != o->prev->border.t) ||
(o->cur->border.b != o->prev->border.b) ||
(o->cur->border.fill != o->prev->border.fill) ||
- (!EINA_DBL_CMP(o->cur->border.scale, o->prev->border.scale)))
+ (!EINA_DBL_EQ(o->cur->border.scale, o->prev->border.scale)))
{
evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, obj);
goto done;
(m->points[2].a == 255) &&
(m->points[3].a == 255))
{
- if (((EINA_DBL_CMP(m->points[0].x, m->points[3].x)) &&
- (EINA_DBL_CMP(m->points[1].x, m->points[2].x)) &&
- (EINA_DBL_CMP(m->points[0].y, m->points[1].y)) &&
- (EINA_DBL_CMP(m->points[2].y, m->points[3].y))) ||
- ((EINA_DBL_CMP(m->points[0].x, m->points[1].x)) &&
- (EINA_DBL_CMP(m->points[2].x, m->points[3].x)) &&
- (EINA_DBL_CMP(m->points[0].y, m->points[3].y)) &&
- (EINA_DBL_CMP(m->points[1].y, m->points[2].y))))
+ if (((EINA_DBL_EQ(m->points[0].x, m->points[3].x)) &&
+ (EINA_DBL_EQ(m->points[1].x, m->points[2].x)) &&
+ (EINA_DBL_EQ(m->points[0].y, m->points[1].y)) &&
+ (EINA_DBL_EQ(m->points[2].y, m->points[3].y))) ||
+ ((EINA_DBL_EQ(m->points[0].x, m->points[1].x)) &&
+ (EINA_DBL_EQ(m->points[2].x, m->points[3].x)) &&
+ (EINA_DBL_EQ(m->points[0].y, m->points[3].y)) &&
+ (EINA_DBL_EQ(m->points[1].y, m->points[2].y))))
{
- if ((EINA_DBL_CMP(m->points[0].x, obj->cur->geometry.x)) &&
- (EINA_DBL_CMP(m->points[0].y, obj->cur->geometry.y)) &&
- (EINA_DBL_CMP(m->points[2].x,
+ if ((EINA_DBL_EQ(m->points[0].x, obj->cur->geometry.x)) &&
+ (EINA_DBL_EQ(m->points[0].y, obj->cur->geometry.y)) &&
+ (EINA_DBL_EQ(m->points[2].x,
obj->cur->geometry.x + obj->cur->geometry.w)) &&
- (EINA_DBL_CMP(m->points[2].y,
+ (EINA_DBL_EQ(m->points[2].y,
obj->cur->geometry.y + obj->cur->geometry.h)))
return o->cur->opaque;
}
(m->points[2].a == 255) &&
(m->points[3].a == 255))
{
- if (((EINA_DBL_CMP(m->points[0].x, m->points[3].x)) &&
- (EINA_DBL_CMP(m->points[1].x, m->points[2].x)) &&
- (EINA_DBL_CMP(m->points[0].y, m->points[1].y)) &&
- (EINA_DBL_CMP(m->points[2].y, m->points[3].y))) ||
- ((EINA_DBL_CMP(m->points[0].x, m->points[1].x)) &&
- (EINA_DBL_CMP(m->points[2].x, m->points[3].x)) &&
- (EINA_DBL_CMP(m->points[0].y, m->points[3].y)) &&
- (EINA_DBL_CMP(m->points[1].y, m->points[2].y))))
+ if (((EINA_DBL_EQ(m->points[0].x, m->points[3].x)) &&
+ (EINA_DBL_EQ(m->points[1].x, m->points[2].x)) &&
+ (EINA_DBL_EQ(m->points[0].y, m->points[1].y)) &&
+ (EINA_DBL_EQ(m->points[2].y, m->points[3].y))) ||
+ ((EINA_DBL_EQ(m->points[0].x, m->points[1].x)) &&
+ (EINA_DBL_EQ(m->points[2].x, m->points[3].x)) &&
+ (EINA_DBL_EQ(m->points[0].y, m->points[3].y)) &&
+ (EINA_DBL_EQ(m->points[1].y, m->points[2].y))))
{
- if ((EINA_DBL_CMP(m->points[0].x, obj->prev->geometry.x)) &&
- (EINA_DBL_CMP(m->points[0].y, obj->prev->geometry.y)) &&
- (EINA_DBL_CMP(m->points[2].x,
+ if ((EINA_DBL_EQ(m->points[0].x, obj->prev->geometry.x)) &&
+ (EINA_DBL_EQ(m->points[0].y, obj->prev->geometry.y)) &&
+ (EINA_DBL_EQ(m->points[2].x,
obj->prev->geometry.x + obj->prev->geometry.w)) &&
- (EINA_DBL_CMP(m->points[2].y,
+ (EINA_DBL_EQ(m->points[2].y,
obj->prev->geometry.y + obj->prev->geometry.h)))
return o->prev->opaque;
}
bt = imh / 2;
bb = imh - bt;
}
- if (!EINA_DBL_CMP(o->cur->border.scale, 1.0))
+ if (!EINA_DBL_EQ(o->cur->border.scale, 1.0))
{
bsl = ((double)bl * o->cur->border.scale);
bsr = ((double)br * o->cur->border.scale);
evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints))
{
- if (EINA_DBL_CMP(x, 0.5) && EINA_DBL_CMP(y, 0.5)) return;
+ if (EINA_DBL_EQ(x, 0.5) && EINA_DBL_EQ(y, 0.5)) return;
_evas_object_size_hint_alloc(eo_obj, obj);
}
- if ((EINA_DBL_CMP(obj->size_hints->align.x, x)) &&
- (EINA_DBL_CMP(obj->size_hints->align.y, y)))
+ if ((EINA_DBL_EQ(obj->size_hints->align.x, x)) &&
+ (EINA_DBL_EQ(obj->size_hints->align.y, y)))
return;
obj->size_hints->align.x = x;
obj->size_hints->align.y = y;
evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints))
{
- if (EINA_DBL_CMP(x, 0.0) && EINA_DBL_CMP(y, 0.0)) return;
+ if (EINA_DBL_EQ(x, 0.0) && EINA_DBL_EQ(y, 0.0)) return;
_evas_object_size_hint_alloc(eo_obj, obj);
}
- if ((EINA_DBL_CMP(obj->size_hints->weight.x, x)) &&
- (EINA_DBL_CMP(obj->size_hints->weight.y, y)))
+ if ((EINA_DBL_EQ(obj->size_hints->weight.x, x)) &&
+ (EINA_DBL_EQ(obj->size_hints->weight.y, y)))
return;
obj->size_hints->weight.x = x;
obj->size_hints->weight.y = y;
_efl_canvas_object_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale)
{
if (obj->delete_me) return;
- if (EINA_DBL_CMP(obj->cur->scale, scale)) return;
+ if (EINA_DBL_EQ(obj->cur->scale, scale)) return;
evas_object_async_block(obj);
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
EOLIAN static void
_evas_table_align_set(Eo *o, Evas_Table_Data *priv, double horizontal, double vertical)
{
- if ((EINA_DBL_CMP(priv->align.h, horizontal)) &&
- (EINA_DBL_CMP(priv->align.v, vertical)))
+ if ((EINA_DBL_EQ(priv->align.h, horizontal)) &&
+ (EINA_DBL_EQ(priv->align.v, vertical)))
return;
priv->align.h = horizontal;
priv->align.v = vertical;
(_color_same(&o->cur.glow, &o->prev.glow)) &&
(_color_same(&o->cur.glow2, &o->prev.glow2)) &&
(o->cur.style == o->prev.style) &&
- (EINA_DBL_CMP(obj->cur->scale, obj->prev->scale)))
+ (EINA_DBL_EQ(obj->cur->scale, obj->prev->scale)))
{
if ((o->last_computed.ellipsis_start) &&
(o->last_computed.ellipsis_start == o->items))
if (o->items &&
!memcmp(&o->cur, &o->prev, sizeof (o->cur)) &&
o->cur.text == text &&
- (EINA_DBL_CMP(obj->cur->scale, obj->prev->scale)) &&
+ (EINA_DBL_EQ(obj->cur->scale, obj->prev->scale)) &&
((o->last_computed.advance <= obj->cur->geometry.w && !o->last_computed.ellipsis) ||
(o->last_computed.w == obj->cur->geometry.w)) &&
!o->changed_paragraph_direction)
/* Account of the ellipsis item width. As long as ellipsis != 0
* we have a left ellipsis. And the same with 1 and right. */
- if (!EINA_DBL_CMP(o->cur.ellipsis, 0.0))
+ if (!EINA_DBL_EQ(o->cur.ellipsis, 0.0))
{
if (o->last_computed.ellipsis_start)
{
o->last_computed.ellipsis_start = start_ellip_it;
ellip_frame -= start_ellip_it->w;
}
- if (!EINA_DBL_CMP(o->cur.ellipsis, 1.0))
+ if (!EINA_DBL_EQ(o->cur.ellipsis, 1.0))
{
/* FIXME: Should take the last item's font and style and etc. *//* weird it's a text, should always have the same style/font */
if (o->last_computed.ellipsis_end)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- if (EINA_DBL_CMP(o->cur.ellipsis, ellipsis)) return;
+ if (EINA_DBL_EQ(o->cur.ellipsis, ellipsis)) return;
evas_object_async_block(obj);
o->prev.ellipsis = o->cur.ellipsis;
if (((o->cur.ellipsis >= 0.0) &&
((obj->cur->geometry.w != o->last_computed.w) ||
(obj->cur->geometry.h != o->last_computed.h))) ||
- (!EINA_DBL_CMP(o->cur.ellipsis, o->prev.ellipsis)) ||
- (!EINA_DBL_CMP(obj->cur->scale, obj->prev->scale)) ||
+ (!EINA_DBL_EQ(o->cur.ellipsis, o->prev.ellipsis)) ||
+ (!EINA_DBL_EQ(obj->cur->scale, obj->prev->scale)) ||
(o->changed_paragraph_direction))
{
_evas_object_text_recalc(eo_obj, o->cur.text);
ellip_h_thresh = ascent + descent + maxasc + maxdesc;
}
- if ((EINA_DBL_CMP(it->format->ellipsis, 1.0)) && (c->h >= 0) &&
+ if ((EINA_DBL_EQ(it->format->ellipsis, 1.0)) && (c->h >= 0) &&
((c->y + ellip_h_thresh >
c->h - c->o->style_pad.t - c->o->style_pad.b) ||
(!it->format->wrap_word && !it->format->wrap_char &&
{
/* FIXME: Should redo the ellipsis handling.
* If we can do ellipsis, just cut here. */
- if (EINA_DBL_CMP(it->format->ellipsis, 1.0))
+ if (EINA_DBL_EQ(it->format->ellipsis, 1.0))
{
_layout_handle_ellipsis(c, it, i);
ret = 1;
evas_object_async_block(obj);
if (align < 0.0) align = 0.0;
else if (align > 1.0) align = 1.0;
- if (EINA_DBL_CMP(o->valign, align)) return;
+ if (EINA_DBL_EQ(o->valign, align)) return;
o->valign = align;
_evas_textblock_changed(o, eo_obj);
}
{ \
Evas_Coord yoff; \
yoff = ln->baseline; \
- if (!EINA_DBL_CMP(itr->format->valign, -1.0)) \
+ if (!EINA_DBL_EQ(itr->format->valign, -1.0)) \
{ \
if (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) \
{ \
// width changed thus we may have to re-wrap or change centering etc.
(obj->cur->geometry.w != o->last_w) ||
// if valign not top OR we have ellipsis, then if height changed we need to re-eval valign or ... spot
- (((!EINA_DBL_CMP(o->valign, 0.0)) || (o->have_ellipsis)) &&
+ (((!EINA_DBL_EQ(o->valign, 0.0)) || (o->have_ellipsis)) &&
(
((o->formatted.oneline_h == 0) &&
(obj->cur->geometry.h != o->last_h)) ||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
goto done;
}
- if (!EINA_DBL_CMP(obj->cur->scale, obj->prev->scale))
+ if (!EINA_DBL_EQ(obj->cur->scale, obj->prev->scale))
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
goto done;
float f;
v *= 255;
- if (EINA_FLT_CMP(s, 0.0))
+ if (EINA_FLT_EQ(s, 0.0))
{
if (r) *r = v;
if (g) *g = v;
if (!lo) return EINA_TRUE;
return ((lo->emile.scale_down_by == 0)
- && (EINA_DBL_CMP(lo->emile.dpi, 0.0))
+ && (EINA_DBL_EQ(lo->emile.dpi, 0.0))
&& (lo->emile.w == 0) && (lo->emile.h == 0)
&& (lo->emile.region.x == 0) && (lo->emile.region.y == 0)
&& (lo->emile.region.w == 0) && (lo->emile.region.h == 0)
const Evas_Image_Load_Opts *lo2)
{
return ((lo1->emile.scale_down_by == lo2->emile.scale_down_by)
- && (EINA_DBL_CMP(lo1->emile.dpi, lo2->emile.dpi))
+ && (EINA_DBL_EQ(lo1->emile.dpi, lo2->emile.dpi))
&& (lo1->emile.w == lo2->emile.w)
&& (lo1->emile.h == lo2->emile.h)
&& (lo1->emile.region.x == lo2->emile.region.x)
static inline Eina_Bool
convex_hull_triangle3_not_first_edje(Evas_Triangle3 *v, Eina_Vector3 *a, Eina_Vector3 *b)
{
- if ((EINA_DBL_CMP(v->p1.x, a->x) && EINA_DBL_CMP(v->p1.y, a->y) && EINA_DBL_CMP(v->p1.z, a->z)) &&
- (EINA_DBL_CMP(v->p2.x, b->x) && EINA_DBL_CMP(v->p2.y, b->y) && EINA_DBL_CMP(v->p2.z, b->z)))
+ if ((EINA_DBL_EQ(v->p1.x, a->x) && EINA_DBL_EQ(v->p1.y, a->y) && EINA_DBL_EQ(v->p1.z, a->z)) &&
+ (EINA_DBL_EQ(v->p2.x, b->x) && EINA_DBL_EQ(v->p2.y, b->y) && EINA_DBL_EQ(v->p2.z, b->z)))
return EINA_TRUE;
- else if ((EINA_DBL_CMP(v->p2.x, a->x) && EINA_DBL_CMP(v->p2.y, a->y) && EINA_DBL_CMP(v->p2.z, a->z)) &&
- (EINA_DBL_CMP(v->p1.x, b->x) && EINA_DBL_CMP(v->p1.y, b->y) && EINA_DBL_CMP(v->p1.z, b->z)))
+ else if ((EINA_DBL_EQ(v->p2.x, a->x) && EINA_DBL_EQ(v->p2.y, a->y) && EINA_DBL_EQ(v->p2.z, a->z)) &&
+ (EINA_DBL_EQ(v->p1.x, b->x) && EINA_DBL_EQ(v->p1.y, b->y) && EINA_DBL_EQ(v->p1.z, b->z)))
return EINA_TRUE;
return EINA_FALSE;
static inline Eina_Bool
convex_hull_triangle3_first_edje(Evas_Triangle3 *v, Eina_Vector3 *a, Eina_Vector3 *b)
{
- if ((!EINA_FLT_CMP(v->p0.x, a->x) && !EINA_FLT_CMP(v->p0.y, a->y) &&
- !EINA_FLT_CMP(v->p0.z, a->z)) && (!EINA_FLT_CMP(v->p1.x, b->x) &&
- !EINA_FLT_CMP(v->p1.y, b->y) && !EINA_FLT_CMP(v->p1.z, b->z)))
+ if ((!EINA_FLT_EQ(v->p0.x, a->x) && !EINA_FLT_EQ(v->p0.y, a->y) &&
+ !EINA_FLT_EQ(v->p0.z, a->z)) && (!EINA_FLT_EQ(v->p1.x, b->x) &&
+ !EINA_FLT_EQ(v->p1.y, b->y) && !EINA_FLT_EQ(v->p1.z, b->z)))
return EINA_TRUE;
- else if ((!EINA_FLT_CMP(v->p1.x, a->x) && !EINA_FLT_CMP(v->p1.y, a->y) &&
- !EINA_FLT_CMP(v->p1.z, a->z)) && (!EINA_FLT_CMP(v->p0.x, b->x) &&
- !EINA_FLT_CMP(v->p0.y, b->y) && !EINA_FLT_CMP(v->p0.z, b->z)))
+ else if ((!EINA_FLT_EQ(v->p1.x, a->x) && !EINA_FLT_EQ(v->p1.y, a->y) &&
+ !EINA_FLT_EQ(v->p1.z, a->z)) && (!EINA_FLT_EQ(v->p0.x, b->x) &&
+ !EINA_FLT_EQ(v->p0.y, b->y) && !EINA_FLT_EQ(v->p0.z, b->z)))
return EINA_TRUE;
return EINA_FALSE;
static inline Eina_Bool
convex_hull_triangle3_first_point(Evas_Triangle3 *v, Eina_Vector3 *a)
{
- return (EINA_DBL_CMP(v->p0.x, a->x) && EINA_DBL_CMP(v->p0.y, a->y) && EINA_DBL_CMP(v->p0.z, a->z));
+ return (EINA_DBL_EQ(v->p0.x, a->x) && EINA_DBL_EQ(v->p0.y, a->y) && EINA_DBL_EQ(v->p0.z, a->z));
}
static inline Eina_Bool
eina_vector3_equivalent_as_triangle(Eina_Vector3 *v0, Eina_Vector3 *v1, Eina_Vector3 *v2,
Eina_Vector3 *w0, Eina_Vector3 *w1, Eina_Vector3 *w2)
{
- if ((EINA_DBL_CMP(v0->x, w0->x) && EINA_DBL_CMP(v0->y, w0->y) && EINA_DBL_CMP(v0->z, w0->z)) &&
- (EINA_DBL_CMP(v1->x, w1->x) && EINA_DBL_CMP(v1->y, w1->y) && EINA_DBL_CMP(v1->z, w1->z)) &&
- (EINA_DBL_CMP(v2->x, w2->x) && EINA_DBL_CMP(v2->y, w2->y) && EINA_DBL_CMP(v2->z, w2->z)))
+ if ((EINA_DBL_EQ(v0->x, w0->x) && EINA_DBL_EQ(v0->y, w0->y) && EINA_DBL_EQ(v0->z, w0->z)) &&
+ (EINA_DBL_EQ(v1->x, w1->x) && EINA_DBL_EQ(v1->y, w1->y) && EINA_DBL_EQ(v1->z, w1->z)) &&
+ (EINA_DBL_EQ(v2->x, w2->x) && EINA_DBL_EQ(v2->y, w2->y) && EINA_DBL_EQ(v2->z, w2->z)))
return EINA_TRUE;
return EINA_FALSE;
return EINA_TRUE;
}
/* minmax algorithm of ray and box intersection */
- if (!EINA_DBL_CMP(dir->x, 0.0) && !EINA_DBL_CMP(dir->y, 0.0))
+ if (!EINA_DBL_EQ(dir->x, 0.0) && !EINA_DBL_EQ(dir->y, 0.0))
{
t1 = (box->p0.x - org->x) / dir->x;
t2 = (box->p1.x - org->x) / dir->x;
return EINA_FALSE;
}
/* case when ray is parallel to one of axes */
- else if (EINA_DBL_CMP(dir->x, 0.0))
+ else if (EINA_DBL_EQ(dir->x, 0.0))
{
if ((org->x < box->p0.x) && (org->x > box->p1.x))
return EINA_FALSE;
return EINA_TRUE;
}
/* minmax algorithm of ray and box intersection */
- if (!EINA_DBL_CMP(ray->dir.x, 0.0) && !EINA_DBL_CMP(ray->dir.y, 0.0) && !EINA_DBL_CMP(ray->dir.z, 0.0))
+ if (!EINA_DBL_EQ(ray->dir.x, 0.0) && !EINA_DBL_EQ(ray->dir.y, 0.0) && !EINA_DBL_EQ(ray->dir.z, 0.0))
{
t1 = (box->p0.x - ray->org.x) / ray->dir.x;
t2 = (box->p1.x - ray->org.x) / ray->dir.x;
else
{
/* use two-dimensional version here */
- if (EINA_DBL_CMP(ray->dir.x, 0.0))
+ if (EINA_DBL_EQ(ray->dir.x, 0.0))
{
if ((ray->org.x < box->p0.x) || (ray->org.x > box->p1.x))
return EINA_FALSE;
}
}
- if (EINA_DBL_CMP(ray->dir.y, 0.0))
+ if (EINA_DBL_EQ(ray->dir.y, 0.0))
{
if ((ray->org.y < box->p0.y) || (ray->org.y > box->p1.y))
return EINA_FALSE;
}
}
- if (EINA_DBL_CMP(ray->dir.z, 0.0))
+ if (EINA_DBL_EQ(ray->dir.z, 0.0))
{
if (ray->org.z < box->p0.z || ray->org.z > box->p1.z)
return EINA_FALSE;
line->point.y = (plane2->w * plane1->z - plane1->w * plane2->z) / line->direction.x; \
line->point.z = (plane2->y * plane1->w - plane1->y * plane2->w) / line->direction.x;
- if (!EINA_DBL_CMP(line->direction.x, 0.0) && !EINA_DBL_CMP(plane1->z, 0.0))
+ if (!EINA_DBL_EQ(line->direction.x, 0.0) && !EINA_DBL_EQ(plane1->z, 0.0))
{
SOLVE_EQUATION(x, y, z)
}
- else if (!EINA_DBL_CMP(line->direction.y, 0.0) && !EINA_DBL_CMP(plane1->x, 0.0))
+ else if (!EINA_DBL_EQ(line->direction.y, 0.0) && !EINA_DBL_EQ(plane1->x, 0.0))
{
SOLVE_EQUATION(y, z, x)
}
/* calculation of new basis(in system coordinates of texturing) by solution of system of equations */
- if (!EINA_DBL_CMP(new2.y, 0.0))
+ if (!EINA_DBL_EQ(new2.y, 0.0))
{
eina_vector3_scale(&old2, &old2, (new1.y / new2.y));
eina_vector2_scale(&new2, &new2, (new1.y / new2.y));
eina_vector3_scale(out, &old1, 1 / new1.x);
}
- else if (!EINA_DBL_CMP(new1.y, 0.0))
+ else if (!EINA_DBL_EQ(new1.y, 0.0))
{
eina_vector3_scale(&old1, &old1, (new2.y / new1.y));
eina_vector2_scale(&new1, &new1, (new2.y / new1.y));
for (i = 1, j = stride; i < count; i++, j += stride)
{
if ((triangle1.z > data[j + 2]) ||
- ((EINA_FLT_CMP(triangle1.z, data[j + 2])) && (triangle1.y > data[j + 1])) ||
- ((EINA_FLT_CMP(triangle1.z, data[j + 2])) && (EINA_FLT_CMP(triangle1.y, data[j + 1])) && (triangle1.x > data[j])))
+ ((EINA_FLT_EQ(triangle1.z, data[j + 2])) && (triangle1.y > data[j + 1])) ||
+ ((EINA_FLT_EQ(triangle1.z, data[j + 2])) && (EINA_FLT_EQ(triangle1.y, data[j + 1])) && (triangle1.x > data[j])))
{
eina_vector3_set(&triangle1, data[j], data[j + 1], data[j + 2]);
first_num = i;
cos_2d = new_cos_2d; \
eina_vector3_set(&triangle, data[j], data[j + 1], data[j + 2]); \
} \
- else if(!EINA_FLT_CMP(little, big) && \
+ else if(!EINA_FLT_EQ(little, big) && \
(eina_vector3_distance_get(&triangle##_candidate, &previous) > \
eina_vector3_distance_get(&triangle, &previous))) \
{ \
eina_vector3_set(&complanar1, 1, 0, 0);
for (i = 0, j = 0; i < count; i++, j += stride)
{
- if (EINA_FLT_CMP(data[j], triangle1.x) ||
- EINA_FLT_CMP(data[j + 1], triangle1.y) ||
- EINA_FLT_CMP(data[j + 2], triangle1.z))
+ if (EINA_FLT_EQ(data[j], triangle1.x) ||
+ EINA_FLT_EQ(data[j + 1], triangle1.y) ||
+ EINA_FLT_EQ(data[j + 2], triangle1.z))
{
eina_vector3_set(&triangle2_candidate, data[j], data[j + 1], data[j + 2]);
eina_vector3_subtract(&diagonal, &triangle2_candidate, &triangle1);
eina_vector3_subtract(&diagonal, &triangle2, &triangle1);
cos_2d = eina_vector3_angle_get(&complanar1, &diagonal);
}
- else if (!EINA_FLT_CMP(sin, new_sin))
+ else if (!EINA_FLT_EQ(sin, new_sin))
{
eina_vector3_subtract(&diagonal, &triangle2_candidate, &triangle1);
new_cos_2d = eina_vector3_angle_get(&complanar1, &diagonal);
{
eina_vector3_set(&candidate, data[j], data[j + 1], data[j + 2]);
- if ((EINA_FLT_CMP(data[j], triangle1.x) ||
- EINA_FLT_CMP(data[j + 1], triangle1.y) ||
- EINA_FLT_CMP(data[j + 2], triangle1.z)) &&
- (EINA_FLT_CMP(data[j], triangle2.x) ||
- EINA_FLT_CMP(data[j + 1], triangle2.y) ||
- EINA_FLT_CMP(data[j + 2], triangle2.z)))
+ if ((EINA_FLT_EQ(data[j], triangle1.x) ||
+ EINA_FLT_EQ(data[j + 1], triangle1.y) ||
+ EINA_FLT_EQ(data[j + 2], triangle1.z)) &&
+ (EINA_FLT_EQ(data[j], triangle2.x) ||
+ EINA_FLT_EQ(data[j + 1], triangle2.y) ||
+ EINA_FLT_EQ(data[j + 2], triangle2.z)))
{
eina_vector3_plane_by_points(&normal_b, &triangle1, &candidate, &triangle2);
eina_vector3_set(&triangle3, data[j], data[j + 1], data[j + 2]);
cos_2d = eina_vector3_angle_get(&diagonal, &first);
}
- else if (!EINA_FLT_CMP(new_cos, cos))
+ else if (!EINA_FLT_EQ(new_cos, cos))
{
eina_vector3_set(&triangle3_candidate, data[j], data[j + 1], data[j + 2]);
eina_vector3_subtract(&first, &triangle1, &triangle2);
and one new vertex, all vertices should be checked */
for (i = 0, j = 0; i < count; i++, j += stride)
{
- if ((EINA_FLT_CMP(elem->p0.x, data[j]) || EINA_FLT_CMP(elem->p0.y, data[j + 1]) ||
- EINA_FLT_CMP(elem->p0.z, data[j + 2])) && (EINA_FLT_CMP(elem->p1.x, data[j]) ||
- EINA_FLT_CMP(elem->p1.y, data[j + 1]) || EINA_FLT_CMP(elem->p1.z, data[j + 2])) &&
- (EINA_FLT_CMP(elem->p2.x, data[j]) || EINA_FLT_CMP(elem->p2.y, data[j + 1]) ||
- EINA_FLT_CMP(elem->p2.z, data[j + 2])))
+ if ((EINA_FLT_EQ(elem->p0.x, data[j]) || EINA_FLT_EQ(elem->p0.y, data[j + 1]) ||
+ EINA_FLT_EQ(elem->p0.z, data[j + 2])) && (EINA_FLT_EQ(elem->p1.x, data[j]) ||
+ EINA_FLT_EQ(elem->p1.y, data[j + 1]) || EINA_FLT_EQ(elem->p1.z, data[j + 2])) &&
+ (EINA_FLT_EQ(elem->p2.x, data[j]) || EINA_FLT_EQ(elem->p2.y, data[j + 1]) ||
+ EINA_FLT_EQ(elem->p2.z, data[j + 2])))
{
next = malloc(sizeof(Eina_Vector3));
eina_vector3_set(next, data[j], data[j + 1], data[j + 2]);
/* The case when several points are found, is discussed below.
This case is interesting because the convex hull in the
two-dimensional subspace should be filled further */
- if ((!EINA_FLT_CMP(cos, 1.0)) && (1 < eina_array_count(&arr_candidates)))
+ if ((!EINA_FLT_EQ(cos, 1.0)) && (1 < eina_array_count(&arr_candidates)))
{
Eina_Vector3 angle_from, angle_to;
next_2d = eina_array_data_get(&arr_candidates, 0);
cos_2d = new_cos;
best = eina_array_data_get(&arr_candidates, k);
}
- else if (!EINA_FLT_CMP(new_cos, cos_2d))
+ else if (!EINA_FLT_EQ(new_cos, cos_2d))
{
if ((right && (eina_vector3_distance_get(best, &elem->p0) < eina_vector3_length_get(&angle_from))) ||
(!right && (eina_vector3_distance_get(best, &elem->p1) < eina_vector3_length_get(&angle_from))))
/* This event will take place after the previous,
in fact, choice of first triangle in a new two-dimensional
convex hull allows to fill it fan counterclockwise when viewed from the inside */
- else if ((EINA_FLT_CMP(cos, 1.0)) && (1 < eina_array_count(&arr_candidates)))
+ else if ((EINA_FLT_EQ(cos, 1.0)) && (1 < eina_array_count(&arr_candidates)))
{
Eina_Vector3 angle_from, angle_to;
eina_vector3_subtract(&angle_from, &elem->p0, &elem->p1);
cos_2d = new_cos;
best = eina_array_data_get(&arr_candidates, k);
}
- else if (!EINA_FLT_CMP(new_cos, cos_2d))
+ else if (!EINA_FLT_EQ(new_cos, cos_2d))
{
if (eina_vector3_distance_get(best, &elem->p0) < eina_vector3_length_get(&angle_to))
best = eina_array_data_get(&arr_candidates, k);
exist1 = EINA_FALSE; \
for (i = 0, new_stride = 0; (i < vertex_count) && !exist1; i++, new_stride += 10) \
{ \
- if ((k > 0) && !EINA_FLT_CMP(el->p##coord.x, found_vertex[new_stride]) && \
- !EINA_FLT_CMP(el->p##coord.y, found_vertex[new_stride + 1]) && \
- !EINA_FLT_CMP(el->p##coord.z, found_vertex[new_stride + 2])) \
+ if ((k > 0) && !EINA_FLT_EQ(el->p##coord.x, found_vertex[new_stride]) && \
+ !EINA_FLT_EQ(el->p##coord.y, found_vertex[new_stride + 1]) && \
+ !EINA_FLT_EQ(el->p##coord.z, found_vertex[new_stride + 2])) \
{ \
exist1 = EINA_TRUE; \
found_index[3 * k + coord] = i; \
if ((fabs(data[j] - data[m]) < FLT_EPSILON) &&
(fabs(data[j + 1] - data[m + 1]) < FLT_EPSILON) &&
(fabs(data[j + 2] - data[m + 2]) < FLT_EPSILON) &&
- ((m == j) || ((!EINA_FLT_CMP(tex_data[i * tex_stride], 0.0)) &&
- !EINA_FLT_CMP(tex_data[i * tex_stride + 1], 0.0) &&
- !EINA_FLT_CMP(tex_data[i * tex_stride], 1.0) &&
- !EINA_FLT_CMP(tex_data[i * tex_stride + 1], 1.0))))
+ ((m == j) || ((!EINA_FLT_EQ(tex_data[i * tex_stride], 0.0)) &&
+ !EINA_FLT_EQ(tex_data[i * tex_stride + 1], 0.0) &&
+ !EINA_FLT_EQ(tex_data[i * tex_stride], 1.0) &&
+ !EINA_FLT_EQ(tex_data[i * tex_stride + 1], 1.0))))
{
found_index = l;
for (k = 0; k < index_count; k += 3)
static void
_drm_aspect_set(Ecore_Evas *ee, double aspect)
{
- if (EINA_FLT_CMP(ee->prop.aspect, aspect)) return;
+ if (EINA_FLT_EQ(ee->prop.aspect, aspect)) return;
ee->prop.aspect = aspect;
}
if (bh < 1) bh = 1;
a = ((double)bw / (double)bh);
- if ((!EINA_FLT_CMP(ee->prop.aspect, 0.0) &&
+ if ((!EINA_FLT_EQ(ee->prop.aspect, 0.0) &&
(a < ee->prop.aspect)))
{
if ((h < ee->h) > 0)
w = bw + ee->prop.base.w;
h = bh + ee->prop.base.h;
}
- else if ((!EINA_FLT_CMP(ee->prop.aspect, 0.0)) &&
+ else if ((!EINA_FLT_EQ(ee->prop.aspect, 0.0)) &&
(a > ee->prop.aspect))
{
bw = bh * ee->prop.aspect;
else
{
a = ((double)w / (double)h);
- if ((!EINA_FLT_CMP(ee->prop.aspect, 0.0)) &&
+ if ((!EINA_FLT_EQ(ee->prop.aspect, 0.0)) &&
(a < ee->prop.aspect))
{
if ((h < ee->h) > 0)
else
h = w / ee->prop.aspect;
}
- else if ((!EINA_FLT_CMP(ee->prop.aspect, 0.0)) &&
+ else if ((!EINA_FLT_EQ(ee->prop.aspect, 0.0)) &&
(a > ee->prop.aspect))
w = h * ee->prop.aspect;
}
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (EINA_FLT_CMP(ee->prop.aspect, aspect)) return;
+ if (EINA_FLT_EQ(ee->prop.aspect, aspect)) return;
ee->prop.aspect = aspect;
}
static void
_ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect)
{
- if (EINA_FLT_CMP(ee->prop.aspect, aspect)) return;
+ if (EINA_FLT_EQ(ee->prop.aspect, aspect)) return;
ee->prop.aspect = aspect;
_ecore_evas_x_size_pos_hints_update(ee);
tim = ecore_time_get();
priv->frames++;
- if (EINA_DBL_CMP(priv->rlapse, 0.0))
+ if (EINA_DBL_EQ(priv->rlapse, 0.0))
{
priv->rlapse = tim;
priv->flapse = priv->frames;
pos = *((double *)eev->xine_event);
if ((xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE) &&
- (EINA_DBL_CMP(pos, ev->pos)) &&
+ (EINA_DBL_EQ(pos, ev->pos)) &&
(!ev->just_loaded))
{
xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
ev->play_ok = 1;
break;
case 15: /* get pos done */
- if (!EINA_DBL_CMP(ev->last_pos, ev->pos))
+ if (!EINA_DBL_EQ(ev->last_pos, ev->pos))
{
ev->last_pos = ev->pos;
_emotion_video_pos_update(ev->obj, ev->pos, ev->len);
float dx = x2 - x1;
float dy = y2 - y1;
- if (EINA_FLT_CMP(dx, 0))
+ if (EINA_FLT_EQ(dx, 0))
pw = width / fabsf(dy);
- else if (EINA_FLT_CMP(dy, 0))
+ else if (EINA_FLT_EQ(dy, 0))
pw = width / fabsf(dx);
else
pw = width / sqrtf(dx*dx + dy*dy);
_skip_duplicate_points(const double **pts, const double *end_pts)
{
while ((*pts + 2) < end_pts && (*pts)[0] == (*pts)[2] &&
- EINA_FLT_CMP((*pts)[1], (*pts)[3]))
+ EINA_FLT_EQ((*pts)[1], (*pts)[3]))
{
*pts += 2;
}
*implicit_close = EINA_TRUE;
// fall through
case EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO:
- if (EINA_FLT_CMP(pts[0], pts[i]) && EINA_FLT_CMP(pts[1], pts[i+1]))
+ if (EINA_FLT_EQ(pts[0], pts[i]) && EINA_FLT_EQ(pts[1], pts[i+1]))
*ends_at_start = EINA_TRUE;
return;
default:
}
}
// this path is the last path with out implicit close.
- *ends_at_start = EINA_FLT_CMP(pts[0], pts[i]) &&
- EINA_FLT_CMP(pts[1], pts[i+1]);
+ *ends_at_start = EINA_FLT_EQ(pts[0], pts[i]) &&
+ EINA_FLT_EQ(pts[1], pts[i+1]);
}
void
break;
}
case EFL_GFX_PATH_COMMAND_TYPE_LINE_TO:
- if (!EINA_FLT_CMP(stroker->cx, pts[0]) || !EINA_FLT_CMP(stroker->cy, (float)pts[1]))
+ if (!EINA_FLT_EQ(stroker->cx, pts[0]) || !EINA_FLT_EQ(stroker->cy, (float)pts[1]))
{
if (previous_type != EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO)
add_join(stroker, pts[0], pts[1]);
pts+=2;
break;
case EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO:
- if (!EINA_FLT_CMP(stroker->cx, pts[0]) ||
- !EINA_FLT_CMP(stroker->cy, pts[1]) ||
- !EINA_FLT_CMP(pts[0], pts[2]) ||
- !EINA_FLT_CMP(pts[1], pts[3]) ||
- !EINA_FLT_CMP(pts[2], pts[4]) ||
- !EINA_FLT_CMP(pts[3], pts[5]))
+ if (!EINA_FLT_EQ(stroker->cx, pts[0]) ||
+ !EINA_FLT_EQ(stroker->cy, pts[1]) ||
+ !EINA_FLT_EQ(pts[0], pts[2]) ||
+ !EINA_FLT_EQ(pts[1], pts[3]) ||
+ !EINA_FLT_EQ(pts[2], pts[4]) ||
+ !EINA_FLT_EQ(pts[3], pts[5]))
{
- if (!EINA_FLT_CMP(stroker->cx, pts[0]) ||
- !EINA_FLT_CMP(stroker->cy, pts[1]))
+ if (!EINA_FLT_EQ(stroker->cx, pts[0]) ||
+ !EINA_FLT_EQ(stroker->cy, pts[1]))
{
if (previous_type != EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO)
add_join(stroker, pts[0], pts[1]);
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yy, 1));
- fail_if(!EINA_DBL_CMP(xy, yx) ||
- !EINA_DBL_CMP(xy, 0));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yy, 1));
+ fail_if(!EINA_DBL_EQ(xy, yx) ||
+ !EINA_DBL_EQ(xy, 0));
eina_shutdown();
}
eina_matrix2_values_get(&m1,
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yy, 1));
- fail_if(!EINA_DBL_CMP(xy, yx) ||
- !EINA_DBL_CMP(xy, 0));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yy, 1));
+ fail_if(!EINA_DBL_EQ(xy, yx) ||
+ !EINA_DBL_EQ(xy, 0));
eina_matrix2_array_set(&m1, arr);
eina_matrix2_values_get(&m1,
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yx, xy) ||
- !EINA_DBL_CMP(xy, 1));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yx, xy) ||
+ !EINA_DBL_EQ(xy, 1));
eina_matrix2_copy(&m2, &m1);
eina_matrix2_values_get(&m2,
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yx, xy) ||
- !EINA_DBL_CMP(xy, 1));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yx, xy) ||
+ !EINA_DBL_EQ(xy, 1));
eina_matrix2_values_set(&m1,
2, 3,
eina_matrix2_values_get(&m3,
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yx, xy) ||
- !EINA_DBL_CMP(xy, 5));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yx, xy) ||
+ !EINA_DBL_EQ(xy, 5));
eina_matrix2_multiply(&m3, &m1, &m2);
eina_matrix2_values_get(&m3,
&xx, &xy,
&yx, &yy);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yx, xy) ||
- !EINA_DBL_CMP(xy, 5));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yx, xy) ||
+ !EINA_DBL_EQ(xy, 5));
}
END_TEST
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yy, zz) ||
- !EINA_DBL_CMP(zz, ww) ||
- !EINA_DBL_CMP(ww, 1));
- fail_if(!EINA_DBL_CMP(xy, xz) ||
- !EINA_DBL_CMP(xz, xw) ||
- !EINA_DBL_CMP(xw, yx) ||
- !EINA_DBL_CMP(yx, yz) ||
- !EINA_DBL_CMP(yz, yw) ||
- !EINA_DBL_CMP(yw, zx) ||
- !EINA_DBL_CMP(zx, zy) ||
- !EINA_DBL_CMP(zy, zw) ||
- !EINA_DBL_CMP(zw, wx) ||
- !EINA_DBL_CMP(wx, wy) ||
- !EINA_DBL_CMP(wy, wz) ||
- !EINA_DBL_CMP(wz, 0));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yy, zz) ||
+ !EINA_DBL_EQ(zz, ww) ||
+ !EINA_DBL_EQ(ww, 1));
+ fail_if(!EINA_DBL_EQ(xy, xz) ||
+ !EINA_DBL_EQ(xz, xw) ||
+ !EINA_DBL_EQ(xw, yx) ||
+ !EINA_DBL_EQ(yx, yz) ||
+ !EINA_DBL_EQ(yz, yw) ||
+ !EINA_DBL_EQ(yw, zx) ||
+ !EINA_DBL_EQ(zx, zy) ||
+ !EINA_DBL_EQ(zy, zw) ||
+ !EINA_DBL_EQ(zw, wx) ||
+ !EINA_DBL_EQ(wx, wy) ||
+ !EINA_DBL_EQ(wy, wz) ||
+ !EINA_DBL_EQ(wz, 0));
eina_matrix4_values_set(&m,
1, 2, 3, 4,
13, 14, 15, 16);
eina_matrix4_transpose(&n, &m);
- fail_if(!EINA_DBL_CMP(n.xx, 1) ||
- !EINA_DBL_CMP(n.xy, 5) ||
- !EINA_DBL_CMP(n.xz, 9) ||
- !EINA_DBL_CMP(n.xw, 13) ||
- !EINA_DBL_CMP(n.yx, 2) ||
- !EINA_DBL_CMP(n.yy, 6) ||
- !EINA_DBL_CMP(n.yz, 10) ||
- !EINA_DBL_CMP(n.yw, 14) ||
- !EINA_DBL_CMP(n.zx, 3) ||
- !EINA_DBL_CMP(n.zy, 7) ||
- !EINA_DBL_CMP(n.zz, 11) ||
- !EINA_DBL_CMP(n.zw, 15) ||
- !EINA_DBL_CMP(n.wx, 4) ||
- !EINA_DBL_CMP(n.wy, 8) ||
- !EINA_DBL_CMP(n.wz, 12) ||
- !EINA_DBL_CMP(n.ww, 16));
+ fail_if(!EINA_DBL_EQ(n.xx, 1) ||
+ !EINA_DBL_EQ(n.xy, 5) ||
+ !EINA_DBL_EQ(n.xz, 9) ||
+ !EINA_DBL_EQ(n.xw, 13) ||
+ !EINA_DBL_EQ(n.yx, 2) ||
+ !EINA_DBL_EQ(n.yy, 6) ||
+ !EINA_DBL_EQ(n.yz, 10) ||
+ !EINA_DBL_EQ(n.yw, 14) ||
+ !EINA_DBL_EQ(n.zx, 3) ||
+ !EINA_DBL_EQ(n.zy, 7) ||
+ !EINA_DBL_EQ(n.zz, 11) ||
+ !EINA_DBL_EQ(n.zw, 15) ||
+ !EINA_DBL_EQ(n.wx, 4) ||
+ !EINA_DBL_EQ(n.wy, 8) ||
+ !EINA_DBL_EQ(n.wz, 12) ||
+ !EINA_DBL_EQ(n.ww, 16));
eina_shutdown();
}
0, 0, 0, 2,
0, 2, 0, 0);
det = eina_matrix4_determinant(&m);
- fail_if(!EINA_DBL_CMP(det, -16));
+ fail_if(!EINA_DBL_EQ(det, -16));
eina_matrix4_inverse(&m1, &m);
eina_matrix4_values_get(&m1,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xy, 0.5) ||
- !EINA_DBL_CMP(yw, xy) ||
- !EINA_DBL_CMP(zx, yw) ||
- !EINA_DBL_CMP(wz, zx));
+ fail_if (!EINA_DBL_EQ(xy, 0.5) ||
+ !EINA_DBL_EQ(yw, xy) ||
+ !EINA_DBL_EQ(zx, yw) ||
+ !EINA_DBL_EQ(wz, zx));
eina_matrix4_identity(&m1);
eina_matrix4_values_get(&m1,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, 1) ||
- !EINA_DBL_CMP(yy, xx) ||
- !EINA_DBL_CMP(zz, yy) ||
- !EINA_DBL_CMP(ww, zz));
+ fail_if (!EINA_DBL_EQ(xx, 1) ||
+ !EINA_DBL_EQ(yy, xx) ||
+ !EINA_DBL_EQ(zz, yy) ||
+ !EINA_DBL_EQ(ww, zz));
eina_matrix4_values_set(&m1,
0, 2, 2, 0,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, 4) ||
- !EINA_DBL_CMP(xw, xx) ||
- !EINA_DBL_CMP(yy, xw) ||
- !EINA_DBL_CMP(yz, yy) ||
- !EINA_DBL_CMP(zy, yz) ||
- !EINA_DBL_CMP(zz, yy) ||
- !EINA_DBL_CMP(wx, xx) ||
- !EINA_DBL_CMP(ww, zy));
+ fail_if (!EINA_DBL_EQ(xx, 4) ||
+ !EINA_DBL_EQ(xw, xx) ||
+ !EINA_DBL_EQ(yy, xw) ||
+ !EINA_DBL_EQ(yz, yy) ||
+ !EINA_DBL_EQ(zy, yz) ||
+ !EINA_DBL_EQ(zz, yy) ||
+ !EINA_DBL_EQ(wx, xx) ||
+ !EINA_DBL_EQ(ww, zy));
eina_matrix4_multiply(&m2, &m1, &m);
eina_matrix4_values_get(&m2,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, 4) ||
- !EINA_DBL_CMP(xw, xx) ||
- !EINA_DBL_CMP(yy, xw) ||
- !EINA_DBL_CMP(yz, yy) ||
- !EINA_DBL_CMP(zy, yz) ||
- !EINA_DBL_CMP(zz, yy) ||
- !EINA_DBL_CMP(wx, xx) ||
- !EINA_DBL_CMP(ww, zy));
+ fail_if (!EINA_DBL_EQ(xx, 4) ||
+ !EINA_DBL_EQ(xw, xx) ||
+ !EINA_DBL_EQ(yy, xw) ||
+ !EINA_DBL_EQ(yz, yy) ||
+ !EINA_DBL_EQ(zy, yz) ||
+ !EINA_DBL_EQ(zz, yy) ||
+ !EINA_DBL_EQ(wx, xx) ||
+ !EINA_DBL_EQ(ww, zy));
eina_matrix4_array_set(&m1, arr);
eina_matrix4_values_get(&m1,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, 1) ||
- !EINA_DBL_CMP(xw, xx) ||
- !EINA_DBL_CMP(yy, xw) ||
- !EINA_DBL_CMP(yz, yy) ||
- !EINA_DBL_CMP(zy, yz) ||
- !EINA_DBL_CMP(zz, yy) ||
- !EINA_DBL_CMP(wx, xx) ||
- !EINA_DBL_CMP(ww, zy));
+ fail_if (!EINA_DBL_EQ(xx, 1) ||
+ !EINA_DBL_EQ(xw, xx) ||
+ !EINA_DBL_EQ(yy, xw) ||
+ !EINA_DBL_EQ(yz, yy) ||
+ !EINA_DBL_EQ(zy, yz) ||
+ !EINA_DBL_EQ(zz, yy) ||
+ !EINA_DBL_EQ(wx, xx) ||
+ !EINA_DBL_EQ(ww, zy));
eina_matrix4_copy(&m, &m1);
eina_matrix4_values_get(&m1,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, 1) ||
- !EINA_DBL_CMP(xw, xx) ||
- !EINA_DBL_CMP(yy, xw) ||
- !EINA_DBL_CMP(yz, yy) ||
- !EINA_DBL_CMP(zy, yz) ||
- !EINA_DBL_CMP(zz, yy) ||
- !EINA_DBL_CMP(wx, xx) ||
- !EINA_DBL_CMP(ww, zy));
+ fail_if (!EINA_DBL_EQ(xx, 1) ||
+ !EINA_DBL_EQ(xw, xx) ||
+ !EINA_DBL_EQ(yy, xw) ||
+ !EINA_DBL_EQ(yz, yy) ||
+ !EINA_DBL_EQ(zy, yz) ||
+ !EINA_DBL_EQ(zz, yy) ||
+ !EINA_DBL_EQ(wx, xx) ||
+ !EINA_DBL_EQ(ww, zy));
eina_matrix4_ortho_set(&m, l, r, b, t, dn, df);
eina_matrix4_values_get(&m,
&yx, &yy, &yz, &yw,
&zx, &zy, &zz, &zw,
&wx, &wy, &wz, &ww);
- fail_if (!EINA_DBL_CMP(xx, -2) ||
- !EINA_DBL_CMP(yy, -2) ||
- !EINA_DBL_CMP(zz, 2) ||
- !EINA_DBL_CMP(wx, 9) ||
- !EINA_DBL_CMP(wy, 7) ||
- !EINA_DBL_CMP(wz, 5) ||
- !EINA_DBL_CMP(ww, 1));
+ fail_if (!EINA_DBL_EQ(xx, -2) ||
+ !EINA_DBL_EQ(yy, -2) ||
+ !EINA_DBL_EQ(zz, 2) ||
+ !EINA_DBL_EQ(wx, 9) ||
+ !EINA_DBL_EQ(wy, 7) ||
+ !EINA_DBL_EQ(wz, 5) ||
+ !EINA_DBL_EQ(ww, 1));
}
END_TEST
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yy, zz) ||
- !EINA_DBL_CMP(zz, 1));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yy, zz) ||
+ !EINA_DBL_EQ(zz, 1));
- fail_if(!EINA_DBL_CMP(xy, xz) ||
- !EINA_DBL_CMP(yx, yz) ||
- !EINA_DBL_CMP(zx, zy) ||
- !EINA_DBL_CMP(zy, 0));
+ fail_if(!EINA_DBL_EQ(xy, xz) ||
+ !EINA_DBL_EQ(yx, yz) ||
+ !EINA_DBL_EQ(zx, zy) ||
+ !EINA_DBL_EQ(zy, 0));
ret = eina_matrix3_equal(&m, &m1);
fail_if(ret != EINA_TRUE);
END_TEST
#define MATRIX3_CMP(XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ, AXX, AXY, AXZ, AYX, AYY, AYZ, AZX, AZY, AZZ) \
- (EINA_DBL_CMP(XX, AXX) && \
- EINA_DBL_CMP(XY, AXY) && \
- EINA_DBL_CMP(XZ, AXZ) && \
- EINA_DBL_CMP(YX, AYX) && \
- EINA_DBL_CMP(YY, AYY) && \
- EINA_DBL_CMP(YZ, AYZ) && \
- EINA_DBL_CMP(ZX, AZX) && \
- EINA_DBL_CMP(ZY, AZY) && \
- EINA_DBL_CMP(ZZ, AZZ))
+ (EINA_DBL_EQ(XX, AXX) && \
+ EINA_DBL_EQ(XY, AXY) && \
+ EINA_DBL_EQ(XZ, AXZ) && \
+ EINA_DBL_EQ(YX, AYX) && \
+ EINA_DBL_EQ(YY, AYY) && \
+ EINA_DBL_EQ(YZ, AYZ) && \
+ EINA_DBL_EQ(ZX, AZX) && \
+ EINA_DBL_EQ(ZY, AZY) && \
+ EINA_DBL_EQ(ZZ, AZZ))
START_TEST(eina_matrix3_operations)
{
&xx, &xy, &xz,
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if (!EINA_DBL_CMP(xx, xy) ||
- !EINA_DBL_CMP(xy, xz) ||
- !EINA_DBL_CMP(yx, yy) ||
- !EINA_DBL_CMP(yy, yz) ||
- !EINA_DBL_CMP(zx, zy) ||
- !EINA_DBL_CMP(zy, zz) ||
- !EINA_DBL_CMP(zz, 1));
+ fail_if (!EINA_DBL_EQ(xx, xy) ||
+ !EINA_DBL_EQ(xy, xz) ||
+ !EINA_DBL_EQ(yx, yy) ||
+ !EINA_DBL_EQ(yy, yz) ||
+ !EINA_DBL_EQ(zx, zy) ||
+ !EINA_DBL_EQ(zy, zz) ||
+ !EINA_DBL_EQ(zz, 1));
eina_matrix3_translate(&m1, tx, ty);
eina_matrix3_values_get(&m1,
&xx, &xy, &xz,
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if(!EINA_DBL_CMP(xx, yy) ||
- !EINA_DBL_CMP(yy, zz) ||
- !EINA_DBL_CMP(zz, 1));
+ fail_if(!EINA_DBL_EQ(xx, yy) ||
+ !EINA_DBL_EQ(yy, zz) ||
+ !EINA_DBL_EQ(zz, 1));
- fail_if(!EINA_DBL_CMP(xy, xz) ||
- !EINA_DBL_CMP(yx, yz) ||
- !EINA_DBL_CMP(zx, zy) ||
- !EINA_DBL_CMP(zy, 0));
+ fail_if(!EINA_DBL_EQ(xy, xz) ||
+ !EINA_DBL_EQ(yx, yz) ||
+ !EINA_DBL_EQ(zx, zy) ||
+ !EINA_DBL_EQ(zy, 0));
eina_matrix3_values_set(&m1,
1, 2, 1,
2, 1, 1,
1, 2, 2);
ret = eina_matrix3_determinant(&m1);
- fail_if(!EINA_DBL_CMP(ret, -3));
+ fail_if(!EINA_DBL_EQ(ret, -3));
eina_matrix3_values_set(&m1,
3, 3, 3,
&xx, &xy, &xz,
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if (!EINA_DBL_CMP(xx, xy) ||
- !EINA_DBL_CMP(xy, xz) ||
- !EINA_DBL_CMP(yx, yy) ||
- !EINA_DBL_CMP(yy, yz) ||
- !EINA_DBL_CMP(zx, zy) ||
- !EINA_DBL_CMP(zy, zz) ||
- !EINA_DBL_CMP(zz, 1.5));
+ fail_if (!EINA_DBL_EQ(xx, xy) ||
+ !EINA_DBL_EQ(xy, xz) ||
+ !EINA_DBL_EQ(yx, yy) ||
+ !EINA_DBL_EQ(yy, yz) ||
+ !EINA_DBL_EQ(zx, zy) ||
+ !EINA_DBL_EQ(zy, zz) ||
+ !EINA_DBL_EQ(zz, 1.5));
eina_matrix3_values_set(&m1,
0, 2, 0,
&xx, &xy, &xz,
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if (!EINA_DBL_CMP(xz, 5) ||
- !EINA_DBL_CMP(yz, 3));
+ fail_if (!EINA_DBL_EQ(xz, 5) ||
+ !EINA_DBL_EQ(yz, 3));
eina_matrix3_scale_transform_set(&m2, 6, 7);
eina_matrix3_values_get(&m2,
&xx, &xy, &xz,
&yx, &yy, &yz,
&zx, &zy, &zz);
- fail_if (!EINA_DBL_CMP(xx, 6) ||
- !EINA_DBL_CMP(yy, 7));
+ fail_if (!EINA_DBL_EQ(xx, 6) ||
+ !EINA_DBL_EQ(yy, 7));
}
END_TEST
eina_matrix3_point_transform(&m,
x, y,
&x1, &y1);
- fail_if(!EINA_DBL_CMP(x1, 3) ||
- !EINA_DBL_CMP(y1, 2));
+ fail_if(!EINA_DBL_EQ(x1, 3) ||
+ !EINA_DBL_EQ(y1, 2));
EINA_RECTANGLE_SET(&r, 0, 0, 3, 4);
eina_matrix3_rectangle_transform(&m, &r, &q);
- fail_if(!EINA_DBL_CMP(q.x0, 0) ||
- !EINA_DBL_CMP(q.y0, 0) ||
- !EINA_DBL_CMP(q.x1, 0) ||
- !EINA_DBL_CMP(q.y1, 3) ||
- !EINA_DBL_CMP(q.x2, 4) ||
- !EINA_DBL_CMP(q.y2, 3) ||
- !EINA_DBL_CMP(q.x3, 4) ||
- !EINA_DBL_CMP(q.y3, 0));
+ fail_if(!EINA_DBL_EQ(q.x0, 0) ||
+ !EINA_DBL_EQ(q.y0, 0) ||
+ !EINA_DBL_EQ(q.x1, 0) ||
+ !EINA_DBL_EQ(q.y1, 3) ||
+ !EINA_DBL_EQ(q.x2, 4) ||
+ !EINA_DBL_EQ(q.y2, 3) ||
+ !EINA_DBL_EQ(q.x3, 4) ||
+ !EINA_DBL_EQ(q.y3, 0));
eina_quad_coords_set(&q,
0.0, 0.0,
ret = eina_matrix3_quad_square_map(&m, &q);
fail_if(ret != EINA_TRUE);
- fail_if(!EINA_DBL_CMP(q.x0, 0) ||
- !EINA_DBL_CMP(q.y0, 0) ||
- !EINA_DBL_CMP(q.x1, 3) ||
- !EINA_DBL_CMP(q.y1, 0) ||
- !EINA_DBL_CMP(q.x2, 3) ||
- !EINA_DBL_CMP(q.y2, 3) ||
- !EINA_DBL_CMP(q.x3, 0) ||
- !EINA_DBL_CMP(q.y3, 3));
+ fail_if(!EINA_DBL_EQ(q.x0, 0) ||
+ !EINA_DBL_EQ(q.y0, 0) ||
+ !EINA_DBL_EQ(q.x1, 3) ||
+ !EINA_DBL_EQ(q.y1, 0) ||
+ !EINA_DBL_EQ(q.x2, 3) ||
+ !EINA_DBL_EQ(q.y2, 3) ||
+ !EINA_DBL_EQ(q.x3, 0) ||
+ !EINA_DBL_EQ(q.y3, 3));
eina_shutdown();
}
&x1, &y1,
&x2, &y2,
&x3, &y3);
- fail_if (!EINA_FLT_CMP(r2.x0, 0.0) ||
- !EINA_FLT_CMP(r2.y0, 5.0) ||
- !EINA_FLT_CMP(r2.x1, 5.0) ||
- !EINA_FLT_CMP(r2.y1, 0.0) ||
- !EINA_FLT_CMP(r2.x2, 10.0) ||
- !EINA_FLT_CMP(r2.y2, 5.0) ||
- !EINA_FLT_CMP(r2.x3, 5.0) ||
- !EINA_FLT_CMP(r2.y3, 10.0));
+ fail_if (!EINA_FLT_EQ(r2.x0, 0.0) ||
+ !EINA_FLT_EQ(r2.y0, 5.0) ||
+ !EINA_FLT_EQ(r2.x1, 5.0) ||
+ !EINA_FLT_EQ(r2.y1, 0.0) ||
+ !EINA_FLT_EQ(r2.x2, 10.0) ||
+ !EINA_FLT_EQ(r2.y2, 5.0) ||
+ !EINA_FLT_EQ(r2.x3, 5.0) ||
+ !EINA_FLT_EQ(r2.y3, 10.0));
eina_quad_rectangle_to(&r2, &r1);
- fail_if (!EINA_FLT_CMP(r1.x, 0) ||
- !EINA_FLT_CMP(r1.y, 0) ||
- !EINA_FLT_CMP(r1.w, 10) ||
- !EINA_FLT_CMP(r1.h, 10));
+ fail_if (!EINA_FLT_EQ(r1.x, 0) ||
+ !EINA_FLT_EQ(r1.y, 0) ||
+ !EINA_FLT_EQ(r1.w, 10) ||
+ !EINA_FLT_EQ(r1.h, 10));
eina_quad_coords_set(&r2,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0);
eina_quad_rectangle_to(&r2, &r1);
- fail_if (!EINA_FLT_CMP(r1.x, 0) ||
- !EINA_FLT_CMP(r1.y, 0) ||
- !EINA_FLT_CMP(r1.w, 0) ||
- !EINA_FLT_CMP(r1.h, 0));
+ fail_if (!EINA_FLT_EQ(r1.x, 0) ||
+ !EINA_FLT_EQ(r1.y, 0) ||
+ !EINA_FLT_EQ(r1.w, 0) ||
+ !EINA_FLT_EQ(r1.h, 0));
EINA_RECTANGLE_SET(&r1, 5, 10, 20, 30);
eina_quad_rectangle_from(&r2, &r1);
- fail_if (!EINA_FLT_CMP(r2.x0, 5.0) ||
- !EINA_FLT_CMP(r2.y0, 10.0) ||
- !EINA_FLT_CMP(r2.x1, 25.0) ||
- !EINA_FLT_CMP(r2.y1, 10.0) ||
- !EINA_FLT_CMP(r2.x2, 25.0) ||
- !EINA_FLT_CMP(r2.y2, 40.0) ||
- !EINA_FLT_CMP(r2.x3, 5.0) ||
- !EINA_FLT_CMP(r2.y3, 40.0));
+ fail_if (!EINA_FLT_EQ(r2.x0, 5.0) ||
+ !EINA_FLT_EQ(r2.y0, 10.0) ||
+ !EINA_FLT_EQ(r2.x1, 25.0) ||
+ !EINA_FLT_EQ(r2.y1, 10.0) ||
+ !EINA_FLT_EQ(r2.x2, 25.0) ||
+ !EINA_FLT_EQ(r2.y2, 40.0) ||
+ !EINA_FLT_EQ(r2.x3, 5.0) ||
+ !EINA_FLT_EQ(r2.y3, 40.0));
eina_shutdown();
}
static inline Eina_Bool
eina_quaternion_cmp(const Eina_Quaternion *a, const Eina_Quaternion *b)
{
- if (EINA_FLT_CMP(a->x, b->x) &&
- EINA_FLT_CMP(a->y, b->y) &&
- EINA_FLT_CMP(a->z, b->z) &&
- EINA_FLT_CMP(a->w, b->w))
+ if (EINA_FLT_EQ(a->x, b->x) &&
+ EINA_FLT_EQ(a->y, b->y) &&
+ EINA_FLT_EQ(a->z, b->z) &&
+ EINA_FLT_EQ(a->w, b->w))
return EINA_TRUE;
return EINA_FALSE;
}
static inline Eina_Bool
eina_matrix3_cmp(const Eina_Matrix3 *a, const Eina_Matrix3 *b)
{
- if (EINA_FLT_CMP(a->xx, b->xx) &&
- EINA_FLT_CMP(a->xy, b->xy) &&
- EINA_FLT_CMP(a->xz, b->xz) &&
- EINA_FLT_CMP(a->yx, b->yx) &&
- EINA_FLT_CMP(a->yy, b->yy) &&
- EINA_FLT_CMP(a->yz, b->yz) &&
- EINA_FLT_CMP(a->zx, b->zx) &&
- EINA_FLT_CMP(a->zy, b->zy) &&
- EINA_FLT_CMP(a->zz, b->zz))
+ if (EINA_FLT_EQ(a->xx, b->xx) &&
+ EINA_FLT_EQ(a->xy, b->xy) &&
+ EINA_FLT_EQ(a->xz, b->xz) &&
+ EINA_FLT_EQ(a->yx, b->yx) &&
+ EINA_FLT_EQ(a->yy, b->yy) &&
+ EINA_FLT_EQ(a->yz, b->yz) &&
+ EINA_FLT_EQ(a->zx, b->zx) &&
+ EINA_FLT_EQ(a->zy, b->zy) &&
+ EINA_FLT_EQ(a->zz, b->zz))
return EINA_TRUE;
return EINA_FALSE;
}
static inline Eina_Bool
eina_point_3d_cmp(const Eina_Point_3D *a, const Eina_Point_3D *b)
{
- if (EINA_FLT_CMP(a->x, b->x) &&
- EINA_FLT_CMP(a->y, b->y) &&
- EINA_FLT_CMP(a->z, b->z))
+ if (EINA_FLT_EQ(a->x, b->x) &&
+ EINA_FLT_EQ(a->y, b->y) &&
+ EINA_FLT_EQ(a->z, b->z))
return EINA_TRUE;
return EINA_FALSE;
}
eina_init();
- fail_if(!EINA_FLT_CMP(result, sqrt(51)));
+ fail_if(!EINA_FLT_EQ(result, sqrt(51)));
eina_shutdown();
}
t2 = (struct temp *)eina_memdup((unsigned char *)&t1, sizeof(struct temp), EINA_TRUE);
fail_if(t2->i != t1.i);
fail_if(strcmp(t2->s,t1.s) != 0);
- fail_if(!EINA_FLT_CMP(t2->d, t1.d));
+ fail_if(!EINA_FLT_EQ(t2->d, t1.d));
free(t2);
memcpy(buf, "aaabbb", 6);
fail_if(ret != EINA_TRUE);
ret = eina_xattr_double_get(test_file_path, double_attr, &double_ret);
fail_if(ret != EINA_TRUE);
- fail_if(!EINA_DBL_CMP(double_data, double_ret));
+ fail_if(!EINA_DBL_EQ(double_data, double_ret));
close(fd);
unlink(test_file_path);
static void
_done_double_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, double xattr_double)
{
- fail_if(!EINA_DBL_CMP(xattr_double, double_data));
+ fail_if(!EINA_DBL_EQ(xattr_double, double_data));
ecore_main_loop_quit();
}