summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-05-09 09:25:08 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-09 09:25:08 +0100
commit9cd18f3de6185589b6a343cac7a77951ceca82f4 (patch)
tree92788b2ff35280017aa8d24d6d3cc04bc8cd25a6 /src/bin/edje
parente0e1dc5f6f55b12f34935ed383a9ca97e6cd6cd8 (diff)
edje_cc: fix comparisons for possible non-float values
Summary: when defined, BUILD_EDJE_FP causes some of these struct members to not be floating types and additionally defines special macros to be used for comparisons to handle this case Depends on D11786 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11787
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c14
-rw-r--r--src/bin/edje/edje_cc_parse.c4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index ba1edbd8c7..22de13bf88 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -3554,7 +3554,7 @@ st_collections_base_scale(void)
3554 check_min_arg_count(1); 3554 check_min_arg_count(1);
3555 3555
3556 edje_file->base_scale = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0)); 3556 edje_file->base_scale = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
3557 if (edje_file->base_scale == ZERO) 3557 if (EQ(edje_file->base_scale, ZERO))
3558 { 3558 {
3559 ERR("The base_scale is 0.0. The value should be bigger than 0.0."); 3559 ERR("The base_scale is 0.0. The value should be bigger than 0.0.");
3560 exit(-1); 3560 exit(-1);
@@ -4015,12 +4015,12 @@ _link_combine(void)
4015 EINA_LIST_FOREACH_SAFE(tup->data, l, ll, ell) 4015 EINA_LIST_FOREACH_SAFE(tup->data, l, ll, ell)
4016 { 4016 {
4017 if (ell->pr->tween.mode != el->pr->tween.mode) continue; 4017 if (ell->pr->tween.mode != el->pr->tween.mode) continue;
4018 if (fabs(ell->pr->tween.time - el->pr->tween.time) > DBL_EPSILON) continue; 4018 if (!EQ(ell->pr->tween.time, el->pr->tween.time)) continue;
4019 if (fabs(ell->pr->tween.v1 - el->pr->tween.v1) > DBL_EPSILON) continue; 4019 if (!EQ(ell->pr->tween.v1, el->pr->tween.v1)) continue;
4020 if (fabs(ell->pr->tween.v2 - el->pr->tween.v2) > DBL_EPSILON) continue; 4020 if (!EQ(ell->pr->tween.v2, el->pr->tween.v2)) continue;
4021 if (fabs(ell->pr->tween.v3 - el->pr->tween.v3) > DBL_EPSILON) continue; 4021 if (!EQ(ell->pr->tween.v3, el->pr->tween.v3)) continue;
4022 if (fabs(ell->pr->tween.v4 - el->pr->tween.v4) > DBL_EPSILON) continue; 4022 if (!EQ(ell->pr->tween.v4, el->pr->tween.v4)) continue;
4023 if (fabs(ell->ed->state.value - el->ed->state.value) > DBL_EPSILON) continue; 4023 if (!EQ(ell->ed->state.value, el->ed->state.value)) continue;
4024 if ((!!ell->ed->state.name) != (!!el->ed->state.name)) 4024 if ((!!ell->ed->state.name) != (!!el->ed->state.name))
4025 { 4025 {
4026 if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) || 4026 if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) ||
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c
index 9b143c64f5..a656fb6783 100644
--- a/src/bin/edje/edje_cc_parse.c
+++ b/src/bin/edje/edje_cc_parse.c
@@ -1948,7 +1948,7 @@ _calcf(char op, double a, double b)
1948 return a; 1948 return a;
1949 1949
1950 case '/': 1950 case '/':
1951 if (b != 0) a /= b; 1951 if (EINA_DBL_NONZERO(b)) a /= b;
1952 else 1952 else
1953 ERR("%s:%i divide by zero", file_in, line - 1); 1953 ERR("%s:%i divide by zero", file_in, line - 1);
1954 return a; 1954 return a;
@@ -1958,7 +1958,7 @@ _calcf(char op, double a, double b)
1958 return a; 1958 return a;
1959 1959
1960 case '%': 1960 case '%':
1961 if (0 != b) a = (double)((int)a % (int)b); 1961 if (EINA_DBL_NONZERO(b)) a = (double)((int)a % (int)b);
1962 else 1962 else
1963 ERR("%s:%i modula by zero", file_in, line - 1); 1963 ERR("%s:%i modula by zero", file_in, line - 1);
1964 return a; 1964 return a;