Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/sparc Don't cast the result of abs() to int, ...
details: https://anonhg.NetBSD.org/src/rev/42de834900fa
branches: trunk
changeset: 350427:42de834900fa
user: joerg <joerg%NetBSD.org@localhost>
date: Wed Jan 11 12:14:32 2017 +0000
description:
Don't cast the result of abs() to int, but the argument.
diffstat:
sys/arch/sparc/sparc/db_disasm.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (42 lines):
diff -r cee345eb2ac6 -r 42de834900fa sys/arch/sparc/sparc/db_disasm.c
--- a/sys/arch/sparc/sparc/db_disasm.c Wed Jan 11 12:13:52 2017 +0000
+++ b/sys/arch/sparc/sparc/db_disasm.c Wed Jan 11 12:14:32 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.21 2015/10/04 08:16:13 joerg Exp $ */
+/* $NetBSD: db_disasm.c,v 1.22 2017/01/11 12:14:32 joerg Exp $ */
/*
* Copyright (c) 1994 David S. Miller, davem%nadzieja.rutgers.edu@localhost
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.21 2015/10/04 08:16:13 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.22 2017/01/11 12:14:32 joerg Exp $");
#include <sys/param.h>
#include <machine/db_machdep.h>
@@ -995,12 +995,12 @@
case 'i':
/* simm13 -- signed */
val = SIGNEX(insn, 13);
- db_printf("%s0x%x", SIGN(val), (int)abs(val));
+ db_printf("%s0x%x", SIGN(val), abs((int)val));
break;
case 'j':
/* simm11 -- signed */
val = SIGNEX(insn, 11);
- db_printf("%s0x%x", SIGN(val), (int)abs(val));
+ db_printf("%s0x%x", SIGN(val), abs((int)val));
break;
case 'l':
val = (((insn>>20)&0x3)<<13)|(insn & 0x1fff);
@@ -1043,7 +1043,7 @@
db_printf("[%%%s %c 0x%x]",
regs[((insn >> 14) & 0x1f)],
(int)((val<0)?'-':'+'),
- (int)abs(val));
+ abs((int)val));
if (*f_ptr == '8')
db_printf(" %%asi");
break;
Home |
Main Index |
Thread Index |
Old Index