From 4996e0b015bd1dbb921bc359438e1385e7c87fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 24 Feb 2022 10:33:00 +0100 Subject: [PATCH] trace2: use designated initializers for "struct tr2_dst" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- 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 "