xserver: Branch 'master'
Matthieu Herrb
matthieu.herrb at laas.fr
Thu Aug 23 13:49:04 PDT 2007
Daniel Stone wrote:
> 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.
>
Fix committed.
--
Matthieu Herrb
More information about the xorg
mailing list