diff: use designated initializers for emitted_diff_symbol

This makes it clearer which fields are being explicitly initialized and will simplify the next commit where we add a new field to the struct. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Dec 9, 2021 at 10:30 UTC b4a5c5c419009c26935536fa7039ad5073acb237
1 file changed +3 -1
diff.c
+3 -1
@@ -1497,7 +1497,9 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
1497 static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
1498 const char *line, int len, unsigned flags)
1499 {
1500 - struct emitted_diff_symbol e = {line, len, flags, 0, 0, s};
1500 + struct emitted_diff_symbol e = {
1501 + .line = line, .len = len, .flags = flags, .s = s
1502 + };
1503
1504 if (o->emitted_symbols)
1505 append_emitted_diff_symbol(o, &e);