]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
z8k opcode_entry_type
authorAlan Modra <amodra@gmail.com>
Tue, 8 Jul 2025 23:34:47 +0000 (09:04 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Jul 2025 00:05:07 +0000 (09:35 +0930)
z8k opcode_entry_type.func is never used as a function pointer, only
as a pointer to a pseudo_typeS.  Change it to a void*.

gas/config/tc-z8k.c
opcodes/z8k-opc.h
opcodes/z8kgen.c

index 9947fe1e1fc33218ca47959882bbd265e9dd966b..2980cffd59a545f78f0db67503b32fb409eedd4e 100644 (file)
@@ -164,7 +164,7 @@ md_begin (void)
       opcode_entry_type *fake_opcode;
       fake_opcode = XNEW (opcode_entry_type);
       fake_opcode->name = md_pseudo_table[idx].poc_name;
-      fake_opcode->func = (void *) (md_pseudo_table + idx);
+      fake_opcode->p = md_pseudo_table + idx;
       fake_opcode->opcode = 250;
       str_hash_insert (opcode_hash_control, fake_opcode->name, fake_opcode, 0);
     }
@@ -1248,7 +1248,7 @@ md_assemble (char *str)
 
   if (opcode->opcode == 250)
     {
-      pseudo_typeS *p;
+      const pseudo_typeS *p;
       char oc;
       char *old = input_line_pointer;
 
@@ -1260,7 +1260,7 @@ md_assemble (char *str)
       *old = '\n';
       while (is_whitespace (*input_line_pointer))
        input_line_pointer++;
-      p = (pseudo_typeS *) (opcode->func);
+      p = opcode->p;
 
       (p->poc_handler) (p->poc_val);
       input_line_pointer = old;
index e8c9c88671795590b882be29218c2e25f58f42cd..933615eb0ea528a87e6b53ac637373ae99689d7f 100644 (file)
@@ -289,7 +289,7 @@ typedef struct {
 #endif
   const char *name;
   unsigned char opcode;
-  void (*func) (void);
+  const void *p;
   unsigned int arg_info[4];
   unsigned int byte_info[10];
   unsigned int noperands;
index 9dc5bddf00f931436ce2083a497d378f6ff7f705..1b2da6b6d05ee49b131d3f1d7c52a497fbc00119 100644 (file)
@@ -1287,7 +1287,7 @@ gas (void)
   printf ("#endif\n");
   printf ("  const char *name;\n");
   printf ("  unsigned char opcode;\n");
-  printf ("  void (*func) (void);\n");
+  printf ("  const void *p;\n");
   printf ("  unsigned int arg_info[4];\n");
   printf ("  unsigned int byte_info[%d];\n", BYTE_INFO_LEN);
   printf ("  unsigned int noperands;\n");