/* hist.c - Histogram related operations.
- Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2007
+ Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.
This file is part of GNU Binutils.
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
\f
-#include "libiberty.h"
#include "gprof.h"
+#include "libiberty.h"
#include "search_list.h"
#include "source.h"
#include "symtab.h"
static histogram *find_histogram (bfd_vma lowpc, bfd_vma highpc);
static histogram *find_histogram_for_pc (bfd_vma pc);
+histogram * histograms;
+unsigned num_histograms;
double hist_scale;
static char hist_dimension[16] = "seconds";
static char hist_dimension_abbrev = 's';
/* This is new record. Add it to global array and allocate space for
the samples. */
- histograms = xrealloc (histograms,
- sizeof (histogram) * (num_histograms + 1));
+ histograms = (struct histogram *)
+ xrealloc (histograms, sizeof (histogram) * (num_histograms + 1));
memcpy (histograms + num_histograms,
&n_record, sizeof (histogram));
record = &histograms[num_histograms];
if (bsd_style_output)
{
printf (_("\ngranularity: each sample hit covers %ld byte(s)"),
- (long) hist_scale * sizeof (UNIT));
+ (long) hist_scale * (long) sizeof (UNIT));
if (total_time > 0.0)
{
printf (_(" for %.2f%% of %.2f %s\n\n"),