]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/config/tc-fr30.c
Convert unmaintained files over to ISO-C90 and fix formatting.
[thirdparty/binutils-gdb.git] / gas / config / tc-fr30.c
index 34c9f42e4bb9c25f17943d7b4d3a151d843427c0..cf62dd18c6962fb673ea4958df20c627008eaa33 100644 (file)
@@ -66,9 +66,8 @@ struct option md_longopts[] =
 size_t md_longopts_size = sizeof (md_longopts);
 
 int
-md_parse_option (c, arg)
-     int c ATTRIBUTE_UNUSED;
-     char *arg ATTRIBUTE_UNUSED;
+md_parse_option (int c ATTRIBUTE_UNUSED,
+                char *arg ATTRIBUTE_UNUSED)
 {
   switch (c)
     {
@@ -79,8 +78,7 @@ md_parse_option (c, arg)
 }
 
 void
-md_show_usage (stream)
-  FILE * stream;
+md_show_usage (FILE * stream)
 {
   fprintf (stream, _(" FR30 specific command line options:\n"));
 }
@@ -94,7 +92,7 @@ const pseudo_typeS md_pseudo_table[] =
 
 \f
 void
-md_begin ()
+md_begin (void)
 {
   /* Initialize the `cgen' interface.  */
 
@@ -110,8 +108,7 @@ md_begin ()
 }
 
 void
-md_assemble (str)
-     char *str;
+md_assemble (char *str)
 {
   static int last_insn_had_delay_slot = 0;
   fr30_insn insn;
@@ -147,8 +144,7 @@ md_assemble (str)
    We just ignore it.  */
 
 void
-md_operand (expressionP)
-     expressionS * expressionP;
+md_operand (expressionS * expressionP)
 {
   if (* input_line_pointer == '#')
     {
@@ -158,19 +154,17 @@ md_operand (expressionP)
 }
 
 valueT
-md_section_align (segment, size)
-     segT   segment;
-     valueT size;
+md_section_align (segT segment, valueT size)
 {
   int align = bfd_get_section_alignment (stdoutput, segment);
+
   return ((size + (1 << align) - 1) & (-1 << align));
 }
 
 symbolS *
-md_undefined_symbol (name)
-  char *name ATTRIBUTE_UNUSED;
+md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 {
-  return 0;
+  return NULL;
 }
 \f
 /* Interface to relax_segment.  */
@@ -215,9 +209,7 @@ const relax_typeS md_relax_table[] =
    0 value.  */
 
 int
-md_estimate_size_before_relax (fragP, segment)
-     fragS * fragP;
-     segT    segment;
+md_estimate_size_before_relax (fragS * fragP, segT segment)
 {
   /* The only thing we have to handle here are symbols outside of the
      current segment.  They may be undefined or in a different segment in
@@ -268,10 +260,9 @@ md_estimate_size_before_relax (fragP, segment)
    fragP->fr_subtype is the subtype of what the address relaxed to.  */
 
 void
-md_convert_frag (abfd, sec, fragP)
-  bfd *abfd ATTRIBUTE_UNUSED;
-  segT sec ATTRIBUTE_UNUSED;
-  fragS *fragP ATTRIBUTE_UNUSED;
+md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
+                segT sec ATTRIBUTE_UNUSED,
+                fragS *fragP ATTRIBUTE_UNUSED)
 {
 }
 \f
@@ -281,18 +272,14 @@ md_convert_frag (abfd, sec, fragP)
    given a PC relative reloc.  */
 
 long
-md_pcrel_from_section (fixP, sec)
-     fixS * fixP;
-     segT   sec;
+md_pcrel_from_section (fixS * fixP, segT sec)
 {
   if (fixP->fx_addsy != (symbolS *) NULL
       && (! S_IS_DEFINED (fixP->fx_addsy)
          || S_GET_SEGMENT (fixP->fx_addsy) != sec))
-    {
-      /* The symbol is undefined (or is defined but not in this section).
-        Let the linker figure it out.  */
-      return 0;
-    }
+    /* The symbol is undefined (or is defined but not in this section).
+       Let the linker figure it out.  */
+    return 0;
 
   return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1;
 }
@@ -302,10 +289,9 @@ md_pcrel_from_section (fixP, sec)
    *FIXP may be modified if desired.  */
 
 bfd_reloc_code_real_type
-md_cgen_lookup_reloc (insn, operand, fixP)
-     const CGEN_INSN *insn ATTRIBUTE_UNUSED;
-     const CGEN_OPERAND *operand;
-     fixS *fixP;
+md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
+                     const CGEN_OPERAND *operand,
+                     fixS *fixP)
 {
   switch (operand->type)
     {
@@ -318,7 +304,7 @@ md_cgen_lookup_reloc (insn, operand, fixP)
     case FR30_OPERAND_I8:      return BFD_RELOC_8;
     case FR30_OPERAND_I32:     return BFD_RELOC_FR30_48;
     case FR30_OPERAND_I20:     return BFD_RELOC_FR30_20;
-    default : /* avoid -Wall warning */
+    default : /* Avoid -Wall warning.  */
       break;
     }
 
@@ -328,10 +314,7 @@ md_cgen_lookup_reloc (insn, operand, fixP)
 /* Write a value out to the object file, using the appropriate endianness.  */
 
 void
-md_number_to_chars (buf, val, n)
-     char * buf;
-     valueT val;
-     int    n;
+md_number_to_chars (char * buf, valueT val, int n)
 {
   number_to_chars_bigendian (buf, val, n);
 }
@@ -341,14 +324,11 @@ md_number_to_chars (buf, val, n)
    emitted is stored in *sizeP .  An error message is returned, or NULL on OK.
 */
 
-/* Equal to MAX_PRECISION in atof-ieee.c */
+/* Equal to MAX_PRECISION in atof-ieee.c */
 #define MAX_LITTLENUMS 6
 
 char *
-md_atof (type, litP, sizeP)
-     char   type;
-     char * litP;
-     int *  sizeP;
+md_atof (int type, char * litP, int * sizeP)
 {
   int              i;
   int              prec;
@@ -394,11 +374,8 @@ md_atof (type, litP, sizeP)
 }
 
 /* Worker function for fr30_is_colon_insn().  */
-static char restore_colon PARAMS ((int));
-
 static char
-restore_colon (advance_i_l_p_by)
-     int advance_i_l_p_by;
+restore_colon (int advance_i_l_p_by)
 {
   char c;
 
@@ -420,12 +397,11 @@ restore_colon (advance_i_l_p_by)
    to the real end of the instruction/symbol, and returns the character
    that really terminated the symbol.  Otherwise it returns 0.  */
 char
-fr30_is_colon_insn (start)
-     char *  start;
+fr30_is_colon_insn (char *  start)
 {
   char * i_l_p = input_line_pointer;
 
-  /* Check to see if the symbol parsed so far is 'ldi'  */
+  /* Check to see if the symbol parsed so far is 'ldi'.  */
   if (   (start[0] != 'l' && start[0] != 'L')
       || (start[1] != 'd' && start[1] != 'D')
       || (start[2] != 'i' && start[2] != 'I')
@@ -466,15 +442,15 @@ fr30_is_colon_insn (start)
       return 0;
     }
 
-  /* Check to see if the text following the colon is '8' */
+  /* Check to see if the text following the colon is '8' */
   if (i_l_p[1] == '8' && (i_l_p[2] == ' ' || i_l_p[2] == '\t'))
     return restore_colon (2);
 
-  /* Check to see if the text following the colon is '20' */
+  /* Check to see if the text following the colon is '20' */
   else if (i_l_p[1] == '2' && i_l_p[2] =='0' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
     return restore_colon (3);
 
-  /* Check to see if the text following the colon is '32' */
+  /* Check to see if the text following the colon is '32' */
   else if (i_l_p[1] == '3' && i_l_p[2] =='2' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
     return restore_colon (3);
 
@@ -482,10 +458,9 @@ fr30_is_colon_insn (start)
 }
 
 bfd_boolean
-fr30_fix_adjustable (fixP)
-   fixS * fixP;
+fr30_fix_adjustable (fixS * fixP)
 {
-  /* We need the symbol name for the VTABLE entries */
+  /* We need the symbol name for the VTABLE entries */
   if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
       || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
     return 0;