trace2: use designated initializers for "struct tr2_dst"

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

Ævar Arnfjörð Bjarmason committed Feb 24, 2022 at 10:33 UTC 4996e0b015bd1dbb921bc359438e1385e7c87fd7
3 files changed +9 -3
trace2/tr2_tgt_event.c
+3 -1
@@ -10,7 +10,9 @@
10 #include "trace2/tr2_tgt.h"
11 #include "trace2/tr2_tls.h"
12
13 -static struct tr2_dst tr2dst_event = { TR2_SYSENV_EVENT, 0, 0, 0, 0 };
13 +static struct tr2_dst tr2dst_event = {
14 + .sysenv_var = TR2_SYSENV_EVENT,
15 +};
16
17 /*
18 * The version number of the JSON data generated by the EVENT target in this
trace2/tr2_tgt_normal.c
+3 -1
@@ -9,7 +9,9 @@
9 #include "trace2/tr2_tgt.h"
10 #include "trace2/tr2_tls.h"
11
12 -static struct tr2_dst tr2dst_normal = { TR2_SYSENV_NORMAL, 0, 0, 0, 0 };
12 +static struct tr2_dst tr2dst_normal = {
13 + .sysenv_var = TR2_SYSENV_NORMAL,
14 +};
15
16 /*
17 * Use the TR2_SYSENV_NORMAL_BRIEF setting to omit the "<time> <file>:<line>"
trace2/tr2_tgt_perf.c
+3 -1
@@ -11,7 +11,9 @@
11 #include "trace2/tr2_tgt.h"
12 #include "trace2/tr2_tls.h"
13
14 -static struct tr2_dst tr2dst_perf = { TR2_SYSENV_PERF, 0, 0, 0, 0 };
14 +static struct tr2_dst tr2dst_perf = {
15 + .sysenv_var = TR2_SYSENV_PERF,
16 +};
17
18 /*
19 * Use TR2_SYSENV_PERF_BRIEF to omit the "<time> <file>:<line>"