Skip to content

Commit

Permalink
RISC-V: fix printf types on riscv-dis.c
Browse files Browse the repository at this point in the history
%x requires `unsigned' type, not `int'.  This commit fixes that.

opcodes/ChangeLog:

	* riscv-dis.c (print_insn_args): Fix printf types from `int'
	to `unsigned'.
  • Loading branch information
a4lg committed Jul 30, 2022
1 parent 7900b17 commit ad828c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions opcodes/riscv-dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info
break;
case 'u':
print (info->stream, dis_style_immediate, "0x%x",
(int)(EXTRACT_CITYPE_IMM (l) & (RISCV_BIGIMM_REACH-1)));
(unsigned)(EXTRACT_CITYPE_IMM (l) & (RISCV_BIGIMM_REACH-1)));
break;
case '>':
print (info->stream, dis_style_immediate, "0x%x",
(int)EXTRACT_CITYPE_IMM (l) & 0x3f);
(unsigned)EXTRACT_CITYPE_IMM (l) & 0x3f);
break;
case '<':
print (info->stream, dis_style_immediate, "0x%x",
(int)EXTRACT_CITYPE_IMM (l) & 0x1f);
(unsigned)EXTRACT_CITYPE_IMM (l) & 0x1f);
break;
case 'T': /* Floating-point RS2. */
print (info->stream, dis_style_register, "%s",
Expand Down Expand Up @@ -473,7 +473,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info

case 'y':
print (info->stream, dis_style_text, "0x%x",
(int)EXTRACT_OPERAND (BS, l));
(unsigned)EXTRACT_OPERAND (BS, l));
break;

case 'z':
Expand All @@ -482,12 +482,12 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info

case '>':
print (info->stream, dis_style_immediate, "0x%x",
(int)EXTRACT_OPERAND (SHAMT, l));
(unsigned)EXTRACT_OPERAND (SHAMT, l));
break;

case '<':
print (info->stream, dis_style_immediate, "0x%x",
(int)EXTRACT_OPERAND (SHAMTW, l));
(unsigned)EXTRACT_OPERAND (SHAMTW, l));
break;

case 'S':
Expand Down Expand Up @@ -547,7 +547,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info

case 'Y':
print (info->stream, dis_style_text, "0x%x",
(int) EXTRACT_OPERAND (RNUM, l));
(unsigned) EXTRACT_OPERAND (RNUM, l));
break;

case 'Z':
Expand Down

0 comments on commit ad828c1

Please sign in to comment.