diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-24 10:33:07 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-24 16:00:33 -0800 |
commit | c829f5f85767079e3f7bf0c9fd36f916fb179fba (patch) | |
tree | c7f09937aeef5cf20eb37f9f8d37c2e50d661812 /builtin | |
parent | refspec.c: use designated initializers for "struct refspec_item" (diff) | |
download | tgif-c829f5f85767079e3f7bf0c9fd36f916fb179fba.tar.xz |
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fast-import.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 2b2e28bad7..2c244c68f7 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -176,8 +176,9 @@ static int global_argc; static const char **global_argv; /* Memory pools */ -static struct mem_pool fi_mem_pool = {NULL, 2*1024*1024 - - sizeof(struct mp_block), 0 }; +static struct mem_pool fi_mem_pool = { + .block_alloc = 2*1024*1024 - sizeof(struct mp_block), +}; /* Atom management */ static unsigned int atom_table_sz = 4451; @@ -205,7 +206,9 @@ static int import_marks_file_done; static int relative_marks_paths; /* Our last blob */ -static struct last_object last_blob = { STRBUF_INIT, 0, 0, 0 }; +static struct last_object last_blob = { + .data = STRBUF_INIT, + }; /* Tree management */ static unsigned int tree_entry_alloc = 1000; @@ -231,7 +234,10 @@ static struct tag *last_tag; static whenspec_type whenspec = WHENSPEC_RAW; static struct strbuf command_buf = STRBUF_INIT; static int unread_command_buf; -static struct recent_command cmd_hist = {&cmd_hist, &cmd_hist, NULL}; +static struct recent_command cmd_hist = { + .prev = &cmd_hist, + .next = &cmd_hist, +}; static struct recent_command *cmd_tail = &cmd_hist; static struct recent_command *rc_free; static unsigned int cmd_save = 100; |