[PATCH xf86-input-synaptics] Use fabs() instead of abs() on double values.

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 11 00:59:58 UTC 2019


On Sun, Feb 10, 2019 at 06:46:12PM +0100, Walter Harms wrote:
> 
> 
> > Matthieu Herrb <matthieu at herrb.eu> hat am 10. Februar 2019 um 17:29
> > geschrieben:
> > 
> > 
> > Silences clang warnings.
> > 
> > Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
> 
> seems resonable
> Reviewed-by: Walter Harms wharms at bfs,de

remote: remote: Updating patchwork state for https://patchwork.freedesktop.org/project/Xorg/list/
remote: remote: I: patch #285313 updated using rev a4e5f74b589441077678d5d1546f7de0365a4627.
remote: remote: I: 1 patch(es) updated to state Accepted.
remote: To ssh://kemper.freedesktop.org/git/xorg/driver/xf86-input-synaptics
remote:    f8d896d..a4e5f74  a4e5f74b589441077678d5d1546f7de0365a4627 -> master
To ssh://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
   f8d896d..a4e5f74  master -> master


thanks

Cheers,
   Peter

> > ---
> >  src/synaptics.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/src/synaptics.c b/src/synaptics.c
> > index 930d02e..bc2d2af 100644
> > --- a/src/synaptics.c
> > +++ b/src/synaptics.c
> > @@ -2602,7 +2602,7 @@ HandleScrolling(SynapticsPrivate * priv, struct
> > SynapticsHwState *hw,
> >  
> >          priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime *
> > abs(para->scroll_dist_vert);
> >          delay = MIN(delay, POLL_MS);
> > -        if (abs(priv->scroll.coast_speed_y) < ddy) {
> > +        if (fabs(priv->scroll.coast_speed_y) < ddy) {
> >              priv->scroll.coast_speed_y = 0;
> >              priv->scroll.packets_this_scroll = 0;
> >          }
> > @@ -2617,7 +2617,7 @@ HandleScrolling(SynapticsPrivate * priv, struct
> > SynapticsHwState *hw,
> >          double ddx = para->coasting_friction * dtime;
> >          priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime *
> > abs(para->scroll_dist_horiz);
> >          delay = MIN(delay, POLL_MS);
> > -        if (abs(priv->scroll.coast_speed_x) < ddx) {
> > +        if (fabs(priv->scroll.coast_speed_x) < ddx) {
> >              priv->scroll.coast_speed_x = 0;
> >              priv->scroll.packets_this_scroll = 0;
> >          }
> > @@ -2673,8 +2673,8 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
> >               * really, this should be dependent on the touchpad size. Also,
> >               * you'll need to find a touchpad that doesn't lie about it's
> >               * size. Good luck. */
> > -            if (abs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
> > -                abs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
> > +            if (fabs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
> > +                fabs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
> >                  close_point |= (1 << j);
> >                  close_point |= (1 << i);
> >              }
> > -- 
> > 2.20.1
> > 
> > _______________________________________________
> > xorg-devel at lists.x.org: X.Org development
> > Archives: http://lists.x.org/archives/xorg-devel
> > Info: https://lists.x.org/mailman/listinfo/xorg-devel
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list