fsck.h: use designed initializers for FSCK_OPTIONS_{DEFAULT,STRICT}

Refactor the definitions of FSCK_OPTIONS_{DEFAULT,STRICT} to use designated initializers. This allows us to omit those fields that are initialized to 0 or NULL. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Mar 28, 2021 at 15:15 UTC d385784f89b3350db16380441bc8a18ebe54179a
1 file changed +8 -2
fsck.h
+8 -2
@@ -43,8 +43,14 @@ struct fsck_options {
43 kh_oid_map_t *object_names;
44 };
45
46 -#define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL, OIDSET_INIT }
47 -#define FSCK_OPTIONS_STRICT { NULL, fsck_error_function, 1, NULL, OIDSET_INIT }
46 +#define FSCK_OPTIONS_DEFAULT { \
47 + .skiplist = OIDSET_INIT, \
48 + .error_func = fsck_error_function \
49 +}
50 +#define FSCK_OPTIONS_STRICT { \
51 + .strict = 1, \
52 + .error_func = fsck_error_function, \
53 +}
54
55 /* descend in all linked child objects
56 * the return value is: