This is the mail archive of the binutils@sources.redhat.com 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]

[PATCH] Remove superfluous casts in MIPS gas


Hi All,

this removes a bunch of superfluous casts in tc-mips.c.
Tested for mips-elf, mips-ecoff, mips64el-elf, mips64-linux
(if this is relevant for this patch :-).


Thiemo


08-11-2001  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/gas/ChangeLog
	* config/tc-mips.c (md_assemble): Remove superflous casts.
	(append_insn): Likewise.
	(mips16_macro_build): Likewise.
	(macro): Likewise.
	(mips16_ip): Likewise.
	(s_cpload): Likewise.
	(mips_relax_frag): Likewise.


diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/config/tc-mips.c src/gas/config/tc-mips.c
--- src-orig/gas/config/tc-mips.c	Wed Nov  7 16:07:00 2001
+++ src/gas/config/tc-mips.c	Thu Nov  8 03:40:48 2001
@@ -1375,12 +1398,11 @@ md_assemble (str)
   else
     {
       if (imm_expr.X_op != O_absent)
-	append_insn ((char *) NULL, &insn, &imm_expr, imm_reloc,
-		     imm_unmatched_hi);
+	append_insn (NULL, &insn, &imm_expr, imm_reloc, imm_unmatched_hi);
       else if (offset_expr.X_op != O_absent)
-	append_insn ((char *) NULL, &insn, &offset_expr, offset_reloc, false);
+	append_insn (NULL, &insn, &offset_expr, offset_reloc, false);
       else
-	append_insn ((char *) NULL, &insn, NULL, unused_reloc, false);
+	append_insn (NULL, &insn, NULL, unused_reloc, false);
     }
 }
 
@@ -1894,8 +1916,7 @@ append_insn (place, ip, address_expr, re
 					  & INSN_UNCOND_BRANCH_DELAY),
 					 (*prev_insn_reloc_type
 					  == BFD_RELOC_MIPS16_JMP)),
-		    make_expr_symbol (address_expr), (offsetT) 0,
-		    (char *) NULL);
+		    make_expr_symbol (address_expr), 0, NULL);
     }
   else if (place != NULL)
     f = place;
@@ -3044,9 +3082,9 @@ mips16_macro_build (place, counter, ep, 
 	      *r = BFD_RELOC_UNUSED + c;
 	    else
 	      {
-		mips16_immed ((char *) NULL, 0, c, ep->X_add_number, false,
-			      false, false, &insn.insn_opcode,
-			      &insn.use_extend, &insn.extend);
+		mips16_immed (NULL, 0, c, ep->X_add_number, false, false,
+			      false, &insn.insn_opcode, &insn.use_extend,
+			      &insn.extend);
 		ep = NULL;
 		*r = BFD_RELOC_UNUSED;
 	      }
@@ -4660,8 +4742,7 @@ macro (ip)
 					  (breg == 0
 					   ? mips_opts.warn_about_macros
 					   : 0)),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 	      if (breg == 0)
 		{
 		  macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
@@ -4682,10 +4763,9 @@ macro (ip)
 	      macro_build ((char *) NULL, &icnt, &expr1,
 			   HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu",
 			   "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
-	      (void) frag_var (rs_machine_dependent, 0, 0,
-			       RELAX_ENCODE (0, 0, -12, -4, 0, 0),
-			       offset_expr.X_add_symbol, (offsetT) 0,
-			       (char *) NULL);
+	      frag_var (rs_machine_dependent, 0, 0,
+			RELAX_ENCODE (0, 0, -12, -4, 0, 0),
+			offset_expr.X_add_symbol, 0, NULL);
 	    }
 	  else
 	    {
@@ -4716,7 +4796,7 @@ macro (ip)
 		 inserting an unnecessary nop after the lw.  */
 	      hold_mips_optimize = mips_optimize;
 	      mips_optimize = 2;
-	      macro_build_lui ((char *) NULL, &icnt, &expr1, AT);
+	      macro_build_lui (NULL, &icnt, &expr1, AT);
 	      mips_optimize = hold_mips_optimize;
 
 	      macro_build ((char *) NULL, &icnt, &expr1,
@@ -4725,10 +4805,9 @@ macro (ip)
 	      macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
 			   HAVE_32BIT_ADDRESSES ? "addu" : "daddu",
 			   "d,v,t", tempreg, tempreg, AT);
-	      (void) frag_var (rs_machine_dependent, 0, 0,
-			       RELAX_ENCODE (0, 0, -16 + off1, -8, 0, 0),
-			       offset_expr.X_add_symbol, (offsetT) 0,
-			       (char *) NULL);
+	      frag_var (rs_machine_dependent, 0, 0,
+			RELAX_ENCODE (0, 0, -16 + off1, -8, 0, 0),
+			offset_expr.X_add_symbol, 0, NULL);
 	      used_at = 1;
 	    }
 	}
@@ -4820,8 +4899,7 @@ macro (ip)
 					  (breg == 0
 					   ? mips_opts.warn_about_macros
 					   : 0)),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 	    }
 	  else if (expr1.X_add_number >= -0x8000
 		   && expr1.X_add_number < 0x8000)
