This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] gcc/*.c: Remove unnecessary casts.


Hi,

Bootstrapped on i686-pc-linux-gnu.  Committed as preapproved.

Kazu Hirata

2004-03-21  Kazu Hirata  <kazu@cs.umass.edu>

	* bt-load.c, builtins.c, cfghooks.c, cfgrtl.c, gcse.c,
	ggc-page.c, integrate.c, var-tracking.c, web.c: Remove
	unnecessary casts.

Index: bt-load.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bt-load.c,v
retrieving revision 2.18
diff -u -p -r2.18 bt-load.c
--- bt-load.c	20 Mar 2004 16:50:30 -0000	2.18
+++ bt-load.c	21 Mar 2004 15:18:21 -0000
@@ -1385,8 +1385,7 @@ migrate_btr_defs (enum reg_class btr_cla
 
   while (!fibheap_empty (all_btr_defs))
     {
-      btr_def def =
-	(btr_def) fibheap_extract_min (all_btr_defs);
+      btr_def def = fibheap_extract_min (all_btr_defs);
       int min_cost = -fibheap_min_key (all_btr_defs);
       if (migrate_btr_def (def, min_cost))
 	{
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.296
diff -u -p -r1.296 builtins.c
--- builtins.c	20 Mar 2004 04:52:49 -0000	1.296
+++ builtins.c	21 Mar 2004 15:18:35 -0000
@@ -4650,7 +4650,7 @@ expand_builtin_printf (tree arglist, rtx
 	    {
 	      /* Create a NUL-terminated string that's one char shorter
 		 than the original, stripping off the trailing '\n'.  */
-	      char *newstr = (char *) alloca (len);
+	      char *newstr = alloca (len);
 	      memcpy (newstr, fmt_str, len - 1);
 	      newstr[len - 1] = 0;
 
