[PATCH synaptics 11/12] move history storage from ComputeDeltas into HandleState.

Simon Thum simon.thum at gmx.de
Fri May 7 11:59:49 PDT 2010


Am 07.05.2010 06:42, schrieb Peter Hutterer:
> It's well hidden in there, but not useful.
Yep it's well hidden, but AFAIK that reflected that the history was only
used for the calling site's task. If that's still true maybe the comment
should say so.

Otherwise,

Reviewed-by: Simon Thum <simon.thum at gmx.de>

>  static int
> -ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw,
> +ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState
const *hw,
>  	      edge_type edge, int *dxP, int *dyP)


Also, while const as const can is good it's confusing. In c++ you can
have a constant pointer to const, written const int * const. Second
const _after_ pointer star. Are you sure that hunk is as intended?

Cheers,

Simon


>  {
>      SynapticsParameters *para = &priv->synpara;
> @@ -1718,9 +1718,6 @@ ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw,
>      *dxP = dx;
>      *dyP = dy;
>  
> -    /* generate a history of the absolute positions */
> -    store_history(priv, hw->x, hw->y, hw->millis);
> -
>      return delay;
>  }
>  
> @@ -2337,6 +2334,9 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
>      priv->finger_state = finger;
>      priv->lastButtons = buttons;
>  
> +    /* generate a history of the absolute positions */
> +    store_history(priv, hw->x, hw->y, hw->millis);
> +
>      return delay;
>  }
>  



More information about the xorg-devel mailing list