]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck.h: use designed initializers for FSCK_OPTIONS_{DEFAULT,STRICT}
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 28 Mar 2021 13:15:34 +0000 (15:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Mar 2021 02:02:59 +0000 (19:02 -0700)
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>
fsck.h

diff --git a/fsck.h b/fsck.h
index f70d11c5594d0489023a90676e5b187201c96347..73e8b9f3e4ef3b9efdf153931aa974e76de3012b 100644 (file)
--- a/fsck.h
+++ b/fsck.h
@@ -43,8 +43,14 @@ struct fsck_options {
        kh_oid_map_t *object_names;
 };
 
-#define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL, OIDSET_INIT }
-#define FSCK_OPTIONS_STRICT { NULL, fsck_error_function, 1, NULL, OIDSET_INIT }
+#define FSCK_OPTIONS_DEFAULT { \
+       .skiplist = OIDSET_INIT, \
+       .error_func = fsck_error_function \
+}
+#define FSCK_OPTIONS_STRICT { \
+       .strict = 1, \
+       .error_func = fsck_error_function, \
+}
 
 /* descend in all linked child objects
  * the return value is: