From: NeilBrown Date: Fri, 1 Mar 2013 05:52:10 +0000 (+1100) Subject: Remove duplicate definition of "csl_join" X-Git-Tag: v1.0~55 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=4b02cc6253836052571f23b51efb80da3dbbba4e;p=wiggle.git Remove duplicate definition of "csl_join" We really only need one of these. Signed-off-by: NeilBrown --- diff --git a/bestmatch.c b/bestmatch.c index 578dc0b..988a211 100644 --- a/bestmatch.c +++ b/bestmatch.c @@ -271,35 +271,6 @@ static void find_best(struct file *a, struct file *b, free(valloc); } -/* Join two csl lists together. - * Simply allocate new space and copy everything in. - */ -static struct csl *csl_join(struct csl *c1, struct csl *c2) -{ - struct csl *c, *cd, *rv; - int cnt; - - if (c1 == NULL) - return c2; - if (c2 == NULL) - return c1; - - cnt = 1; /* the sentinal */ - for (c = c1; c->len; c++) - cnt++; - for (c = c2; c->len; c++) - cnt++; - cd = rv = xmalloc(sizeof(*rv)*cnt); - for (c = c1; c->len; c++) - *cd++ = *c; - for (c = c2; c->len; c++) - *cd++ = *c; - cd->len = 0; - free(c1); - free(c2); - return rv; -} - /* * Reduce a file by discarding less interesting words * Words that end with a newline are interesting (so all words diff --git a/wiggle.h b/wiggle.h index 6541a27..89610cd 100644 --- a/wiggle.h +++ b/wiggle.h @@ -163,6 +163,7 @@ extern struct csl *diff_partial(struct file a, struct file b, int alo, int ahi, int blo, int bhi); extern struct csl *worddiff(struct stream f1, struct stream f2, struct file *fl1p, struct file *fl2p); +extern struct csl *csl_join(struct csl *c1, struct csl *c2); struct ci { int conflicts, wiggles, ignored;