From: Tom Tromey Date: Sun, 16 Jun 2019 20:06:18 +0000 (-0600) Subject: Inline constructors and initializers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63901aeccf923abaca02c8a58b1141d3859d7247;p=binutils-gdb.git Inline constructors and initializers This inlines the constructors and initializers for tui_cmd_window and tui_data_window. This makes the code a bit simpler. gdb/ChangeLog 2019-06-25 Tom Tromey * tui/tui-data.h (struct tui_data_window, struct tui_cmd_window): Inline constructor. Add initializers for members. * tui/tui-data.c (tui_data_window, tui_cmd_window): Remove constructors; now inline in class. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 62d12f04338..b529085e230 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2019-06-25 Tom Tromey + + * tui/tui-data.h (struct tui_data_window, struct tui_cmd_window): + Inline constructor. Add initializers for members. + * tui/tui-data.c (tui_data_window, tui_cmd_window): Remove + constructors; now inline in class. + 2019-06-25 Tom Tromey * tui/tui-regs.c (tui_show_registers): Update. diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 5cdbc686480..4ec3df4d537 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -495,23 +495,6 @@ tui_source_window_base::tui_source_window_base (enum tui_win_type type) start_line_or_addr.u.addr = 0; } -tui_data_window::tui_data_window () - : tui_win_info (DATA_WIN) -{ - data_content = NULL; - data_content_count = 0; - regs_content = NULL; - regs_content_count = 0; - regs_column_count = 1; - display_regs = false; - current_group = 0; -} - -tui_cmd_window::tui_cmd_window () - : tui_win_info (CMD_WIN) -{ -} - struct tui_win_info * tui_alloc_win_info (enum tui_win_type type) { diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 962db0d89bd..fad302bc9a4 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -346,19 +346,26 @@ protected: struct tui_data_window : public tui_win_info { - tui_data_window (); + tui_data_window () + : tui_win_info (DATA_WIN) + { + } + ~tui_data_window () override; DISABLE_COPY_AND_ASSIGN (tui_data_window); void clear_detail () override; - tui_win_content data_content; /* Start of data display content. */ - int data_content_count; - tui_win_content regs_content; /* Start of regs display content. */ - int regs_content_count; - int regs_column_count; - bool display_regs; /* Should regs be displayed at all? */ - struct reggroup *current_group; + /* Start of data display content. */ + tui_win_content data_content = NULL; + int data_content_count = 0; + /* Start of regs display content. */ + tui_win_content regs_content = NULL; + int regs_content_count = 0; + int regs_column_count = 0; + /* Should regs be displayed at all? */ + bool display_regs = false; + struct reggroup *current_group = nullptr; protected: @@ -372,12 +379,16 @@ protected: struct tui_cmd_window : public tui_win_info { - tui_cmd_window (); + tui_cmd_window () + : tui_win_info (CMD_WIN) + { + } + DISABLE_COPY_AND_ASSIGN (tui_cmd_window); void clear_detail () override; - int start_line; + int start_line = 0; protected: