Fix calling abs(unsigned)
Casting the substraction result to int since call of overloaded 'abs(uint)' is ambiguous. Change-Id: I24b4919f8a487d275f537391132cae635aaa030e
This commit is contained in:
parent
013af6f0eb
commit
54d72f0643
@ -265,7 +265,7 @@ Screen::_FindBestMode(const display_mode* modes, uint32 count,
|
||||
// TODO: check if these scores make sense
|
||||
int32 diff = 1000 * abs(mode.timing.v_display - height)
|
||||
+ int32(fabs(get_mode_frequency(mode) - frequency) * 10)
|
||||
+ 100 * abs(mode.space - colorSpace);
|
||||
+ 100 * abs((int)(mode.space - colorSpace));
|
||||
|
||||
if (bestIndex == -1 || diff < bestDiff) {
|
||||
bestDiff = diff;
|
||||
|
@ -501,10 +501,10 @@ AccelerantHWInterface::_FindBestMode(const display_mode& compareMode,
|
||||
+ abs(mode.timing.h_total * mode.timing.v_total
|
||||
- compareMode.timing.h_total * compareMode.timing.v_total)
|
||||
/ 100
|
||||
+ abs(mode.timing.pixel_clock - compareMode.timing.pixel_clock)
|
||||
+ abs((int)(mode.timing.pixel_clock - compareMode.timing.pixel_clock))
|
||||
/ 100
|
||||
+ (int32)(500 * fabs(aspectRatio - compareAspectRatio))
|
||||
+ 100 * abs(mode.space - compareMode.space);
|
||||
+ 100 * abs((int)(mode.space - compareMode.space));
|
||||
|
||||
if (bestIndex == -1 || diff < bestDiff) {
|
||||
bestDiff = diff;
|
||||
|
Loading…
Reference in New Issue
Block a user