Index: cfghooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfghooks.c,v
retrieving revision 1.8
diff -u -p -r1.8 cfghooks.c
--- cfghooks.c	17 Feb 2004 23:03:37 -0000	1.8
+++ cfghooks.c	21 Mar 2004 15:18:36 -0000
@@ -206,8 +206,8 @@ dump_bb (basic_block bb, FILE *outf, int
   edge e;
   char *s_indent;
  
-  s_indent = (char *) alloca ((size_t) indent + 1);
-  memset ((void *) s_indent, ' ', (size_t) indent);
+  s_indent = alloca ((size_t) indent + 1);
+  memset (s_indent, ' ', (size_t) indent);
   s_indent[indent] = '\0';
 
   fprintf (outf, ";;%s basic block %d, loop depth %d, count ",
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.113
diff -u -p -r1.113 cfgrtl.c
--- cfgrtl.c	21 Mar 2004 06:38:20 -0000	1.113
+++ cfgrtl.c	21 Mar 2004 15:18:41 -0000
@@ -1665,8 +1665,8 @@ rtl_dump_bb (basic_block bb, FILE *outf,
   rtx last;
   char *s_indent;
 
-  s_indent = (char *) alloca ((size_t) indent + 1);
-  memset ((void *) s_indent, ' ', (size_t) indent);
+  s_indent = alloca ((size_t) indent + 1);
+  memset (s_indent, ' ', (size_t) indent);
   s_indent[indent] = '\0';
 
   fprintf (outf, ";;%s Registers live at start: ", s_indent);
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.296
diff -u -p -r1.296 gcse.c
--- gcse.c	18 Mar 2004 20:09:04 -0000	1.296
+++ gcse.c	21 Mar 2004 15:18:58 -0000
@@ -8366,7 +8366,7 @@ eliminate_partially_redundant_loads (bas
 	  ok_count += pred->count;
           if (EDGE_CRITICAL_P (pred))
             critical_count += pred->count;
-	  occr = (struct unoccr *) gmalloc (sizeof (struct unoccr));
+	  occr = gmalloc (sizeof (struct unoccr));
 	  occr->insn = avail_insn;
 	  occr->pred = pred;
 	  occr->next = avail_occrs;
@@ -8377,7 +8377,7 @@ eliminate_partially_redundant_loads (bas
 	  not_ok_count += pred->count;
           if (EDGE_CRITICAL_P (pred))
             critical_count += pred->count;
-	  unoccr = (struct unoccr *) gmalloc (sizeof (struct unoccr));
+	  unoccr = gmalloc (sizeof (struct unoccr));
 	  unoccr->insn = NULL_RTX;
 	  unoccr->pred = pred;
 	  unoccr->next = unavail_occrs;
@@ -8616,8 +8616,7 @@ compute_hash_table_after_reload (struct 
   clear_modify_mem_tables ();
 
   /* Some working arrays used to track first and last set in each block.  */
-  reg_avail_info = (struct reg_avail_info*)
-		   gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
+  reg_avail_info = gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
 
   for (i = 0; i < max_gcse_regno; ++i)
     reg_avail_info[i].last_bb = NULL;
Index: ggc-page.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-page.c,v
retrieving revision 1.91
diff -u -p -r1.91 ggc-page.c
--- ggc-page.c	11 Mar 2004 05:54:24 -0000	1.91
+++ ggc-page.c	21 Mar 2004 15:19:02 -0000
@@ -652,12 +652,12 @@ static inline char *
 alloc_anon (char *pref ATTRIBUTE_UNUSED, size_t size)
 {
 #ifdef HAVE_MMAP_ANON
-  char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE,
-			      MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  char *page = mmap (pref, size, PROT_READ | PROT_WRITE,
+		     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 #endif
 #ifdef HAVE_MMAP_DEV_ZERO
-  char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE,
-			      MAP_PRIVATE, G.dev_zero_fd, 0);
+  char *page = mmap (pref, size, PROT_READ | PROT_WRITE,
+		     MAP_PRIVATE, G.dev_zero_fd, 0);
 #endif
 
   if (page == (char *) MAP_FAILED)
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.252
diff -u -p -r1.252 integrate.c
--- integrate.c	20 Mar 2004 04:52:56 -0000	1.252
+++ integrate.c	21 Mar 2004 15:19:09 -0000
@@ -1667,11 +1667,11 @@ copy_insn_list (rtx insns, struct inline
 		  tree *mapped_block_p;
 
 		  mapped_block_p
-		    = (tree *) bsearch (NOTE_BLOCK (insn),
-					&VARRAY_TREE (map->block_map, 0),
-					map->block_map->elements_used,
-					sizeof (tree),
-					find_block);
+		    = bsearch (NOTE_BLOCK (insn),
+			       &VARRAY_TREE (map->block_map, 0),
+			       map->block_map->elements_used,
+			       sizeof (tree),
+			       find_block);
 
 		  if (!mapped_block_p)
 		    abort ();
Index: var-tracking.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/var-tracking.c,v
retrieving revision 2.11
diff -u -p -r2.11 var-tracking.c
--- var-tracking.c	11 Mar 2004 08:05:14 -0000	2.11
+++ var-tracking.c	21 Mar 2004 15:19:14 -0000
@@ -1297,8 +1297,8 @@ dataflow_set_different_1 (void **slot, v
   variable var1, var2;
 
   var1 = *(variable *) slot;
-  var2 = (variable) htab_find_with_hash (htab, var1->decl,
-					 VARIABLE_HASH_VAL (var1->decl));
+  var2 = htab_find_with_hash (htab, var1->decl,
+			      VARIABLE_HASH_VAL (var1->decl));
   if (!var2)
     {
       dataflow_set_different_value = true;
@@ -1329,8 +1329,8 @@ dataflow_set_different_2 (void **slot, v
   variable var1, var2;
 
   var1 = *(variable *) slot;
-  var2 = (variable) htab_find_with_hash (htab, var1->decl,
-					 VARIABLE_HASH_VAL (var1->decl));
+  var2 = htab_find_with_hash (htab, var1->decl,
+			      VARIABLE_HASH_VAL (var1->decl));
   if (!var2)
     {
       dataflow_set_different_value = true;
@@ -1671,8 +1671,8 @@ vt_find_locations (void)
 
   /* Compute reverse completion order of depth first search of the CFG
      so that the data-flow runs faster.  */
-  rc_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
-  bb_order = (int *) xmalloc (last_basic_block * sizeof (int));
+  rc_order = xmalloc (n_basic_blocks * sizeof (int));
+  bb_order = xmalloc (last_basic_block * sizeof (int));
   flow_depth_first_order_compute (NULL, rc_order);
   for (i = 0; i < n_basic_blocks; i++)
     bb_order[rc_order[i]] = i;
@@ -2272,8 +2272,8 @@ emit_notes_for_differences_1 (void **slo
   variable old_var, new_var;
 
   old_var = *(variable *) slot;
-  new_var = (variable) htab_find_with_hash (new_vars, old_var->decl,
-					    VARIABLE_HASH_VAL (old_var->decl));
+  new_var = htab_find_with_hash (new_vars, old_var->decl,
+				 VARIABLE_HASH_VAL (old_var->decl));
 
   if (!new_var)
     {
@@ -2305,8 +2305,8 @@ emit_notes_for_differences_2 (void **slo
   variable old_var, new_var;
 
   new_var = *(variable *) slot;
-  old_var = (variable) htab_find_with_hash (old_vars, new_var->decl,
-					    VARIABLE_HASH_VAL (new_var->decl));
+  old_var = htab_find_with_hash (old_vars, new_var->decl,
+				 VARIABLE_HASH_VAL (new_var->decl));
   if (!old_var)
     {
       /* Variable has appeared.  */
Index: web.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/web.c,v
retrieving revision 2.7
diff -u -p -r2.7 web.c
--- web.c	15 Mar 2004 18:20:40 -0000	2.7
+++ web.c	21 Mar 2004 15:19:14 -0000
@@ -267,12 +267,10 @@ web_main (void)
   df = df_init ();
   df_analyze (df, 0, DF_UD_CHAIN | DF_EQUIV_NOTES);
 
-  def_entry =
-    (struct web_entry *) xcalloc (df->n_defs, sizeof (struct web_entry));
-  use_entry =
-    (struct web_entry *) xcalloc (df->n_uses, sizeof (struct web_entry));
-  used = (char *) xcalloc (max, sizeof (char));
-  use_addressof = (char *) xcalloc (max, sizeof (char));
+  def_entry = xcalloc (df->n_defs, sizeof (struct web_entry));
+  use_entry = xcalloc (df->n_uses, sizeof (struct web_entry));
+  used = xcalloc (max, sizeof (char));
+  use_addressof = xcalloc (max, sizeof (char));
 
   if (dump_file)
     df_dump (df, DF_UD_CHAIN | DF_DU_CHAIN, dump_file);


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