git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Han-Wen Nienhuys" <hanwen@google.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 3/5] misc *.c: use designated initializers for struct assignments
Date: Thu, 17 Mar 2022 18:27:17 +0100	[thread overview]
Message-ID: <patch-3.5-11bfe9fabb4-20220317T171618Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.5-00000000000-20220317T171618Z-avarab@gmail.com>

Change a few miscellaneous non-designated initializer assignments to
use designated initializers.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 attr.c        | 2 +-
 notes-merge.c | 1 +
 object-file.c | 9 +++++----
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/attr.c b/attr.c
index 79adaa50ea1..9ad12578cce 100644
--- 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),
 };
 
 /*
diff --git a/notes-merge.c b/notes-merge.c
index 878b6c571b9..b4cc594a790 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -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"
 };
diff --git a/object-file.c b/object-file.c
index bdc5cbdd386..f0a75b3ff1e 100644
--- a/object-file.c
+++ b/object-file.c
@@ -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)
-- 
2.35.1.1384.g7d2906948a1


  parent reply	other threads:[~2022-03-17 17:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 17:27 [PATCH 0/5] refs: designated init & missing debug in ps/fetch-mirror-optim Ævar Arnfjörð Bjarmason
2022-03-17 17:27 ` [PATCH 1/5] refs: use designated initializers for "struct ref_storage_be" Ævar Arnfjörð Bjarmason
2022-03-17 17:27 ` [PATCH 2/5] refs: use designated initializers for "struct ref_iterator_vtable" Ævar Arnfjörð Bjarmason
2022-03-17 17:27 ` Ævar Arnfjörð Bjarmason [this message]
2022-03-17 17:27 ` [PATCH 4/5] packed-backend: remove stub BUG(...) functions Ævar Arnfjörð Bjarmason
2022-03-17 17:39   ` Junio C Hamano
2022-03-17 17:27 ` [PATCH 5/5] refs debug: add a wrapper for "read_symbolic_ref" Ævar Arnfjörð Bjarmason
2022-03-17 17:45 ` [PATCH 0/5] refs: designated init & missing debug in ps/fetch-mirror-optim Han-Wen Nienhuys
2022-03-18 12:40   ` Ævar Arnfjörð Bjarmason
2022-03-21 11:10   ` Patrick Steinhardt
2022-03-21 19:10     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-3.5-11bfe9fabb4-20220317T171618Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hanwen@google.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).