fast-import.c: use designated initializers for "partial" struct assignments

Change a few existing non-designated initializer assignments to use "partial" designated initializer assignments. I.e. we're now omitting the "NULL" or "0" fields and letting the initializer take care of them for us. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 24, 2022 at 10:33 UTC c829f5f85767079e3f7bf0c9fd36f916fb179fba
1 file changed +10 -4
builtin/fast-import.c
+10 -4
@@ -176,8 +176,9 @@ static int global_argc;
176 static const char **global_argv;
177
178 /* Memory pools */
179 -static struct mem_pool fi_mem_pool = {NULL, 2*1024*1024 -
180 - sizeof(struct mp_block), 0 };
179 +static struct mem_pool fi_mem_pool = {
180 + .block_alloc = 2*1024*1024 - sizeof(struct mp_block),
181 +};
182
183 /* Atom management */
184 static unsigned int atom_table_sz = 4451;
@@ -205,7 +206,9 @@ static int import_marks_file_done;
206 static int relative_marks_paths;
207
208 /* Our last blob */
208 -static struct last_object last_blob = { STRBUF_INIT, 0, 0, 0 };
209 +static struct last_object last_blob = {
210 + .data = STRBUF_INIT,
211 + };
212
213 /* Tree management */
214 static unsigned int tree_entry_alloc = 1000;
@@ -231,7 +234,10 @@ static struct tag *last_tag;
234 static whenspec_type whenspec = WHENSPEC_RAW;
235 static struct strbuf command_buf = STRBUF_INIT;
236 static int unread_command_buf;
234 -static struct recent_command cmd_hist = {&cmd_hist, &cmd_hist, NULL};
237 +static struct recent_command cmd_hist = {
238 + .prev = &cmd_hist,
239 + .next = &cmd_hist,
240 +};
241 static struct recent_command *cmd_tail = &cmd_hist;
242 static struct recent_command *rc_free;
243 static unsigned int cmd_save = 100;