Cast argument to abs, not the result.
This commit is contained in:
parent
f866147165
commit
7c2828eb96
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_disasm.c,v 1.16 2011/04/13 03:25:35 mrg Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.17 2014/02/27 18:14:52 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 David S. Miller, davem@nadzieja.rutgers.edu
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.16 2011/04/13 03:25:35 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.17 2014/02/27 18:14:52 joerg Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <machine/db_machdep.h>
|
||||
|
@ -1000,12 +1000,12 @@ db_disasm(db_addr_t loc, bool altfmt)
|
|||
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);
|
||||
|
@ -1048,7 +1048,7 @@ db_disasm(db_addr_t loc, bool altfmt)
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue