From 43f47e8e6597f06cf2082514c10a71965fa6d3c8 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 21 Mar 2024 13:56:32 +0100 Subject: [PATCH] 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 Part-of: --- hw/xfree86/x86emu/prim_ops.c | 4 ++-- 1 file 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; }