/* The functions in this file for creating and solution program flow graphs
are very similar to functions in the gcc source file profile.c. */
-char gcov_version_string[] = "GNU gcov version 1.5\n";
+static const char gcov_version_string[] = "GNU gcov version 1.5\n";
/* This is the size of the buffer used to read in source file lines. */
static void
fnotice VPARAMS ((FILE *file, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- FILE *file;
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, FILE *);
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, FILE *, file);
+ VA_FIXEDARG (ap, const char *, msgid);
vfprintf (file, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* More 'friendly' abort that prints the line and file.
}
-/* Reverse the arcs on a arc list. */
+/* Reverse the arcs on an arc list. */
static struct adj_list *
reverse_arcs (arcptr)
{
struct sourcefile *s_ptr = NULL;
char *ptr;
- int count;
+ long count;
long line_num;
/* Search the bb_data to find:
}
else if (line_num < 0)
{
- /* Don't know what this is, but it's garbage. */
+ /* Don't know what this is, but it's garbage. */
abort();
}
}
struct arcdata **branch_probs;
int last_line_num;
{
- int total;
+ gcov_type total;
struct adj_list *arcptr;
struct arcdata *end_ptr, *a_ptr;
char *source_file_name;
FILE *source_file;
struct bb_info_list *current_graph;
- int count;
+ long count;
char *cptr;
long block_num;
long line_num;
else
{
if (output_branch_counts)
- fnotice (gcov_file,
- "call %d returns = "
- HOST_WIDEST_INT_PRINT_DEC "\n",
- i, a_ptr->total - a_ptr->hits);
+ {
+ char c[20];
+ sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+ a_ptr->total - a_ptr->hits);
+ fnotice (gcov_file,
+ "call %d returns = %s\n", i, c);
+ }
else
- fnotice (gcov_file,
- "call %d returns = "
- HOST_WIDEST_INT_PRINT_DEC "%%\n",
- i, 100 - ((a_ptr->hits * 100) +
- (a_ptr->total >> 1))/a_ptr->total);
+ {
+ char c[20];
+ sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+ 100 - ((a_ptr->hits * 100)
+ + (a_ptr->total >> 1))
+ / a_ptr->total);
+ fnotice (gcov_file,
+ "call %d returns = %s%%\n", i, c);
+ }
}
}
else
else
{
if (output_branch_counts)
- fnotice (gcov_file,
- "branch %d taken = "
- HOST_WIDEST_INT_PRINT_DEC "\n",
- i, a_ptr->hits);
+ {
+ char c[20];
+ sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+ a_ptr->hits);
+ fnotice (gcov_file,
+ "branch %d taken = %s\n", i, c);
+ }
else
+ {
+ char c[20];
+ sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+ ((a_ptr->hits * 100)
+ + (a_ptr->total >> 1))
+ / a_ptr->total);
fnotice (gcov_file,
- "branch %d taken = "
- HOST_WIDEST_INT_PRINT_DEC "%%\n", i,
- ((a_ptr->hits * 100) +
- (a_ptr->total >> 1))/
- a_ptr->total);
-
+ "branch %d taken = %s%%\n", i, c);
+ }
}
}
}