On Sun, Sep 25 2022, Phillip Wood wrote: > Hi Chris > > On 23/09/2022 19:55, Stefan Xenos via GitGitGadget wrote: >> From: Stefan Xenos <sxenos@xxxxxxxxxx> >> +static void init_update_state(struct update_state *state) >> +{ >> + memset(state, 0, sizeof(*state)); >> + state->content = "HEAD"; >> + string_list_init_nodup(&state->replace); >> + string_list_init_nodup(&state->origin); >> +} > > In general we prefer to use initializer macros over functions. So this > would become > > #define UPDATE_STATE_INIT { \ > .content = "HEAD", \ > .replace = STRING_LIST_INIT_NODUP, \ > .origin = STRING_LIST_INIT_NODUP \ > } *nod*, although our usual style is not to indent the "\"'s like that. But just: #define FOO { \ .bar = "baz", \ [...]