public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: fix printf types on riscv-dis.c
@ 2022-07-13 13:40 Tsukasa OI
  2022-08-03  4:27 ` [PATCH 0/4] RISC-V: Fix disassembler types and styles Tsukasa OI
  0 siblings, 1 reply; 34+ messages in thread
From: Tsukasa OI @ 2022-07-13 13:40 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

%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'.
---
 opcodes/riscv-dis.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index 164fd209dbd..c031ce9ae8f 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -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",
@@ -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':
@@ -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':
@@ -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':

base-commit: dd4c046506cd4da46b439a2b4f8b6d933ecbb961
-- 
2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2022-10-05 22:37 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13 13:40 [PATCH] RISC-V: fix printf types on riscv-dis.c Tsukasa OI
2022-08-03  4:27 ` [PATCH 0/4] RISC-V: Fix disassembler types and styles Tsukasa OI
2022-08-03  4:27   ` [PATCH 1/4] RISC-V: Fix immediates to have `immediate' style Tsukasa OI
2022-08-10 11:16     ` Andrew Burgess
2022-08-10 13:48       ` Tsukasa OI
2022-08-03  4:27   ` [PATCH 2/4] RISC-V: Fix printf argument types corresponding %x Tsukasa OI
2022-08-03  4:27   ` [PATCH 3/4] RISC-V: Optimize riscv_disassemble_data printf Tsukasa OI
2022-08-03  4:27   ` [PATCH 4/4] RISC-V: Print comma and tabs as the `text' style Tsukasa OI
2022-08-10 11:20     ` Andrew Burgess
2022-08-10 13:54       ` Tsukasa OI
2022-09-26 12:26   ` [PATCH v2 0/6] RISC-V: Fix disassembler types and styles Tsukasa OI
2022-09-26 12:26     ` [PATCH v2 1/6] RISC-V: Fix immediates to have "immediate" style Tsukasa OI
2022-09-26 12:26     ` [PATCH v2 2/6] RISC-V: Fix printf argument types corresponding %x Tsukasa OI
2022-09-26 12:26     ` [PATCH v2 3/6] RISC-V: Optimize riscv_disassemble_data printf Tsukasa OI
2022-09-26 12:26     ` [PATCH v2 4/6] RISC-V: Print comma and tabs as the "text" style Tsukasa OI
2022-09-26 12:26     ` [PATCH v2 5/6] RISC-V: Fix T-Head immediate types on printing Tsukasa OI
2022-10-03  9:57       ` Andrew Burgess
2022-10-03 11:06       ` Christoph Müllner
2022-09-26 12:26     ` [PATCH v2 6/6] RISC-V: Print XTheadMemPair literal as "immediate" Tsukasa OI
2022-10-03 11:06       ` Christoph Müllner
2022-10-03  9:59     ` [PATCH v2 0/6] RISC-V: Fix disassembler types and styles Andrew Burgess
2022-10-03 17:40       ` Palmer Dabbelt
2022-10-04  1:34         ` Tsukasa OI
2022-10-04  1:41         ` Nelson Chu
2022-10-04  8:46         ` Andrew Burgess
2022-10-05 22:37           ` Palmer Dabbelt
2022-10-05 21:52         ` Jeff Law
2022-10-03 10:43     ` [PATCH v3 " Tsukasa OI
2022-10-03 10:43       ` [PATCH v3 1/6] RISC-V: Fix immediates to have "immediate" style Tsukasa OI
2022-10-03 10:44       ` [PATCH v3 2/6] RISC-V: Fix printf argument types corresponding %x Tsukasa OI
2022-10-03 10:44       ` [PATCH v3 3/6] RISC-V: Optimize riscv_disassemble_data printf Tsukasa OI
2022-10-03 10:44       ` [PATCH v3 4/6] RISC-V: Print comma and tabs as the "text" style Tsukasa OI
2022-10-03 10:44       ` [PATCH v3 5/6] RISC-V: Fix T-Head immediate types on printing Tsukasa OI
2022-10-03 10:44       ` [PATCH v3 6/6] RISC-V: Print XTheadMemPair literal as "immediate" Tsukasa OI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).