used new xcalloc where appropriate
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 23 Dec 2004 15:29:27 +0000 (15:29 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 23 Dec 2004 15:29:27 +0000 (15:29 +0000)
[r4750]

ir/ir/irdumptxt.c

index 8a79d24..7d6a609 100644 (file)
@@ -526,8 +526,7 @@ void    dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    L_freq = xmalloc(sizeof(*L_freq) * 4 * max_depth);
-    memset(L_freq, 0, sizeof(*L_freq) * 4 * max_depth);
+    L_freq = xcalloc(4 * max_depth, sizeof(L_freq[0]));
 
     S_freq  = L_freq + 1*max_depth;
     LA_freq = L_freq + 2*max_depth;
@@ -643,8 +642,7 @@ void    dump_entitycsv_to_file_prefix (FILE *F, entity *ent, char *prefix, unsig
     max_depth = (depth > max_depth) ? depth : max_depth ;
   }
 
-  L_freq = xmalloc(sizeof(*L_freq) * 4 * max_depth);
-  memset(L_freq, 0, sizeof(*L_freq) * 4 * max_depth);
+  L_freq = xcalloc(4 * max_depth, sizeof(L_freq[0]));
 
   S_freq  = L_freq + 1*max_depth;
   LA_freq = L_freq + 2*max_depth;
@@ -721,8 +719,7 @@ void dump_typecsv_to_file(FILE *F, type *tp, dump_verbosity verbosity, const cha
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    freq = xmalloc(sizeof(*freq) * 2 * max_depth);
-    memset(freq, 0, sizeof(*freq) * 2 * max_depth);
+    freq = xcalloc(2 * max_depth, sizeof(freq[0]));
 
     disp = freq + max_depth;
 
@@ -848,8 +845,7 @@ void dump_type_to_file (FILE *F, type *tp, dump_verbosity verbosity) {
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    freq = xmalloc(sizeof(*freq) * max_depth);
-    memset(freq, 0, sizeof(*freq) * max_depth);
+    freq = xcalloc(max_depth, sizeof(freq[0]));
 
     for (i = 0; i < n_all; ++i) {
       ir_node *all = get_type_allocation(tp, i);