[PATCH 3/6] Use abs() on integers, not fabs()

Matt Turner mattst88 at gmail.com
Thu Apr 28 09:47:57 PDT 2011


2011/4/28 Michel Dänzer <michel at daenzer.net>:
> On Mit, 2011-04-27 at 19:33 -0400, Matt Turner wrote:
>> Signed-off-by: Matt Turner <mattst88 at gmail.com>
>> ---
>>  hw/xfree86/modes/xf86Crtc.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
>> index c2814d4..92c75b1 100644
>> --- a/hw/xfree86/modes/xf86Crtc.c
>> +++ b/hw/xfree86/modes/xf86Crtc.c
>> @@ -2724,8 +2724,8 @@ xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired)
>>        */
>>       if (scan->HDisplay == best->HDisplay &&
>>           scan->VDisplay == best->VDisplay &&
>> -         (fabs(scan->VRefresh - desired->VRefresh) <
>> -          fabs(best->VRefresh - desired->VRefresh))) {
>> +         (abs(scan->VRefresh - desired->VRefresh) <
>> +          abs(best->VRefresh - desired->VRefresh))) {
>
> VRefresh is a float.

Doh! Indeed, ignore this. I think I must have looked up VDisplay in
the struct instead.


More information about the xorg-devel mailing list