From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Martin Ågren" <martin.agren@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 05/12] trace2: use designated initializers for "struct tr2_dst"
Date: Thu, 24 Feb 2022 10:33:00 +0100 [thread overview]
Message-ID: <patch-05.12-2caa1661da4-20220224T092805Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-00.12-00000000000-20220224T092805Z-avarab@gmail.com>
Convert the "static struct tr2_dst" assignments in trace2/* to use
designated initializers. I don't think it improves readability to
include the explicit 0-ing out of the
fd/initialized/need_close/too_many_files members, so let's have those
be initialized implicitly by the compiler.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
trace2/tr2_tgt_event.c | 4 +++-
trace2/tr2_tgt_normal.c | 4 +++-
trace2/tr2_tgt_perf.c | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index b5c63622d1e..c5c8cfbbaa0 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -10,7 +10,9 @@
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
-static struct tr2_dst tr2dst_event = { TR2_SYSENV_EVENT, 0, 0, 0, 0 };
+static struct tr2_dst tr2dst_event = {
+ .sysenv_var = TR2_SYSENV_EVENT,
+};
/*
* The version number of the JSON data generated by the EVENT target in this
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c
index c7992650018..c42fbade7f0 100644
--- a/trace2/tr2_tgt_normal.c
+++ b/trace2/tr2_tgt_normal.c
@@ -9,7 +9,9 @@
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
-static struct tr2_dst tr2dst_normal = { TR2_SYSENV_NORMAL, 0, 0, 0, 0 };
+static struct tr2_dst tr2dst_normal = {
+ .sysenv_var = TR2_SYSENV_NORMAL,
+};
/*
* Use the TR2_SYSENV_NORMAL_BRIEF setting to omit the "<time> <file>:<line>"
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index a2a0195e0f4..a1eff8bea31 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -11,7 +11,9 @@
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
-static struct tr2_dst tr2dst_perf = { TR2_SYSENV_PERF, 0, 0, 0, 0 };
+static struct tr2_dst tr2dst_perf = {
+ .sysenv_var = TR2_SYSENV_PERF,
+};
/*
* Use TR2_SYSENV_PERF_BRIEF to omit the "<time> <file>:<line>"
--
2.35.1.1157.g524e2d5a0db
next prev parent reply other threads:[~2022-02-24 9:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 9:32 [PATCH 00/12] c99: use more designated initializers Ævar Arnfjörð Bjarmason
2022-02-24 9:32 ` [PATCH 01/12] imap-send.c: use designated initializers for "struct imap_server_conf" Ævar Arnfjörð Bjarmason
2022-02-24 9:32 ` [PATCH 02/12] refs: use designated initializers for "struct ref_storage_be" Ævar Arnfjörð Bjarmason
2022-02-24 9:32 ` [PATCH 03/12] refs: use designated initializers for "struct ref_iterator_vtable" Ævar Arnfjörð Bjarmason
2022-02-24 9:32 ` [PATCH 04/12] trace2: use designated initializers for "struct tr2_tgt" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` Ævar Arnfjörð Bjarmason [this message]
2022-02-24 9:33 ` [PATCH 06/12] object-file: use designated initializers for "struct git_hash_algo" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 07/12] archive-*.c: use designated initializers for "struct archiver" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 08/12] userdiff.c: use designated initializers for "struct userdiff_driver" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 09/12] convert.c: use designated initializers for "struct stream_filter*" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 10/12] refspec.c: use designated initializers for "struct refspec_item" Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 11/12] misc *.c: use designated initializers for struct assignments Ævar Arnfjörð Bjarmason
2022-02-24 9:33 ` [PATCH 12/12] misc *.c: use designated initializers for "partial" " Ævar Arnfjörð Bjarmason
2022-02-24 19:22 ` [PATCH 00/12] c99: use more designated initializers Johannes Schindelin
2022-02-24 19:53 ` Junio C Hamano
2022-02-24 22:43 ` Ævar Arnfjörð Bjarmason
2022-02-25 0:03 ` 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-05.12-2caa1661da4-20220224T092805Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=martin.agren@gmail.com \
/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).