Skip to content

Commit c829f5f

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b3454e2 commit c829f5f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

builtin/fast-import.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ static int global_argc;
176176
static const char **global_argv;
177177

178178
/* 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+
};
181182

182183
/* Atom management */
183184
static unsigned int atom_table_sz = 4451;
@@ -205,7 +206,9 @@ static int import_marks_file_done;
205206
static int relative_marks_paths;
206207

207208
/* 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+
};
209212

210213
/* Tree management */
211214
static unsigned int tree_entry_alloc = 1000;
@@ -231,7 +234,10 @@ static struct tag *last_tag;
231234
static whenspec_type whenspec = WHENSPEC_RAW;
232235
static struct strbuf command_buf = STRBUF_INIT;
233236
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+
};
235241
static struct recent_command *cmd_tail = &cmd_hist;
236242
static struct recent_command *rc_free;
237243
static unsigned int cmd_save = 100;

0 commit comments

Comments
 (0)