]> thyrsus.com Git - comparator.git/commitdiff
Fix bad printf format.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 11 Sep 2003 07:57:57 +0000 (07:57 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 11 Sep 2003 07:57:57 +0000 (07:57 +0000)
report.c

index 2128e56e874bec5e1b9dce0706044a052967327a..be17394e1df262bbf0d406c90da59c9dba781653 100644 (file)
--- 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);