From: Eric S. Raymond Date: Thu, 11 Sep 2003 07:57:57 +0000 (+0000) Subject: Fix bad printf format. X-Git-Tag: 1.3~22 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=4c54617d39ac53c52bd4085ea6d7637cc5f6bb5e;p=comparator.git Fix bad printf format. --- diff --git a/report.c b/report.c index 2128e56..be17394 100644 --- a/report.c +++ b/report.c @@ -104,11 +104,12 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int hashcount) { static struct match_t dummy; struct match_t *reduced = &dummy, *sp, *tp; - unsigned int retry, nonuniques; + unsigned int retry, nonuniques, progress; struct sorthash_t *np; /* build list of hashes with more than one range associated with */ - nonuniques = 0; + nonuniques = progress = 0; + fprintf(stderr, "%% Extracting duplicates... "); for (np = obarray; np < obarray + hashcount; np++) { if (np < obarray + hashcount - 1 && !HASHCMP(np, np+1)) @@ -117,6 +118,9 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int hashcount) int i, heterogenous, nmatches; struct sorthash_t *mp; + if (!debug && progress++ % 10000 == 0) + fprintf(stderr, "\b\b\b%02.0f%%", progress / (hashcount * 0.01)); + /* count the number of hash matches */ nmatches = 1; for (mp = np+1; mp < obarray + hashcount; mp++) @@ -161,6 +165,7 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int hashcount) } } free(obarray); + fprintf(stderr, "\b\b\b100%% done."); report_time("%d range groups after removing unique hashes", nonuniques);