This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/4] add some const qualifiers in opcodes


From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

opcodes/ChangeLog:

2016-03-05  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* mcore-opc.h: Add const qualifiers.
	* microblaze-opc.h (struct op_code_struct): Likewise.
	* sh-opc.h: Likewise.
	* tic4x-dis.c (tic4x_print_indirect): Likewise.
	(tic4x_print_op): Likewise.

include/ChangeLog:

2016-02-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* opcode/dlx.h (struct dlx_opcode): Add const qualifiers.
	* opcode/h8300.h (struct h8_opcode): Likewise.
	* opcode/hppa.h (struct pa_opcode): Likewise.
	* opcode/msp430.h: Likewise.
	* opcode/spu.h (struct spu_opcode): Likewise.
	* opcode/tic30.h (struct _register): Likewise.
	* opcode/tic4x.h (struct tic4x_register): Likewise.
	(struct tic4x_cond): Likewise.
	(struct tic4x_indirect): Likewise.
	(struct tic4x_inst): Likewise.
	* opcode/visium.h (struct reg_entry): Likewise.
---
 include/opcode/dlx.h     | 4 ++--
 include/opcode/h8300.h   | 2 +-
 include/opcode/hppa.h    | 2 +-
 include/opcode/msp430.h  | 2 +-
 include/opcode/spu.h     | 2 +-
 include/opcode/tic30.h   | 8 ++++----
 include/opcode/tic4x.h   | 8 ++++----
 include/opcode/visium.h  | 6 +++---
 opcodes/mcore-opc.h      | 2 +-
 opcodes/microblaze-opc.h | 2 +-
 opcodes/sh-opc.h         | 2 +-
 opcodes/tic4x-dis.c      | 8 ++++----
 12 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/include/opcode/dlx.h b/include/opcode/dlx.h
index c3476e7..1d53c52 100644
--- a/include/opcode/dlx.h
+++ b/include/opcode/dlx.h
@@ -143,7 +143,7 @@
 struct dlx_opcode
 {
   /* Name of the instruction.  */
-  char *name;
+  const char *name;
 
   /* Opcode word.  */
   unsigned long opcode;
@@ -161,7 +161,7 @@ struct dlx_opcode
      D	      An immediate operand is in bits 0-25 of the instruction.
      N	      No opperands needed, for nops.
      P	      it can be a register or a 16 bit operand.  */
-  char *args;
+  const char *args;
 };
 
 static const struct dlx_opcode dlx_opcodes[] =
diff --git a/include/opcode/h8300.h b/include/opcode/h8300.h
index b18843d..c33c895 100644
--- a/include/opcode/h8300.h
+++ b/include/opcode/h8300.h
@@ -261,7 +261,7 @@ struct h8_opcode
   int how;
   enum h8_model available;
   int time;
-  char *name;
+  const char *name;
   struct arg args;
   struct code data;
 };
diff --git a/include/opcode/hppa.h b/include/opcode/hppa.h
index 1b48644..2dcc8bc 100644
--- a/include/opcode/hppa.h
+++ b/include/opcode/hppa.h
@@ -42,7 +42,7 @@ struct pa_opcode
     const char *name;
     unsigned long int match;	/* Bits that must be set...  */
     unsigned long int mask;	/* ... in these bits. */
-    char *args;
+    const char *args;
     enum pa_arch arch;
     char flags;
 };
