commit 50351dee7e55367d42b3a715d56abdd7751978cd from: Stefan Sperling date: Wed Oct 09 07:26:28 2019 UTC remove unused 'pr' argument from diff3.c's skip() function commit - f16e404405cee25eaeec2bebd3555ed373bb5b73 commit + 50351dee7e55367d42b3a715d56abdd7751978cd blob - 7b3015bc32189ec72ed2778f05c1bef25a72c0ce blob + 8209ffc7c20dc49e954d45dd67fc92248379c3f8 --- lib/diff3.c +++ lib/diff3.c @@ -159,8 +159,7 @@ static int number(char **); static const struct got_error *readin(size_t *, char *, struct diff **, struct diff3_state *); static int ed_patch_lines(struct rcs_lines *, struct rcs_lines *); -static const struct got_error *skip(int *, int, int, char *, - struct diff3_state *); +static const struct got_error *skip(int *, int, int, struct diff3_state *); static const struct got_error *edscript(int, struct diff3_state *); static const struct got_error *merge(size_t, size_t, struct diff3_state *); static const struct got_error *prange(struct range *, struct diff3_state *); @@ -821,12 +820,9 @@ prange(struct range *rold, struct diff3_state *d3s) return NULL; } -/* - * skip to just before line number from in file "i". If "pr" is non-NULL, - * print all skipped stuff with string pr as a prefix. - */ +/* skip to just before line number from in file "i". */ static const struct got_error * -skip(int *nskipped, int i, int from, char *pr, struct diff3_state *d3s) +skip(int *nskipped, int i, int from, struct diff3_state *d3s) { const struct got_error *err = NULL; size_t j, n; @@ -837,11 +833,6 @@ skip(int *nskipped, int i, int from, char *pr, struct err = get_line(&line, d3s->fp[i], &j, d3s); if (err) return err; - if (pr != NULL) { - err = diff_output(d3s->diffbuf, "%s%s", pr, line); - if (err) - return err; - } d3s->cline[i]++; } *nskipped = n; @@ -865,10 +856,10 @@ duplicate(int *dpl, struct range *r1, struct range *r2 if (r1->to - r1->from != r2->to - r2->from) return NULL; - err = skip(&nskipped, 0, r1->from, NULL, d3s); + err = skip(&nskipped, 0, r1->from, d3s); if (err) return err; - err = skip(&nskipped, 1, r2->from, NULL, d3s); + err = skip(&nskipped, 1, r2->from, d3s); if (err) return err; nchar = 0; @@ -922,11 +913,11 @@ edit(struct diff *diff, int fdup, int *j, struct diff3 d3s->overlapcnt++; d3s->de[*j].old.from = diff->old.from; d3s->de[*j].old.to = diff->old.to; - err = skip(&nskipped, 2, diff->new.from, NULL, d3s); + err = skip(&nskipped, 2, diff->new.from, d3s); if (err) return err; d3s->de[*j].new.from = d3s->de[*j - 1].new.to + nskipped; - err = skip(&nskipped, 2, diff->new.to, NULL, d3s); + err = skip(&nskipped, 2, diff->new.to, d3s); d3s->de[*j].new.to = d3s->de[*j].new.from + nskipped; return NULL; }