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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Mar 17, 2022 at 18:27 UTC 501036492b74ad2f3bf9af70fc90056245b60525
3 files changed +7 -5
attr.c
+1 -1
@@ -80,7 +80,7 @@ static int attr_hash_entry_cmp(const void *unused_cmp_data,
80 * Access to this dictionary must be surrounded with a mutex.
81 */
82 static struct attr_hashmap g_attr_hashmap = {
83 - HASHMAP_INIT(attr_hash_entry_cmp, NULL)
83 + .map = HASHMAP_INIT(attr_hash_entry_cmp, NULL),
84 };
85
86 /*
notes-merge.c
+1
@@ -113,6 +113,7 @@ static struct notes_merge_pair *find_notes_merge_pair_pos(
113 }
114
115 static struct object_id uninitialized = {
116 + .hash =
117 "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" \
118 "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
119 };
object-file.c
+5 -4
@@ -274,10 +274,11 @@ static struct cached_object {
274 static int cached_object_nr, cached_object_alloc;
275
276 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 = "",
282 };
283
284 static struct cached_object *find_cached_object(const struct object_id *oid)