Skip to content

Commit 6b6f5d4

Browse files
committed
Merge branch 'maint-1.7.0' into maint
* maint-1.7.0: remove ecb parameter from xdi_diff_outf()
2 parents 2b873e0 + dfea790 commit 6b6f5d4

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

combine-diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
211211
xpparam_t xpp;
212212
xdemitconf_t xecfg;
213213
mmfile_t parent_file;
214-
xdemitcb_t ecb;
215214
struct combine_diff_state state;
216215
unsigned long sz;
217216

@@ -231,7 +230,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
231230
state.n = n;
232231

233232
xdi_diff_outf(&parent_file, result_file, consume_line, &state,
234-
&xpp, &xecfg, &ecb);
233+
&xpp, &xecfg);
235234
free(parent_file.ptr);
236235

237236
/* Assign line numbers for this parent.

diff.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ static void diff_words_show(struct diff_words_data *diff_words)
700700
{
701701
xpparam_t xpp;
702702
xdemitconf_t xecfg;
703-
xdemitcb_t ecb;
704703
mmfile_t minus, plus;
705704

706705
/* special case: only removal */
@@ -722,7 +721,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
722721
/* as only the hunk header will be parsed, we need a 0-context */
723722
xecfg.ctxlen = 0;
724723
xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
725-
&xpp, &xecfg, &ecb);
724+
&xpp, &xecfg);
726725
free(minus.ptr);
727726
free(plus.ptr);
728727
if (diff_words->current_plus != diff_words->plus.text.ptr +
@@ -1708,7 +1707,6 @@ static void builtin_diff(const char *name_a,
17081707
const char *diffopts = getenv("GIT_DIFF_OPTS");
17091708
xpparam_t xpp;
17101709
xdemitconf_t xecfg;
1711-
xdemitcb_t ecb;
17121710
struct emit_callback ecbdata;
17131711
const struct userdiff_funcname *pe;
17141712

@@ -1780,7 +1778,7 @@ static void builtin_diff(const char *name_a,
17801778
}
17811779
}
17821780
xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata,
1783-
&xpp, &xecfg, &ecb);
1781+
&xpp, &xecfg);
17841782
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
17851783
free_diff_words_data(&ecbdata);
17861784
if (textconv_one)
@@ -1833,13 +1831,12 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
18331831
/* Crazy xdl interfaces.. */
18341832
xpparam_t xpp;
18351833
xdemitconf_t xecfg;
1836-
xdemitcb_t ecb;
18371834

18381835
memset(&xpp, 0, sizeof(xpp));
18391836
memset(&xecfg, 0, sizeof(xecfg));
18401837
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
18411838
xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
1842-
&xpp, &xecfg, &ecb);
1839+
&xpp, &xecfg);
18431840
}
18441841

18451842
free_and_return:
@@ -1881,14 +1878,13 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
18811878
/* Crazy xdl interfaces.. */
18821879
xpparam_t xpp;
18831880
xdemitconf_t xecfg;
1884-
xdemitcb_t ecb;
18851881

18861882
memset(&xpp, 0, sizeof(xpp));
18871883
memset(&xecfg, 0, sizeof(xecfg));
18881884
xecfg.ctxlen = 1; /* at least one context line */
18891885
xpp.flags = XDF_NEED_MINIMAL;
18901886
xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
1891-
&xpp, &xecfg, &ecb);
1887+
&xpp, &xecfg);
18921888

18931889
if (data.ws_rule & WS_BLANK_AT_EOF) {
18941890
struct emit_callback ecbdata;
@@ -3383,7 +3379,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
33833379
for (i = 0; i < q->nr; i++) {
33843380
xpparam_t xpp;
33853381
xdemitconf_t xecfg;
3386-
xdemitcb_t ecb;
33873382
mmfile_t mf1, mf2;
33883383
struct diff_filepair *p = q->queue[i];
33893384
int len1, len2;
@@ -3445,7 +3440,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
34453440
xecfg.ctxlen = 3;
34463441
xecfg.flags = XDL_EMIT_FUNCNAMES;
34473442
xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
3448-
&xpp, &xecfg, &ecb);
3443+
&xpp, &xecfg);
34493444
}
34503445

34513446
git_SHA1_Final(sha1, &ctx);

xdiff-interface.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,20 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
138138

139139
int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
140140
xdiff_emit_consume_fn fn, void *consume_callback_data,
141-
xpparam_t const *xpp,
142-
xdemitconf_t const *xecfg, xdemitcb_t *xecb)
141+
xpparam_t const *xpp, xdemitconf_t const *xecfg)
143142
{
144143
int ret;
145144
struct xdiff_emit_state state;
145+
xdemitcb_t ecb;
146146

147147
memset(&state, 0, sizeof(state));
148148
state.consume = fn;
149149
state.consume_callback_data = consume_callback_data;
150-
xecb->outf = xdiff_outf;
151-
xecb->priv = &state;
150+
memset(&ecb, 0, sizeof(ecb));
151+
ecb.outf = xdiff_outf;
152+
ecb.priv = &state;
152153
strbuf_init(&state.remainder, 0);
153-
ret = xdi_diff(mf1, mf2, xpp, xecfg, xecb);
154+
ret = xdi_diff(mf1, mf2, xpp, xecfg, &ecb);
154155
strbuf_release(&state.remainder);
155156
return ret;
156157
}

xdiff-interface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ typedef void (*xdiff_emit_hunk_consume_fn)(void *, long, long, long);
99
int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
1010
int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
1111
xdiff_emit_consume_fn fn, void *consume_callback_data,
12-
xpparam_t const *xpp,
13-
xdemitconf_t const *xecfg, xdemitcb_t *xecb);
12+
xpparam_t const *xpp, xdemitconf_t const *xecfg);
1413
int xdi_diff_hunks(mmfile_t *mf1, mmfile_t *mf2,
1514
xdiff_emit_hunk_consume_fn fn, void *consume_callback_data,
1615
xpparam_t const *xpp, xdemitconf_t *xecfg);

0 commit comments

Comments
 (0)