]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/config/tc-rx.c
-Wimplicit-fallthrough warning fixes
[thirdparty/binutils-gdb.git] / gas / config / tc-rx.c
index e0af5b5162131b67d41a49737d32f27c1881e524..07dccc6e83d51898aca63f0f74c25cfea3ca4670 100644 (file)
@@ -22,7 +22,6 @@
 #include "struc-symbol.h"
 #include "safe-ctype.h"
 #include "dwarf2dbg.h"
-#include "libbfd.h"
 #include "elf/common.h"
 #include "elf/rx.h"
 #include "rx-defs.h"
@@ -109,7 +108,7 @@ size_t md_longopts_size = sizeof (md_longopts);
 struct cpu_type
 {
   const char *cpu_name;
-  int type;
+  enum rx_cpu_types type;
 };
 
 struct cpu_type  cpu_type_list[] =
@@ -301,7 +300,7 @@ rx_include (int ignore)
     }
 
    current_filename = as_where (NULL);
-  f = (char *) xmalloc (strlen (current_filename) + strlen (filename) + 1);
+  f = XNEWVEC (char, strlen (current_filename) + strlen (filename) + 1);
 
   /* Check the filename.  If [@]..FILE[@] is found then replace
      this with the current assembler source filename, stripped
@@ -359,7 +358,7 @@ rx_include (int ignore)
       if (env && strlen (env) > len)
        len = strlen (env);
 
-      path = (char *) xmalloc (strlen (f) + len + 5);
+      path = XNEWVEC (char, strlen (f) + len + 5);
 
       if (current_filename != NULL)
        {
@@ -531,10 +530,7 @@ rx_section (int ignore)
 
       if (*p != '"' && *p != '#')
        {
-         char * name = (char *) xmalloc (len + 1);
-
-         strncpy (name, input_line_pointer, len);
-         name[len] = 0;
+         char *name = xmemdup0 (input_line_pointer, len);
 
          input_line_pointer = p;
          parse_rx_section (name);
@@ -1765,7 +1761,8 @@ md_convert_frag (bfd *   abfd ATTRIBUTE_UNUSED,
   rx_bytesT * rxb = fragP->tc_frag_data;
   addressT addr0, mypc;
   int disp;
-  int reloc_type, reloc_adjust;
+  int reloc_adjust;
+  bfd_reloc_code_real_type reloc_type;
   char * op = fragP->fr_opcode;
   int keep_reloc = 0;
   int ri;
@@ -2141,6 +2138,8 @@ md_convert_frag (bfd *   abfd ATTRIBUTE_UNUSED,
        case BFD_RELOC_RX_32_OP:
          fix->fx_size = 4;
          break;
+       default:
+         break;
        }
     }
 
@@ -2402,8 +2401,10 @@ md_apply_fix (struct fix * f ATTRIBUTE_UNUSED,
 
     case BFD_RELOC_RX_GPRELL:
       val >>= 1;
+      /* Fall through.  */
     case BFD_RELOC_RX_GPRELW:
       val >>= 1;
+      /* Fall through.  */
     case BFD_RELOC_RX_GPRELB:
 #if RX_OPCODE_BIG_ENDIAN
       op[1] = val & 0xff;