Re: [PATCH v2 10/10] fsck.h: update FSCK_OPTIONS_* for object_name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 18, 2021, 22:33 UTC
- Message-ID
- <xmqqh7m9c8gx.fsf@gitster.g>
- In-Reply-To
- <YC7GW8L+nJLFYHpY@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 24 quoted lines
> On Thu, Feb 18, 2021 at 11:58:40AM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> Add the object_name member to the initialization macro. This was
>> omitted in 7b35efd734e (fsck_walk(): optionally name objects on the
>> go, 2016-07-17) when the field was added.
>
> We're correct either way here, because trailing fields that are not
> initialized will get the usual zero-initialization. But I don't mind
> trying to be more complete.
>
> That said, we have embraced designated initializers these days, in which
> case we usually omit the NULL ones. So perhaps:
>
> #define FSCK_OPTIONS_DEFAULT { \
> .walk = fsck_error_function, \
> .skiplist = OIDSET_INIT, \
> }
> #define FSCK_OPTIONS_STRICT { \
> .walk = fsck_error_function, \
> .skiplist = OIDSET_INIT, \
> .strict = 1, \
> }
>
> would be more readable still?Ahh, I should probably have read your reviews first before reading patches myself ;-)
Thanks.