Thread (84 messages) 84 messages, 5 authors, 2021-12-09

[PATCH v4 14/15] diff: use designated initializers for emitted_diff_symbol

flat view
STALE1772d SUPERSEDED

From: Phillip Wood via GitGitGadget <hidden>
Date: 2021-11-16 09:50:28
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v4 of 3 in this series.

Revisions (3)
  1. v3 [diff vs current]
  2. v4 current
  3. v5 [diff vs current]
From: Phillip Wood <redacted>

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 <redacted>
---
 diff.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/diff.c b/diff.c
index 2085c063675..9ef88d7665a 100644
--- a/diff.c
+++ b/diff.c
@@ -1497,7 +1497,9 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
 static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
 			     const char *line, int len, unsigned flags)
 {
-	struct emitted_diff_symbol e = {line, len, flags, 0, 0, s};
+	struct emitted_diff_symbol e = {
+		.line = line, .len = len, .flags = flags, .s = s
+	};
 
 	if (o->emitted_symbols)
 		append_emitted_diff_symbol(o, &e);
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help