(patch) stop generating code that uses old style arguments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(patch) stop generating code that uses old style arguments

Trevor Saunders
Hi,

I wanted to enable -Wold-style-{declaration,definition} for all of
binutils, and ran into cgen generating that style of definition, so
here's a patch to fix that.

Trev

ChangeLog:

2016-04-14  Trevor Saunders  <[hidden email]>

        * opc-itab.scm (asm_hash_insn_p): Stop using old style arguments.
        (dis_hash_insn_p): Likewise.
        (asm_hash_insn): Likewise.
        (dis_hash_insn): Likewise.
        * opc-opinst.scm (@arch@_cgen_init_opinst_table): Likewise.

Index: opc-itab.scm
===================================================================
RCS file: /cvs/src/src/cgen/opc-itab.scm,v
retrieving revision 1.18
diff -u -p -r1.18 opc-itab.scm
--- opc-itab.scm 3 Nov 2009 16:24:02 -0000 1.18
+++ opc-itab.scm 14 Apr 2016 14:32:21 -0000
@@ -412,15 +412,13 @@ static const CGEN_OPCODE @arch@_cgen_ins
    Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file.  */
 
 static int
-asm_hash_insn_p (insn)
-     const CGEN_INSN *insn ATTRIBUTE_UNUSED;
+asm_hash_insn_p (const CGEN_INSN *insn ATTRIBUTE_UNUSED)
 {
   return CGEN_ASM_HASH_P (insn);
 }
 
 static int
-dis_hash_insn_p (insn)
-     const CGEN_INSN *insn;
+dis_hash_insn_p (const CGEN_INSN *insn)
 {
   /* If building the hash table and the NO-DIS attribute is present,
      ignore.  */
@@ -452,8 +450,7 @@ dis_hash_insn_p (insn)
    Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file.  */
 
 static unsigned int
-asm_hash_insn (mnem)
-     const char * mnem;
+asm_hash_insn (const char *mnem)
 {
   return CGEN_ASM_HASH (mnem);
 }
@@ -462,9 +459,8 @@ asm_hash_insn (mnem)
    VALUE is the first base_insn_bitsize bits as an int in host order.  */
 
 static unsigned int
-dis_hash_insn (buf, value)
-     const char * buf ATTRIBUTE_UNUSED;
-     CGEN_INSN_INT value ATTRIBUTE_UNUSED;
+dis_hash_insn (const char *buf ATTRIBUTE_UNUSED,
+     CGEN_INSN_INT value ATTRIBUTE_UNUSED)
 {
   return CGEN_DIS_HASH (buf, value);
 }
Index: opc-opinst.scm
===================================================================
RCS file: /cvs/src/src/cgen/opc-opinst.scm,v
retrieving revision 1.8
diff -u -p -r1.8 opc-opinst.scm
--- opc-opinst.scm 5 Nov 2009 16:55:33 -0000 1.8
+++ opc-opinst.scm 14 Apr 2016 14:32:21 -0000
@@ -117,8 +117,7 @@
 /* Function to call before using the operand instance table.  */
 
 void
-@arch@_cgen_init_opinst_table (cd)
-     CGEN_CPU_DESC cd;
+@arch@_cgen_init_opinst_table (CGEN_CPU_DESC cd)
 {
   int i;
   const CGEN_OPINST **oi = & @arch@_cgen_opinst_table[0];
Reply | Threaded
Open this post in threaded view
|

Re: (patch) stop generating code that uses old style arguments

Frank Ch. Eigler
Hi -

> I wanted to enable -Wold-style-{declaration,definition} for all of
> binutils, and ran into cgen generating that style of definition, so
> here's a patch to fix that.

Looks good; are you able to commit?

- FChE