Revert "elm gesture layer - use fabs not abs when actually comparing floats"

This reverts commit 2d4d836018.

Don't pretend to fix an issue found by a static analyzer by
introducing another issue that even clang warns about.

Fixes:
elm_gesture_layer.c:2533: warning: using floating point absolute value
  function 'fabs' when argument is of integer type [-Wabsolute-value]
        if ((fabs(st->info.mx) > ELM_GESTURE_MINIMUM_MOMENTUM) ||
             ^
This commit is contained in:
Jean-Philippe Andre 2017-08-01 19:35:14 +09:00
parent 391a777c01
commit 3b8c60954e
1 changed files with 3 additions and 2 deletions

View File

@ -2530,8 +2530,9 @@ _momentum_test(Evas_Object *obj,
st->line_end.y = pe_local.y;
st->t_end = pe_local.timestamp;
if ((fabs(st->info.mx) > ELM_GESTURE_MINIMUM_MOMENTUM) ||
(fabs(st->info.my) > ELM_GESTURE_MINIMUM_MOMENTUM))
// FIXME: mx,my are int while the momentum is float. Fishy logic here.
if ((abs(st->info.mx) > ELM_GESTURE_MINIMUM_MOMENTUM) ||
(abs(st->info.my) > ELM_GESTURE_MINIMUM_MOMENTUM))
state_to_report = ELM_GESTURE_STATE_END;
else
state_to_report = ELM_GESTURE_STATE_ABORT;