]> git.ipfire.org Git - thirdparty/git.git/commitdiff
misc *.c: use designated initializers for struct assignments
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 17 Mar 2022 17:27:17 +0000 (18:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Mar 2022 17:36:42 +0000 (10:36 -0700)
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>
attr.c
notes-merge.c
object-file.c

diff --git a/attr.c b/attr.c
index 79adaa50ea1e099fa7f8bee28efa6f7f7d92223b..9ad12578cce1dce4e5ea5de7a1fc5dbd13312bb2 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -80,7 +80,7 @@ static int attr_hash_entry_cmp(const void *unused_cmp_data,
  * Access to this dictionary must be surrounded with a mutex.
  */
 static struct attr_hashmap g_attr_hashmap = {
-       HASHMAP_INIT(attr_hash_entry_cmp, NULL)
+       .map = HASHMAP_INIT(attr_hash_entry_cmp, NULL),
 };
 
 /*
index 878b6c571b920aa1798b2e9f7298482ab05561d4..b4cc594a790965aca297fe87392a50b643e6fb41 100644 (file)
@@ -113,6 +113,7 @@ static struct notes_merge_pair *find_notes_merge_pair_pos(
 }
 
 static struct object_id uninitialized = {
+       .hash =
        "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" \
        "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
 };
index bdc5cbdd3868612fc7e0fb43d6268aaa1420b3f6..f0a75b3ff1e17354fe166be4167e0721ad2be536 100644 (file)
@@ -274,10 +274,11 @@ static struct cached_object {
 static int cached_object_nr, cached_object_alloc;
 
 static struct cached_object empty_tree = {
-       { EMPTY_TREE_SHA1_BIN_LITERAL },
-       OBJ_TREE,
-       "",
-       0
+       .oid = {
+               .hash = EMPTY_TREE_SHA1_BIN_LITERAL,
+       },
+       .type = OBJ_TREE,
+       .buf = "",
 };
 
 static struct cached_object *find_cached_object(const struct object_id *oid)