diff --git a/include/opcode/msp430.h b/include/opcode/msp430.h
index 463e5e6..a7762af 100644
--- a/include/opcode/msp430.h
+++ b/include/opcode/msp430.h
@@ -45,7 +45,7 @@ struct msp430_operand_s
 
 struct  msp430_opcode_s
 {
-  char *name;
+  const char *name;
   int fmt;
   int insn_opnumb;
   int bin_opcode;
diff --git a/include/opcode/spu.h b/include/opcode/spu.h
index 1e0efec..d51a547 100644
--- a/include/opcode/spu.h
+++ b/include/opcode/spu.h
@@ -83,7 +83,7 @@ struct spu_opcode
 {
    spu_iformat insn_type;
    unsigned int opcode;
-   char *mnemonic;
+   const char *mnemonic;
    int arg[5];
 };
 
diff --git a/include/opcode/tic30.h b/include/opcode/tic30.h
index 39a4dc7..1ca2f8b 100644
--- a/include/opcode/tic30.h
+++ b/include/opcode/tic30.h
@@ -27,7 +27,7 @@
 
 struct _register
 {
-  char *name;
+  const char *name;
   unsigned char opcode;
   unsigned char regtype;
 };
@@ -135,7 +135,7 @@ static const reg *const tic30_regtab_end
 #define PostIR0_Add_BitRev 0x19
 
 typedef struct {
-  char *syntax;
+  const char *syntax;
   unsigned char modfield;
   unsigned char displacement;
 } ind_addr_type;
@@ -215,7 +215,7 @@ static const ind_addr_type *const tic30_indaddrtab_end
 
 typedef struct _template
 {
-  char *name;
+  const char *name;
   unsigned int operands; /* how many operands */
   unsigned int base_opcode; /* base_opcode is the fundamental opcode byte */
   /* the bits in opcode_modifier are used to generate the final opcode from
@@ -608,7 +608,7 @@ static const insn_template *const tic30_optab_end =
   tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]);
 
 typedef struct {
-  char *name;
+  const char *name;
   unsigned int operands_1;
   unsigned int operands_2;
   unsigned int base_opcode;
diff --git a/include/opcode/tic4x.h b/include/opcode/tic4x.h
index 44f868b..f95d46a 100644
--- a/include/opcode/tic4x.h
+++ b/include/opcode/tic4x.h
@@ -58,7 +58,7 @@ c4x_reg_t;
 
 struct tic4x_register
 {
-  char *        name;
+  const char *  name;
   unsigned long regno;
 };
 
@@ -131,7 +131,7 @@ const unsigned int tic4x_num_registers = (((sizeof tic4x_registers) / (sizeof ti
 
 struct tic4x_cond
 {
-  char *        name;
+  const char *  name;
   unsigned long cond;
 };
 
@@ -171,7 +171,7 @@ const unsigned int tic4x_num_conds = (((sizeof tic4x_conds) / (sizeof tic4x_cond
 
 struct tic4x_indirect
 {
-  char *        name;
+  const char *  name;
   unsigned long modn;
 };
 
@@ -223,7 +223,7 @@ const unsigned int tic4x_num_indirects = (((sizeof tic4x_indirects) / (sizeof ti
 /* Instruction template.  */
 struct tic4x_inst
 {
-  char *        name;
+  const char *  name;
   unsigned long opcode;
   unsigned long opmask;
   char *        args;
diff --git a/include/opcode/visium.h b/include/opcode/visium.h
index 3970479..bc8a2b7 100644
--- a/include/opcode/visium.h
+++ b/include/opcode/visium.h
@@ -100,7 +100,7 @@ enum visium_opcode_arch_val
 
 struct reg_entry
 {
-  char *name;
+  const char *name;
   unsigned char code;
 };
 
@@ -164,7 +164,7 @@ static const struct reg_entry fp_reg_table[] ATTRIBUTE_UNUSED =
 
 static const struct cc_entry
 {
-  char *name;
+  const char *name;
   int code;
 } cc_table [] ATTRIBUTE_UNUSED =
 {
@@ -224,7 +224,7 @@ enum addressing_mode
 
 static const struct opcode_entry
 {
-  char *mnem;
+  const char *mnem;
   enum addressing_mode mode;
   unsigned code;
   char flags;
diff --git a/opcodes/mcore-opc.h b/opcodes/mcore-opc.h
index c94ab2f..24c3f88 100644
--- a/opcodes/mcore-opc.h
+++ b/opcodes/mcore-opc.h
@@ -33,7 +33,7 @@ mcore_opclass;
 
 typedef struct inst
 {
-  char *         name;
+  const char *   name;
   mcore_opclass  opclass;
   unsigned char  transfer;
   unsigned short inst;
diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
index 4fbd8e2..a1bc3d0 100644
--- a/opcodes/microblaze-opc.h
+++ b/opcodes/microblaze-opc.h
@@ -105,7 +105,7 @@
 
 struct op_code_struct
 {
-  char * name;
+  const char * name;
   short inst_type;            /* Registers and immediate values involved.  */
   short inst_offset_type;     /* Immediate vals offset from PC? (= 1 for branches).  */
   short delay_slots;          /* Info about delay slots needed after this instr. */
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index 5916c6a..b2bbbfd 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -371,7 +371,7 @@ SH4AL-dsp                                          SH4A
 
 typedef struct
 {
-  char *name;
+  const char *name;
   sh_arg_type arg[4];
   sh_nibble_type nibbles[9];
   unsigned int arch;
diff --git a/opcodes/tic4x-dis.c b/opcodes/tic4x-dis.c
index 388e2a9..c35e050 100644
--- a/opcodes/tic4x-dis.c
+++ b/opcodes/tic4x-dis.c
@@ -120,7 +120,7 @@ tic4x_print_char (struct disassemble_info * info, char ch)
 }
 
 static int
-tic4x_print_str (struct disassemble_info *info, char *str)
+tic4x_print_str (struct disassemble_info *info, const char *str)
 {
   if (info != NULL)
     (*info->fprintf_func) (info->stream, "%s", str);
@@ -294,7 +294,7 @@ tic4x_print_indirect (struct disassemble_info *info,
   unsigned int aregno;
   unsigned int modn;
   unsigned int disp;
-  char *a;
+  const char *a;
 
   aregno = 0;
   modn = 0;
@@ -357,8 +357,8 @@ tic4x_print_op (struct disassemble_info *info,
 		unsigned long pc)
 {
   int val;
-  char *s;
-  char *parallel = NULL;
+  const char *s;
+  const char *parallel = NULL;
 
   /* Print instruction name.  */
   s = p->name;
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]