@matheusbsbs / matheus-bagliano / commits / c279d7e986
Fork 0

xdl_diff: identify call sites.

This inserts a new function xdi_diff() that currently does not do anything other than calling the underlying xdl_diff() to the callchain of current callers of xdl_diff() function. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Dec 13, 2007 at 13:25 UTC c279d7e9869740a6d64b0d1d70f7968af68d2071
8 files changed +16 -10
builtin-blame.c
+1 -1
@@ -542,7 +542,7 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
542 state.ret->chunks = NULL;
543 state.ret->num = 0;
544
545 - xdl_diff(file_p, file_o, &xpp, &xecfg, &ecb);
545 + xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);
546
547 if (state.ret->num) {
548 struct chunk *chunk;
builtin-rerere.c
+1 -1
@@ -260,7 +260,7 @@ static int diff_two(const char *file1, const char *label1,
260 memset(&xecfg, 0, sizeof(xecfg));
261 xecfg.ctxlen = 3;
262 ecb.outf = outf;
263 - xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
263 + xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
264
265 free(minus.ptr);
266 free(plus.ptr);
combine-diff.c
+1 -1
@@ -226,7 +226,7 @@ static void combine_diff(const unsigned char *parent, mmfile_t *result_file,
226 state.num_parent = num_parent;
227 state.n = n;
228
229 - xdl_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
229 + xdi_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
230 free(parent_file.ptr);
231
232 /* Assign line numbers for this parent.
diff.c
+5 -5
@@ -439,7 +439,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
439 ecb.outf = xdiff_outf;
440 ecb.priv = diff_words;
441 diff_words->xm.consume = fn_out_diff_words_aux;
442 - xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
442 + xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
443
444 free(minus.ptr);
445 free(plus.ptr);
@@ -1393,7 +1393,7 @@ static void builtin_diff(const char *name_a,
1393 if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
1394 ecbdata.diff_words =
1395 xcalloc(1, sizeof(struct diff_words_data));
1396 - xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1396 + xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1397 if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
1398 free_diff_words_data(&ecbdata);
1399 }
@@ -1446,7 +1446,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
1446 xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
1447 ecb.outf = xdiff_outf;
1448 ecb.priv = diffstat;
1449 - xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1449 + xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1450 }
1451
1452 free_and_return:
@@ -1486,7 +1486,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
1486 xpp.flags = XDF_NEED_MINIMAL;
1487 ecb.outf = xdiff_outf;
1488 ecb.priv = &data;
1489 - xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1489 + xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1490 }
1491 free_and_return:
1492 diff_free_filespec_data(one);
@@ -2898,7 +2898,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
2898 xecfg.flags = XDL_EMIT_FUNCNAMES;
2899 ecb.outf = xdiff_outf;
2900 ecb.priv = &data;
2901 - xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
2901 + xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
2902 }
2903
2904 SHA1_Final(sha1, &ctx);
merge-file.c
+1 -1
@@ -71,7 +71,7 @@ static int generate_common_file(mmfile_t *res, mmfile_t *f1, mmfile_t *f2)
71 res->size = 0;
72
73 ecb.priv = res;
74 - return xdl_diff(f1, f2, &xpp, &xecfg, &ecb);
74 + return xdi_diff(f1, f2, &xpp, &xecfg, &ecb);
75 }
76
77 void *merge_file(struct blob *base, struct blob *our, struct blob *their, unsigned long *size)
merge-tree.c
+1 -1
@@ -119,7 +119,7 @@ static void show_diff(struct merge_list *entry)
119 if (!dst.ptr)
120 size = 0;
121 dst.size = size;
122 - xdl_diff(&src, &dst, &xpp, &xecfg, &ecb);
122 + xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
123 free(src.ptr);
124 free(dst.ptr);
125 }
xdiff-interface.c
+5
@@ -103,6 +103,11 @@ int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
103 return 0;
104 }
105
106 +int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *xecb)
107 +{
108 + return xdl_diff(mf1, mf2, xpp, xecfg, xecb);
109 +}
110 +
111 int read_mmfile(mmfile_t *ptr, const char *filename)
112 {
113 struct stat st;
xdiff-interface.h
+1
@@ -13,6 +13,7 @@ struct xdiff_emit_state {
13 unsigned long remainder_size;
14 };
15
16 +int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
17 int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf);
18 int parse_hunk_header(char *line, int len,
19 int *ob, int *on,