On Thu, Jan 29, 2015 at 06:14:07PM -0800, Jason Gerecke wrote:
> Fixes multiple clang warnings about the use of 'abs' with a floating-
> point argument.
> 
> Signed-off-by: Jason Gerecke <killert...@gmail.com>
> ---
>  src/wcmCommon.c      | 2 +-
>  src/wcmTouchFilter.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 61ac43c..7d56ba5 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -1266,7 +1266,7 @@ static void commonDispatchDevice(InputInfoPtr pInfo,
>               double delty = filtered.y - priv->oldState.y;
>  
>               /* less than one device coordinate movement? */
> -             if (abs(deltx)<1 && abs(delty)<1)
> +             if (fabs(deltx)<1 && fabs(delty)<1)

maybe change this to < 1.0 then, but either way,
Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>

Cheers,
   Peter

>               {
>                       /* We have no other data in this event, skip */
>                       if (suppress == SUPPRESS_NON_MOTION)
> diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
> index e945a9d..61e3a3a 100644
> --- a/src/wcmTouchFilter.c
> +++ b/src/wcmTouchFilter.c
> @@ -627,7 +627,7 @@ static void wcmFingerScroll(WacomDevicePtr priv)
>  
>       if (common->wcmGestureMode != GESTURE_SCROLL_MODE)
>       {
> -             if (abs(touchDistance(ds[0], ds[1]) -
> +             if (fabs(touchDistance(ds[0], ds[1]) -
>                       touchDistance(common->wcmGestureState[0],
>                       common->wcmGestureState[1])) < max_spread)
>               {
> @@ -736,7 +736,7 @@ static void wcmFingerZoom(WacomDevicePtr priv)
>       if (common->wcmGestureMode != GESTURE_ZOOM_MODE)
>       {
>               /* two fingers moved apart from each other */
> -             if (abs(touchDistance(ds[0], ds[1]) -
> +             if (fabs(touchDistance(ds[0], ds[1]) -
>                       touchDistance(common->wcmGestureState[0],
>                                     common->wcmGestureState[1])) >
>                       (3 * max_spread))
> -- 
> 2.2.2
> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to