[PATCH v2 14/28] Input: Widen pointer acceleration types to double
Simon Thum
simon.thum at gmx.de
Fri Jun 10 10:46:36 PDT 2011
On 06/09/2011 07:17 PM, Daniel Stone wrote:
> This widens almost all of the float-using code in ptrveloc.[ch] to
> doubles, other than values coming from properties which are specified to
> be floats by the property API.
>
> Bumps input API to v14 as this changes the AccelScheme signature, as
> used by xf86-input-synaptics.
>
> Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> ---
> dix/ptrveloc.c | 214 +++++++++++++++++++--------------------
> hw/xfree86/common/xf86Module.h | 2 +-
> - float mult = 0.0, tmpf;
> - int dx = 0, dy = 0, tmpi;
> + double mult = 0.0, tmpf;
> + double dx = 0.0, dy = 0.0;
[...]
> if (dx) {
> - tmpf = mult * (float)dx +
> + tmpf = mult * (double)dx +
> dev->last.remainder[0];
> tmpi = (int) tmpf;
> valuator_mask_set(val, 0, tmpi);
> - dev->last.remainder[0] = tmpf - (float)tmpi;
> + dev->last.remainder[0] = tmpf - (double)tmpi;
> }
> if (dy) {
I think this really should be if (dx != 0.0). If only to be explicit.
(There are 4 instances of that.)
Otherwise,
Reviewed-by: Simon Thum <simon.thum at gmx.de>
Cheers,
Simon
More information about the xorg-devel
mailing list