Skip to content

Commit 9859305

Browse files
avargitster
authored andcommitted
trace2: use designated initializers for "struct tr2_tgt"
As with the preceding commit, change another set of file-level struct assignments to use designated initializers. As before the "= NULL" assignments are redundant, but we're keeping them for self-documentation purposes. The comments left to explain the pre-image can now be removed in favor of working code that relays the same information to the reader. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 518f705 commit 9859305

File tree

3 files changed

+90
-90
lines changed

3 files changed

+90
-90
lines changed

trace2/tr2_tgt_event.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -613,34 +613,34 @@ static void fn_data_json_fl(const char *file, int line,
613613
}
614614

615615
struct tr2_tgt tr2_tgt_event = {
616-
&tr2dst_event,
617-
618-
fn_init,
619-
fn_term,
620-
621-
fn_version_fl,
622-
fn_start_fl,
623-
fn_exit_fl,
624-
fn_signal,
625-
fn_atexit,
626-
fn_error_va_fl,
627-
fn_command_path_fl,
628-
fn_command_ancestry_fl,
629-
fn_command_name_fl,
630-
fn_command_mode_fl,
631-
fn_alias_fl,
632-
fn_child_start_fl,
633-
fn_child_exit_fl,
634-
fn_child_ready_fl,
635-
fn_thread_start_fl,
636-
fn_thread_exit_fl,
637-
fn_exec_fl,
638-
fn_exec_result_fl,
639-
fn_param_fl,
640-
fn_repo_fl,
641-
fn_region_enter_printf_va_fl,
642-
fn_region_leave_printf_va_fl,
643-
fn_data_fl,
644-
fn_data_json_fl,
645-
NULL, /* printf */
616+
.pdst = &tr2dst_event,
617+
618+
.pfn_init = fn_init,
619+
.pfn_term = fn_term,
620+
621+
.pfn_version_fl = fn_version_fl,
622+
.pfn_start_fl = fn_start_fl,
623+
.pfn_exit_fl = fn_exit_fl,
624+
.pfn_signal = fn_signal,
625+
.pfn_atexit = fn_atexit,
626+
.pfn_error_va_fl = fn_error_va_fl,
627+
.pfn_command_path_fl = fn_command_path_fl,
628+
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
629+
.pfn_command_name_fl = fn_command_name_fl,
630+
.pfn_command_mode_fl = fn_command_mode_fl,
631+
.pfn_alias_fl = fn_alias_fl,
632+
.pfn_child_start_fl = fn_child_start_fl,
633+
.pfn_child_exit_fl = fn_child_exit_fl,
634+
.pfn_child_ready_fl = fn_child_ready_fl,
635+
.pfn_thread_start_fl = fn_thread_start_fl,
636+
.pfn_thread_exit_fl = fn_thread_exit_fl,
637+
.pfn_exec_fl = fn_exec_fl,
638+
.pfn_exec_result_fl = fn_exec_result_fl,
639+
.pfn_param_fl = fn_param_fl,
640+
.pfn_repo_fl = fn_repo_fl,
641+
.pfn_region_enter_printf_va_fl = fn_region_enter_printf_va_fl,
642+
.pfn_region_leave_printf_va_fl = fn_region_leave_printf_va_fl,
643+
.pfn_data_fl = fn_data_fl,
644+
.pfn_data_json_fl = fn_data_json_fl,
645+
.pfn_printf_va_fl = NULL,
646646
};

trace2/tr2_tgt_normal.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -325,34 +325,34 @@ static void fn_printf_va_fl(const char *file, int line,
325325
}
326326

