Skip to content

Commit b4a5c5c

Browse files
phillipwoodgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 25e6190 commit b4a5c5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

diff.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,9 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
14971497
static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
14981498
const char *line, int len, unsigned flags)
14991499
{
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+
};
15011503

15021504
if (o->emitted_symbols)
15031505
append_emitted_diff_symbol(o, &e);

0 commit comments

Comments
 (0)