Re: [PATCH 07/10] evolve: implement the git change command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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", \
		[...]



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux