diff: omit found pointer from emit_callback

We keep the actual data in the diff options, which are just as accessible. Remove the pointer stored in struct emit_callback for readability. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Sep 7, 2016 at 16:36 UTC ba16233ccd98ee8db6d418903102c8730d87dcc5
1 file changed +2 -4
diff.c
+2 -4
@@ -354,7 +354,6 @@ struct emit_callback {
354 const char **label_path;
355 struct diff_words_data *diff_words;
356 struct diff_options *opt;
357 - int *found_changesp;
357 struct strbuf *header;
358 };
359
@@ -722,7 +721,6 @@ static void emit_rewrite_diff(const char *name_a,
721
722 memset(&ecbdata, 0, sizeof(ecbdata));
723 ecbdata.color_diff = want_color(o->use_color);
725 - ecbdata.found_changesp = &o->found_changes;
724 ecbdata.ws_rule = whitespace_rule(name_b);
725 ecbdata.opt = o;
726 if (ecbdata.ws_rule & WS_BLANK_AT_EOF) {
@@ -1216,12 +1214,13 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
1214 struct diff_options *o = ecbdata->opt;
1215 const char *line_prefix = diff_line_prefix(o);
1216
1217 + o->found_changes = 1;
1218 +
1219 if (ecbdata->header) {
1220 fprintf(o->file, "%s", ecbdata->header->buf);
1221 strbuf_reset(ecbdata->header);
1222 ecbdata->header = NULL;
1223 }
1224 - *(ecbdata->found_changesp) = 1;
1224
1225 if (ecbdata->label_path[0]) {
1226 const char *name_a_tab, *name_b_tab;
@@ -2437,7 +2436,6 @@ static void builtin_diff(const char *name_a,
2436 memset(&ecbdata, 0, sizeof(ecbdata));
2437 ecbdata.label_path = lbl;
2438 ecbdata.color_diff = want_color(o->use_color);
2440 - ecbdata.found_changesp = &o->found_changes;
2439 ecbdata.ws_rule = whitespace_rule(name_b);
2440 if (ecbdata.ws_rule & WS_BLANK_AT_EOF)
2441 check_blank_at_eof(&mf1, &mf2, &ecbdata);