[PATCH 01/15] Fix pressure->motion property format

Peter Hutterer peter.hutterer at who-t.net
Mon Jun 13 21:11:42 PDT 2011


On Thu, Jun 09, 2011 at 08:57:22PM +0100, Daniel Stone wrote:
> From: Derek Foreman <derek.foreman at collabora.co.uk>
> 
> UINT32, not float.

not that a negative value would make sense here but the driver (and your
code) uses int internally so a commit message fixup would be in order.
in this case we should also check for negative values. or you switch this
patch to use CARD32. 

Cheers,
  Peter
 
> Signed-off-by: Derek Foreman <derek.foreman at collabora.co.uk>
> Reviewed-by: Daniel Stone <daniel at fooishbar.org>
> ---
>  src/properties.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/properties.c b/src/properties.c
> index 299a444..8370c0b 100644
> --- a/src/properties.c
> +++ b/src/properties.c
> @@ -646,11 +646,11 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
>          para->coasting_friction = coast_speeds[1];
>      } else if (property == prop_pressuremotion)
>      {
> -        float *press;
> -        if (prop->size != 2 || prop->format != 32 || prop->type != float_type)
> +        INT32 *press;
> +        if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
>              return BadMatch;
>  
> -        press = (float*)prop->data;
> +        press = (INT32*)prop->data;
>          if (press[0] > press[1])
>              return BadValue;
>  
> -- 
> 1.7.5.3
 


More information about the xorg-devel mailing list