summaryrefslogtreecommitdiff
path: root/gcc/gcov-io.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-10 19:02:21 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-10 19:02:21 +0000
commit834f169c095c2ebff5cb9d0376da2c5093e44be4 (patch)
tree854e36366a2cd453b70412c2e728a48810418a26 /gcc/gcov-io.c
parente77bfc93deabc0d487b9a212b57e7e4d42d3cdb4 (diff)
downloadgcc-834f169c095c2ebff5cb9d0376da2c5093e44be4.tar.gz
* defaults.h (GCOV_TYPE_SIZE): Remove.
* gcov-io.h (gcov_type): Set to specific mode int on target. (gcov_unsigned_t, gcov_position_t): New. (GCOV_TYPE_NODE): New. (GCOV_TAG_SUMMARY_LENGTH): Adjust. (GCOV_COUNTERS_SUMMABLE): New. (gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn, gcov_ctr_info, gcov_info): Adjust types. (gcov_var): Adjust types. (gcov_write_unsigned, gcov_write_tag, gcov_write_length, gcov_write_tag_length, gcov_write_summary, gcov_read_unsigned, gcov_read_summary): Adjust gcov types. (gcov_position, gcov_sync, gcov_seek): Adjust gcov types. * gcov-io.c (gcov_write_unsigned, gcov_write_tag, gcov_write_length, gcov_write_tag_length, gcov_write_summary, gcov_read_unsigned, gcov_read_summary): Adjust gcov types. * libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit, __gcov_init, __gcov_merge_add): Adjust gcov types. * coverage.c (ctr_merge_functions): Constify. (ctr_names): New. (read_counts_file): Adjust gcov types. Only summarize & merge summable counters. (coverage_counter_ref): Use GCOV_TYPE_NODE. (build_fn_info_type, build_fn_info_value, build_ctr_info_type, build_ctr_info_value, build_gcov_info): Adjust types. * profile.c (branch_prob): Adjust gcov types. * gcov_dump (dump_file): Adjust gcov types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov-io.c')
-rw-r--r--gcc/gcov-io.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 188d27a1bc4..d61cff392cd 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -181,7 +181,7 @@ gcov_write_bytes (unsigned bytes)
appropriately. */
GCOV_LINKAGE void
-gcov_write_unsigned (unsigned value)
+gcov_write_unsigned (gcov_unsigned_t value)
{
unsigned char *buffer = gcov_write_bytes (4);
unsigned ix;
@@ -261,10 +261,10 @@ gcov_write_string (const char *string)
/* Write a tag TAG and reserve space for the record length. Return a
value to be used for gcov_write_length. */
-GCOV_LINKAGE unsigned long
-gcov_write_tag (unsigned tag)
+GCOV_LINKAGE gcov_position_t
+gcov_write_tag (gcov_unsigned_t tag)
{
- unsigned long result = gcov_var.position;
+ gcov_position_t result = gcov_var.position;
unsigned char *buffer = gcov_write_bytes (8);
unsigned ix;
@@ -285,11 +285,11 @@ gcov_write_tag (unsigned tag)
overflow. */
GCOV_LINKAGE void
-gcov_write_length (unsigned long position)
+gcov_write_length (gcov_position_t position)
{
if (position)
{
- unsigned length = gcov_var.position - position - 8;
+ gcov_unsigned_t length = gcov_var.position - position - 8;
unsigned char *buffer = &gcov_var.buffer[position + 4];
unsigned ix;
@@ -300,12 +300,13 @@ gcov_write_length (unsigned long position)
}
}
}
-#endif
+
+#else /* IN_LIBGCOV */
/* Write a tag TAG and length LENGTH. */
GCOV_LINKAGE void
-gcov_write_tag_length (unsigned tag, unsigned length)
+gcov_write_tag_length (gcov_unsigned_t tag, gcov_unsigned_t length)
{
unsigned char *buffer = gcov_write_bytes (8);
unsigned ix;
@@ -325,19 +326,18 @@ gcov_write_tag_length (unsigned tag, unsigned length)
return;
}
-#if IN_LIBGCOV
/* Write a summary structure to the gcov file. Return non-zero on
overflow. */
GCOV_LINKAGE void
-gcov_write_summary (unsigned tag, const struct gcov_summary *summary)
+gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary *summary)
{
unsigned ix;
const struct gcov_ctr_summary *csum;
gcov_write_tag_length (tag, GCOV_TAG_SUMMARY_LENGTH);
gcov_write_unsigned (summary->checksum);
- for (csum = summary->ctrs, ix = GCOV_COUNTERS; ix--; csum++)
+ for (csum = summary->ctrs, ix = GCOV_COUNTERS_SUMMABLE; ix--; csum++)
{
gcov_write_unsigned (csum->num);
gcov_write_unsigned (csum->runs);
@@ -372,10 +372,10 @@ gcov_read_bytes (unsigned bytes)
/* Read unsigned value from a coverage file. Sets error flag on file
error, overflow flag on overflow */
-GCOV_LINKAGE unsigned
+GCOV_LINKAGE gcov_unsigned_t
gcov_read_unsigned ()
{
- unsigned value = 0;
+ gcov_unsigned_t value = 0;
unsigned ix;
const unsigned char *buffer = gcov_read_bytes (4);
@@ -442,7 +442,7 @@ gcov_read_summary (struct gcov_summary *summary)
struct gcov_ctr_summary *csum;
summary->checksum = gcov_read_unsigned ();
- for (csum = summary->ctrs, ix = GCOV_COUNTERS; ix--; csum++)
+ for (csum = summary->ctrs, ix = GCOV_COUNTERS_SUMMABLE; ix--; csum++)
{
csum->num = gcov_read_unsigned ();
csum->runs = gcov_read_unsigned ();