From 338564d7e2e015e84a49b295594c40ada938504e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 3 Sep 2003 09:50:33 +0000 Subject: [PATCH] Before trying to eliminate a data structure. --- report.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/report.c b/report.c index 4f87348..53b0ed4 100644 --- a/report.c +++ b/report.c @@ -197,12 +197,14 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int hashcount) if (!heterogenous) continue; -#ifdef ODEBUG - printf("*** %d has %d in its clique\n", np-obarray, nmatches); - for (i = 0; i < nmatches; i++) - printf("%d: %s:%d:%d\n", - np-obarray+i, np[i].file, np[i].hash.start, np[i].hash.end); -#endif /* ODEBUG */ + if (debug) + { + printf("*** %d has %d in its clique\n", np-obarray, nmatches); + for (i = 0; i < nmatches; i++) + printf("%d: %s:%d:%d\n", + np-obarray+i, np[i].file, np[i].hash.start, np[i].hash.end); + } + /* passed all tests, keep this set of ranges */ new = (struct match_t *)malloc(sizeof(struct match_t)); #ifdef DEBUG @@ -305,6 +307,7 @@ static int sortmatch(void *a, void *b) } void emit_report(struct sorthash_t *obarray, int hashcount) +/* report our results */ { struct match_t *hitlist, *sorted, *match; int i, matchcount; @@ -313,6 +316,7 @@ void emit_report(struct sorthash_t *obarray, int hashcount) { struct sorthash_t *np; + puts("Chunk list before reduction."); for (np = obarray; np < obarray + hashcount; np++) printf("%d: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x %s:%d:%d\n", np-obarray, -- 2.43.0