Re: [PATCH v2 10/10] fsck.h: update FSCK_OPTIONS_* for object_name
- From
Jeff King <peff@peff.net>
- Date
- Feb 18, 2021, 19:56 UTC
- Message-ID
- <YC7GW8L+nJLFYHpY@coredump.intra.peff.net>
- In-Reply-To
- <20210218105840.11989-11-avarab@gmail.com>
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?
-Peff