Skip to content

Commit 5010364

Browse files
avargitster
authored andcommitted
misc *.c: use designated initializers for struct assignments
Change a few miscellaneous non-designated initializer assignments to use designated initializers. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e2f8acb commit 5010364

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static int attr_hash_entry_cmp(const void *unused_cmp_data,
8080
* Access to this dictionary must be surrounded with a mutex.
8181
*/
8282
static struct attr_hashmap g_attr_hashmap = {
83-
HASHMAP_INIT(attr_hash_entry_cmp, NULL)
83+
.map = HASHMAP_INIT(attr_hash_entry_cmp, NULL),
8484
};
8585

8686
/*

notes-merge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ static struct notes_merge_pair *find_notes_merge_pair_pos(
113113
}
114114

115115
static struct object_id uninitialized = {
116+
.hash =
116117
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" \
117118
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
118119
};

object-file.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,11 @@ static struct cached_object {
274274
static int cached_object_nr, cached_object_alloc;
275275

276276
static struct cached_object empty_tree = {
277-
{ EMPTY_TREE_SHA1_BIN_LITERAL },
278-
OBJ_TREE,
279-
"",
280-
0
277+
.oid = {
278+
.hash = EMPTY_TREE_SHA1_BIN_LITERAL,
279+
},
280+
.type = OBJ_TREE,
281+
.buf = "",
281282
};
282283

283284
static struct cached_object *find_cached_object(const struct object_id *oid)

0 commit comments

Comments
 (0)