From 14e9f8794b3b7673e5b31ebe203c1ce0c2f7a943 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 2 Sep 2003 00:08:06 +0000 Subject: [PATCH] This version doesn't merge, but doesn't foo up the output either. --- report.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/report.c b/report.c index ed15679..6bfe2b1 100644 --- a/report.c +++ b/report.c @@ -224,10 +224,11 @@ void init_intern(const int count) return hashcount; } -static int merge(struct range_t *p, struct range_t *q, int nmatches) +static int merge_ranges(struct range_t *p, struct range_t *q, int nmatches) /* merge t into s, if the ranges in the match are compatible */ { int i; + return 0; /* * The general problem: you have two lists of shreds, of the same * lengths. Within each list, all shreds have the same hash. @@ -316,12 +317,12 @@ struct match_t *reduce_matches(int localdups) if (!heterogenous) continue; -#ifdef DEBUG - printf("%d has %d in its clique\n", np-obarray, nmatches); +#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 /* DEBUG */ +#endif /* ODEBUG */ /* passed all tests, keep this set of ranges */ new = (struct match_t *)malloc(sizeof(struct match_t)); #ifdef DEBUG @@ -342,6 +343,17 @@ struct match_t *reduce_matches(int localdups) } free(obarray); +#ifdef DEBUG + for (sp = reduced; sp->next; sp = sp->next) + { + struct range_t *rp; + + printf("Clique beginning at %d:\n", sp->index); + for (rp = sp->matches; rp < sp->matches + sp->nmatches; rp++) + printf("%s:%d:%d\n", rp->file, rp->start, rp->end); + } +#endif /* DEBUG */ + /* time to remove duplicates */ retry = 1; while (retry) @@ -360,7 +372,10 @@ struct match_t *reduce_matches(int localdups) if (sp->nmatches != tp->nmatches) continue; /* attempt the merge */ - if (!merge(sp->matches, tp->matches, sp->nmatches)) +#ifdef DEBUG + printf("Trying merge of %d into %d\n", tp->index, sp->index); +#endif /* DEBUG */ + if (!merge_ranges(sp->matches, tp->matches, sp->nmatches)) continue; /* merge succeeded, clean up */ #ifdef DEBUG -- 2.43.0