diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2022-02-16 16:34:50 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-02-22 10:41:51 +1000 |
commit | a5a0b5bf0f855ac0a5501147de5147a520b8b9d2 (patch) | |
tree | d2c0dba64e29e014b7a0c2be578c6b6eec7787c0 | |
parent | d9e92778ccc89bec74e361f8d4fcc7c24002d2bc (diff) | |
download | xf86-input-wacom-a5a0b5bf0f855ac0a5501147de5147a520b8b9d2.tar.gz |
Fix sign-compare warnings caused by clang's integer abs()
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmTouchFilter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 35d45cf..23123e3 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -196,17 +196,17 @@ static Bool pointsInLine(WacomCommonPtr common, WacomDeviceState ds0, unsigned int vertical_rotated = (rotated) ? WACOM_VERT_ALLOWED : WACOM_HORIZ_ALLOWED; unsigned int scroll_threshold = common->wcmGestureParameters.wcmScrollDistance; + unsigned int dx = abs(ds0.x - ds1.x); + unsigned int dy = abs(ds0.y - ds1.y); if (!common->wcmGestureParameters.wcmScrollDirection) { - if ((abs(ds0.x - ds1.x) < scroll_threshold) && - (abs(ds0.y - ds1.y) > scroll_threshold)) + if (dx < scroll_threshold && dy > scroll_threshold) { common->wcmGestureParameters.wcmScrollDirection = horizon_rotated; ret = TRUE; } - if ((abs(ds0.y - ds1.y) < scroll_threshold) && - (abs(ds0.x - ds1.x) > scroll_threshold)) + if (dy < scroll_threshold && dx > scroll_threshold) { common->wcmGestureParameters.wcmScrollDirection = vertical_rotated; ret = TRUE; @@ -214,12 +214,12 @@ static Bool pointsInLine(WacomCommonPtr common, WacomDeviceState ds0, } else if (common->wcmGestureParameters.wcmScrollDirection == vertical_rotated) { - if (abs(ds0.y - ds1.y) < scroll_threshold) + if (dy < scroll_threshold) ret = TRUE; } else if (common->wcmGestureParameters.wcmScrollDirection == horizon_rotated) { - if (abs(ds0.x - ds1.x) < scroll_threshold) + if (dx < scroll_threshold) ret = TRUE; } return ret; |