Skip to content

Commit d385784

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fb79f5b commit d385784

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fsck.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ struct fsck_options {
4343
kh_oid_map_t *object_names;
4444
};
4545

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+
}
4854

4955
/* descend in all linked child objects
5056
* the return value is:

0 commit comments

Comments
 (0)