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

Peter Hutterer peter.hutterer at who-t.net
Sun May 9 21:00:12 PDT 2010


On Fri, May 07, 2010 at 08:59:49PM +0200, Simon Thum wrote:
> 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.

I'm not quite sure what you mean here - can you rephrase?
ComputeDelta doesn't have any early return paths and *hw isn't modified from
there onwards. So the net effect should be the same.

> 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?

well spotted thanks. and you're right, the second const is a bit over the
top, so I'll just leave it out.

thanks for the review.

Cheers,
  Peter
> 
> >  {
> >      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