xserver: Branch 'master'

Daniel Stone daniel at fooishbar.org
Thu Aug 23 13:45:14 PDT 2007


On Thu, Aug 23, 2007 at 12:59:45PM -0700, Matthieu Herrb wrote:
> diff-tree 12d27cf33c6d963eae77795c0d247175907162a5 (from ff089e6cae634ac3eb509abd448a250bcbb17275)
> Author: Otto Moerbeek <otto at openbsd.org>
> Date:   Thu Aug 23 21:59:25 2007 +0200
> 
>     A high resolution device that's moving fast can potentially generate
>     an int overflow, making dx*dx+dy*dy negative. Now pow(negative,
>     non-integer) yields NaN, so you loose.  Use fp math to avoid that.
> 
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 2a10038..52b74bd 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -250,7 +250,7 @@ acceleratePointer(DeviceIntPtr pDev, int
>              }
>          }
>          else {
> -            mult = pow((float)(dx * dx + dy * dy),
> +		mult = pow((float)((float)dx * (float)dx + (float)dy * (float)dy),
>                         ((float)(pDev->ptrfeed->ctrl.num) /
>                          (float)(pDev->ptrfeed->ctrl.den) - 1.0) /
>                         2.0) / 2.0;

Please don't change and break the indentation, which is otherwise
completely consistent within the one file.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070823/6e766684/attachment.pgp>


More information about the xorg mailing list