* gas/mips/jal.d: Remove duplicate pattern.
[deliverable/binutils-gdb.git] / gprof / gmon_io.c
index bf74c263bd0ee6b1f1e251593a4e466346b79471..fbb89f50e72657cb2aadcbb2b219ceecb082cb07 100644 (file)
@@ -493,13 +493,13 @@ gmon_out_read (const char *filename)
       if (!histograms)
        {
          num_histograms = 1;
-         histograms = xmalloc (sizeof (struct histogram));
+         histograms = (struct histogram *) xmalloc (sizeof (struct histogram));
          histograms->lowpc = tmp.low_pc;
          histograms->highpc = tmp.high_pc;
          histograms->num_bins = hist_num_bins;
          hist_scale = (double)((tmp.high_pc - tmp.low_pc) / sizeof (UNIT))
            / hist_num_bins;
-         histograms->sample = xmalloc (hist_num_bins * sizeof (int));
+         histograms->sample = (int *) xmalloc (hist_num_bins * sizeof (int));
          memset (histograms->sample, 0, 
                  hist_num_bins * sizeof (int));
        }
@@ -551,8 +551,6 @@ gmon_out_read (const char *filename)
          cg_tally (from_pc, self_pc, count);
        }
 
-      fclose (ifp);
-
       if (hz == HZ_WRONG)
        {
          /* How many ticks per second?  If we can't tell, report
@@ -573,6 +571,9 @@ gmon_out_read (const char *filename)
       done (1);
     }
 
+  if (ifp != stdin)
+    fclose (ifp);
+
   if (output_style & STYLE_GMON_INFO)
     {
       printf (_("File `%s' (version %d) contains:\n"),
This page took 0.023409 seconds and 4 git commands to generate.