327327
struct tr2_tgt tr2_tgt_normal = {
328-
&tr2dst_normal,
329-
330-
fn_init,
331-
fn_term,
332-
333-
fn_version_fl,
334-
fn_start_fl,
335-
fn_exit_fl,
336-
fn_signal,
337-
fn_atexit,
338-
fn_error_va_fl,
339-
fn_command_path_fl,
340-
fn_command_ancestry_fl,
341-
fn_command_name_fl,
342-
fn_command_mode_fl,
343-
fn_alias_fl,
344-
fn_child_start_fl,
345-
fn_child_exit_fl,
346-
fn_child_ready_fl,
347-
NULL, /* thread_start */
348-
NULL, /* thread_exit */
349-
fn_exec_fl,
350-
fn_exec_result_fl,
351-
fn_param_fl,
352-
fn_repo_fl,
353-
NULL, /* region_enter */
354-
NULL, /* region_leave */
355-
NULL, /* data */
356-
NULL, /* data_json */
357-
fn_printf_va_fl,
328+
.pdst = &tr2dst_normal,
329+
330+
.pfn_init = fn_init,
331+
.pfn_term = fn_term,
332+
333+
.pfn_version_fl = fn_version_fl,
334+
.pfn_start_fl = fn_start_fl,
335+
.pfn_exit_fl = fn_exit_fl,
336+
.pfn_signal = fn_signal,
337+
.pfn_atexit = fn_atexit,
338+
.pfn_error_va_fl = fn_error_va_fl,
339+
.pfn_command_path_fl = fn_command_path_fl,
340+
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
341+
.pfn_command_name_fl = fn_command_name_fl,
342+
.pfn_command_mode_fl = fn_command_mode_fl,
343+
.pfn_alias_fl = fn_alias_fl,
344+
.pfn_child_start_fl = fn_child_start_fl,
345+
.pfn_child_exit_fl = fn_child_exit_fl,
346+
.pfn_child_ready_fl = fn_child_ready_fl,
347+
.pfn_thread_start_fl = NULL,
348+
.pfn_thread_exit_fl = NULL,
349+
.pfn_exec_fl = fn_exec_fl,
350+
.pfn_exec_result_fl = fn_exec_result_fl,
351+
.pfn_param_fl = fn_param_fl,
352+
.pfn_repo_fl = fn_repo_fl,
353+
.pfn_region_enter_printf_va_fl = NULL,
354+
.pfn_region_leave_printf_va_fl = NULL,
355+
.pfn_data_fl = NULL,
356+
.pfn_data_json_fl = NULL,
357+
.pfn_printf_va_fl = fn_printf_va_fl,
358358
};

trace2/tr2_tgt_perf.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -549,34 +549,34 @@ static void fn_printf_va_fl(const char *file, int line,
549549
}
550550

551551
struct tr2_tgt tr2_tgt_perf = {
552-
&tr2dst_perf,
553-
554-
fn_init,
555-
fn_term,
556-
557-
fn_version_fl,
558-
fn_start_fl,
559-
fn_exit_fl,
560-
fn_signal,
561-
fn_atexit,
562-
fn_error_va_fl,
563-
fn_command_path_fl,
564-
fn_command_ancestry_fl,
565-
fn_command_name_fl,
566-
fn_command_mode_fl,
567-
fn_alias_fl,
568-
fn_child_start_fl,
569-
fn_child_exit_fl,
570-
fn_child_ready_fl,
571-
fn_thread_start_fl,
572-
fn_thread_exit_fl,
573-
fn_exec_fl,
574-
fn_exec_result_fl,
575-
fn_param_fl,
576-
fn_repo_fl,
577-
fn_region_enter_printf_va_fl,
578-
fn_region_leave_printf_va_fl,
579-
fn_data_fl,
580-
fn_data_json_fl,
581-
fn_printf_va_fl,
552+
.pdst = &tr2dst_perf,
553+
554+
.pfn_init = fn_init,
555+
.pfn_term = fn_term,
556+
557+
.pfn_version_fl = fn_version_fl,
558+
.pfn_start_fl = fn_start_fl,
559+
.pfn_exit_fl = fn_exit_fl,
560+
.pfn_signal = fn_signal,
561+
.pfn_atexit = fn_atexit,
562+
.pfn_error_va_fl = fn_error_va_fl,
563+
.pfn_command_path_fl = fn_command_path_fl,
564+
.pfn_command_ancestry_fl = fn_command_ancestry_fl,
565+
.pfn_command_name_fl = fn_command_name_fl,
566+
.pfn_command_mode_fl = fn_command_mode_fl,
567+
.pfn_alias_fl = fn_alias_fl,
568+
.pfn_child_start_fl = fn_child_start_fl,
569+
.pfn_child_exit_fl = fn_child_exit_fl,
570+
.pfn_child_ready_fl = fn_child_ready_fl,
571+
.pfn_thread_start_fl = fn_thread_start_fl,
572+
.pfn_thread_exit_fl = fn_thread_exit_fl,
573+
.pfn_exec_fl = fn_exec_fl,
574+
.pfn_exec_result_fl = fn_exec_result_fl,
575+
.pfn_param_fl = fn_param_fl,
576+
.pfn_repo_fl = fn_repo_fl,
577+
.pfn_region_enter_printf_va_fl = fn_region_enter_printf_va_fl,
578+
.pfn_region_leave_printf_va_fl = fn_region_leave_printf_va_fl,
579+
.pfn_data_fl = fn_data_fl,
580+
.pfn_data_json_fl = fn_data_json_fl,
581+
.pfn_printf_va_fl = fn_printf_va_fl,
582582
};

0 commit comments

Comments
 (0)