xfree86: x86emu: fix warning on unneccessary abs()

fix warning:

> In file included from ../hw/xfree86/int10/x86emu.c:11:
> ../hw/xfree86/x86emu/prim_ops.c:2478:9: warning: taking the absolute value of unsigned type 'x86emuu32' (aka 'unsigned int') has no effect [-Wabsolute-value]
>     if (abs(div) > 0xff) {
>         ^
> ../hw/xfree86/x86emu/prim_ops.c:2478:9: note: remove the call to 'abs' since unsigned values cannot be negative
>     if (abs(div) > 0xff) {
>         ^~~
> ../hw/xfree86/x86emu/prim_ops.c:2502:9: warning: taking the absolute value of unsigned type 'x86emuu32' (aka 'unsigned int') has no effect [-Wabsolute-value]
>     if (abs(div) > 0xffff) {
>         ^
> ../hw/xfree86/x86emu/prim_ops.c:2502:9: note: remove the call to 'abs' since unsigned values cannot be negative
>     if (abs(div) > 0xffff) {
>         ^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1428>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-03-21 13:56:32 +01:00 committed by Marge Bot
parent a0daa6f1fe
commit 43f47e8e65

View File

@ -2475,7 +2475,7 @@ div_byte(u8 s)
}
div = dvd / (u8) s;
mod = dvd % (u8) s;
if (abs(div) > 0xff) {
if (div > 0xff) {
x86emu_intr_raise(0);
return;
}
@ -2499,7 +2499,7 @@ div_word(u16 s)
}
div = dvd / (u16) s;
mod = dvd % (u16) s;
if (abs(div) > 0xffff) {
if (div > 0xffff) {
x86emu_intr_raise(0);
return;
}