summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-03-21 13:56:32 +0100
committerMarge Bot <emma+marge@anholt.net>2024-04-18 01:03:11 +0000
commit43f47e8e6597f06cf2082514c10a71965fa6d3c8 (patch)
tree73225de22fbea5bba6d8b13db02bce754961cbab
parenta0daa6f1fe82be72f6341e0288304d7de8b84dea (diff)
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>
-rw-r--r--hw/xfree86/x86emu/prim_ops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
index 47877eb26..ff25215e2 100644
--- a/hw/xfree86/x86emu/prim_ops.c
+++ b/hw/xfree86/x86emu/prim_ops.c
@@ -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;
}