Thread (159 messages) 159 messages, 9 authors, 2021-03-28

Re: [PATCH v2 10/10] fsck.h: update FSCK_OPTIONS_* for object_name

From: Jeff King <hidden>
Date: 2021-02-18 19:59:46

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help