@@ -4837,8 +4915,7 @@ macro (ip)
 					  (breg == 0
 					   ? mips_opts.warn_about_macros
 					   : 0)),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 	    }
 	  else
 	    {
@@ -4872,7 +4949,7 @@ macro (ip)
 		 inserting an unnecessary nop after the lw.  */
 	      hold_mips_optimize = mips_optimize;
 	      mips_optimize = 2;
-	      macro_build_lui ((char *) NULL, &icnt, &expr1, AT);
+	      macro_build_lui (NULL, &icnt, &expr1, AT);
 	      mips_optimize = hold_mips_optimize;
 
 	      macro_build ((char *) NULL, &icnt, &expr1,
@@ -4888,8 +4965,7 @@ macro (ip)
 					  (breg == 0
 					   ? mips_opts.warn_about_macros
 					   : 0)),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 
 	      used_at = 1;
 	    }
@@ -5057,8 +5133,7 @@ macro (ip)
 			   "nop", "");
 	      p = frag_var (rs_machine_dependent, 4, 0,
 			    RELAX_ENCODE (0, 4, -8, 0, 0, 0),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 	    }
 	  else
 	    {
@@ -5082,8 +5157,7 @@ macro (ip)
 	      p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
 			    RELAX_ENCODE (16, 12 + gpdel, gpdel, 8 + gpdel,
 					  0, 0),
-			    offset_expr.X_add_symbol, (offsetT) 0,
-			    (char *) NULL);
+			    offset_expr.X_add_symbol, 0, NULL);
 	      if (gpdel > 0)
 		{
 		  macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
@@ -5543,8 +5615,7 @@ macro (ip)
 	  macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
 	  p = frag_var (rs_machine_dependent, 4, 0,
 			RELAX_ENCODE (0, 4, -8, 0, 0, 0),
-			offset_expr.X_add_symbol, (offsetT) 0,
-			(char *) NULL);
+			offset_expr.X_add_symbol, 0, NULL);
 	  macro_build (p, &icnt, &offset_expr,
 		       HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu",
 		       "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
@@ -5597,7 +5668,7 @@ macro (ip)
 		       tempreg);
 	  p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
 			RELAX_ENCODE (12, 12 + gpdel, gpdel, 8 + gpdel, 0, 0),
-			offset_expr.X_add_symbol, (offsetT) 0, (char *) NULL);
+			offset_expr.X_add_symbol, 0, NULL);
 	  if (gpdel > 0)
 	    {
 	      macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
@@ -6134,8 +6203,7 @@ macro (ip)
 
 	  (void) frag_var (rs_machine_dependent, 0, 0,
 			   RELAX_ENCODE (0, 0, -16 - off, -8, 1, 0),
-			   offset_expr.X_add_symbol, (offsetT) 0,
-			   (char *) NULL);
+			   offset_expr.X_add_symbol, 0, NULL);
 	}
       else if (mips_pic == SVR4_PIC)
 	{
@@ -6204,8 +6272,7 @@ macro (ip)
 	  p = frag_var (rs_machine_dependent, 16 + gpdel + off, 0,
 			RELAX_ENCODE (24 + off, 16 + gpdel + off, gpdel,
 				      8 + gpdel + off, 1, 0),
-			offset_expr.X_add_symbol, (offsetT) 0,
-			(char *) NULL);
+			offset_expr.X_add_symbol, 0, NULL);
 	  if (gpdel > 0)
 	    {
 	      macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
@@ -8530,8 +8650,7 @@ mips16_ip (str, ip)
 		      && *imm_reloc > BFD_RELOC_UNUSED
 		      && insn->pinfo != INSN_MACRO)
 		    {
-		      mips16_immed ((char *) NULL, 0,
-				    *imm_reloc - BFD_RELOC_UNUSED,
+		      mips16_immed (NULL, 0, *imm_reloc - BFD_RELOC_UNUSED,
 				    imm_expr.X_add_number, true, mips16_small,
 				    mips16_ext, &ip->insn_opcode,
 				    &ip->use_extend, &ip->extend);
@@ -11178,7 +11352,7 @@ s_cpload (ignore)
   /* In ELF, this symbol is implicitly an STT_OBJECT symbol.  */
   symbol_get_bfdsym (ex.X_add_symbol)->flags |= BSF_OBJECT;
 
-  macro_build_lui ((char *) NULL, &icnt, &ex, GP);
+  macro_build_lui (NULL, &icnt, &ex, GP);
   macro_build ((char *) NULL, &icnt, &ex, "addiu", "t,r,j", GP, GP,
 	       (int) BFD_RELOC_LO16);
 
@@ -12246,7 +12420,7 @@ mips_relax_frag (fragp, stretch)
   if (! RELAX_MIPS16_P (fragp->fr_subtype))
     return 0;
 
-  if (mips16_extended_frag (fragp, (asection *) NULL, stretch))
+  if (mips16_extended_frag (fragp, NULL, stretch))
     {
       if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
 	return 0;


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