]> git.ipfire.org Git - thirdparty/git.git/commitdiff
trace2: use designated initializers for "struct tr2_dst"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 24 Feb 2022 09:33:00 +0000 (10:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Feb 2022 23:58:55 +0000 (15:58 -0800)
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>
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c

index b5c63622d1e5598c02a32a01ece9c946ec6fa858..c5c8cfbbaa065bccfbc058efd9eaffc71507d011 100644 (file)
@@ -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
index c79926500187c4a5c0b18d775c83c47b7bed2858..c42fbade7f0381d4ca80c562f51a7864ceb5449e 100644 (file)
@@ -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>"
index a2a0195e0f4cacb1fa1c612a28fb298aa3991aa0..a1eff8bea3101aab10a2b2c4e2a655f2f498a5df 100644 (file)
@@ -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>"