summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29a3eef)
raw | patch | inline | side by side (parent: 29a3eef)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Wed, 4 Jul 2007 18:05:46 +0000 (19:05 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Jul 2007 07:22:12 +0000 (00:22 -0700) |
The instances of xdemitconf_t were initialized member by member.
Instead, initialize them to all zero, so we do not have
to update those places each time we introduce a new member.
[jc: minimally fixed by getting rid of a new global]
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Instead, initialize them to all zero, so we do not have
to update those places each time we introduce a new member.
[jc: minimally fixed by getting rid of a new global]
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-blame.c | patch | blob | history | |
builtin-rerere.c | patch | blob | history | |
combine-diff.c | patch | blob | history | |
diff.c | patch | blob | history | |
merge-file.c | patch | blob | history | |
merge-tree.c | patch | blob | history |
diff --git a/builtin-blame.c b/builtin-blame.c
index da23a6f9c99e1db691ba9329ea33a320b56b6afc..0519339098f3258ae6cc2b50d30679a8cfc7f2c7 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
xdemitcb_t ecb;
xpp.flags = xdl_opts;
+ memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = context;
- xecfg.flags = 0;
ecb.outf = xdiff_outf;
ecb.priv = &state;
memset(&state, 0, sizeof(state));
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 29fb075d29d2deb849e51578e2818d44dbb2a0d5..01f3848f1429cca93a5953118a74276f7f66b065 100644 (file)
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
printf("--- a/%s\n+++ b/%s\n", label1, label2);
fflush(stdout);
xpp.flags = XDF_NEED_MINIMAL;
+ memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
- xecfg.flags = 0;
ecb.outf = outf;
xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
diff --git a/combine-diff.c b/combine-diff.c
index ea3ca5f950561a92fdd3be1a4ee4bbd726656118..ef622340a52afb3b31b1cdf678ae0a83fb85c923 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
parent_file.ptr = grab_blob(parent, &sz);
parent_file.size = sz;
xpp.flags = XDF_NEED_MINIMAL;
- xecfg.ctxlen = 0;
- xecfg.flags = 0;
+ memset(&xecfg, 0, sizeof(xecfg));
ecb.outf = xdiff_outf;
ecb.priv = &state;
memset(&state, 0, sizeof(state));
index 16ea7100dfba40f30b6f9024c90131cdcfaf9b4b..d10e848c792bba581d6bf3e30204a81204177983 100644 (file)
--- a/diff.c
+++ b/diff.c
mmfile_t minus, plus;
int i;
+ memset(&xecfg, 0, sizeof(xecfg));
minus.size = diff_words->minus.text.size;
minus.ptr = xmalloc(minus.size);
memcpy(minus.ptr, diff_words->minus.text.ptr, minus.size);
xpp.flags = XDF_NEED_MINIMAL;
xecfg.ctxlen = diff_words->minus.alloc + diff_words->plus.alloc;
- xecfg.flags = 0;
ecb.outf = xdiff_outf;
ecb.priv = diff_words;
diff_words->xm.consume = fn_out_diff_words_aux;
xdemitcb_t ecb;
struct emit_callback ecbdata;
+ memset(&xecfg, 0, sizeof(xecfg));
memset(&ecbdata, 0, sizeof(ecbdata));
ecbdata.label_path = lbl;
ecbdata.color_diff = o->color_diff;
xdemitconf_t xecfg;
xdemitcb_t ecb;
+ memset(&xecfg, 0, sizeof(xecfg));
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
- xecfg.ctxlen = 0;
- xecfg.flags = 0;
ecb.outf = xdiff_outf;
ecb.priv = diffstat;
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
xdemitconf_t xecfg;
xdemitcb_t ecb;
+ memset(&xecfg, 0, sizeof(xecfg));
xpp.flags = XDF_NEED_MINIMAL;
- xecfg.ctxlen = 0;
- xecfg.flags = 0;
ecb.outf = xdiff_outf;
ecb.priv = &data;
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
@@ -2780,6 +2779,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
struct diff_filepair *p = q->queue[i];
int len1, len2;
+ memset(&xecfg, 0, sizeof(xecfg));
if (p->status == 0)
return error("internal diff status error");
if (p->status == DIFF_STATUS_UNKNOWN)
diff --git a/merge-file.c b/merge-file.c
index 748d15c0e04c0d63fbe586ad59c795ddaf3dec92..1e031eafe0c70eec092a53e8ab291b9887622b0e 100644 (file)
--- a/merge-file.c
+++ b/merge-file.c
xdemitcb_t ecb;
xpp.flags = XDF_NEED_MINIMAL;
+ memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
xecfg.flags = XDL_EMIT_COMMON;
ecb.outf = common_outf;
diff --git a/merge-tree.c b/merge-tree.c
index 3b8d9e6887ae051bf61cc0833f97d83bb47a0bae..7d4f628444058d80e798e141285d558fb7104c5b 100644 (file)
--- a/merge-tree.c
+++ b/merge-tree.c
xdemitcb_t ecb;
xpp.flags = XDF_NEED_MINIMAL;
+ memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
- xecfg.flags = 0;
ecb.outf = show_outf;
ecb.priv = NULL;