From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 9EBB1386EC38; Thu, 7 Apr 2022 15:08:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EBB1386EC38 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: switch to using 'const reggroup *' in tui-regs.{c, h} X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: dbf5d61bdad9131d31c3410f123db3e296d91dfc X-Git-Newrev: 711898e128ab036b752d1bc8df1d61ae62ade5cd Message-Id: <20220407150801.9EBB1386EC38@sourceware.org> Date: Thu, 7 Apr 2022 15:08:01 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 15:08:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D711898e128ab= 036b752d1bc8df1d61ae62ade5cd commit 711898e128ab036b752d1bc8df1d61ae62ade5cd Author: Andrew Burgess Date: Thu Mar 31 12:49:50 2022 +0100 gdb: switch to using 'const reggroup *' in tui-regs.{c,h} =20 Make uses of 'reggroup *' const throughout tui-regs.{c,h}. =20 There should be no user visible changes after this commit. Diff: --- gdb/tui/tui-regs.c | 22 +++++++++++----------- gdb/tui/tui-regs.h | 9 +++++---- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 190985321eb..5c6189a59b1 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -177,7 +177,7 @@ tui_data_window::first_reg_element_no_inline (int line_= no) const /* Show the registers of the given group in the data window and refresh the window. */ void -tui_data_window::show_registers (struct reggroup *group) +tui_data_window::show_registers (const reggroup *group) { if (group =3D=3D 0) group =3D general_reggroup; @@ -207,7 +207,7 @@ tui_data_window::show_registers (struct reggroup *group) refresh_values_only is true. */ =20 void -tui_data_window::show_register_group (struct reggroup *group, +tui_data_window::show_register_group (const reggroup *group, struct frame_info *frame,=20 bool refresh_values_only) { @@ -518,10 +518,10 @@ tui_data_item_window::rerender (WINDOW *handle, int f= ield_width) around behaviour. Returns the next register group, or NULL if the register window is not currently being displayed. */ =20 -static struct reggroup * -tui_reg_next (struct reggroup *current_group, struct gdbarch *gdbarch) +static const reggroup * +tui_reg_next (const reggroup *current_group, struct gdbarch *gdbarch) { - struct reggroup *group =3D NULL; + const reggroup *group =3D NULL; =20 if (current_group !=3D NULL) { @@ -536,10 +536,10 @@ tui_reg_next (struct reggroup *current_group, struct = gdbarch *gdbarch) around behaviour. Returns the previous register group, or NULL if the register window is not currently being displayed. */ =20 -static struct reggroup * -tui_reg_prev (struct reggroup *current_group, struct gdbarch *gdbarch) +static const reggroup * +tui_reg_prev (const reggroup *current_group, struct gdbarch *gdbarch) { - struct reggroup *group =3D NULL; + const reggroup *group =3D NULL; =20 if (current_group !=3D NULL) { @@ -561,7 +561,7 @@ tui_reg_command (const char *args, int from_tty) =20 if (args !=3D NULL) { - struct reggroup *group, *match =3D NULL; + const reggroup *group, *match =3D NULL; size_t len =3D strlen (args); =20 /* Make sure the curses mode is enabled. */ @@ -575,7 +575,7 @@ tui_reg_command (const char *args, int from_tty) if (TUI_DATA_WIN =3D=3D NULL || !TUI_DATA_WIN->is_visible ()) tui_regs_layout (); =20 - struct reggroup *current_group =3D TUI_DATA_WIN->get_current_group (= ); + const reggroup *current_group =3D TUI_DATA_WIN->get_current_group (); if (strncmp (args, "next", len) =3D=3D 0) match =3D tui_reg_next (current_group, gdbarch); else if (strncmp (args, "prev", len) =3D=3D 0) @@ -603,7 +603,7 @@ tui_reg_command (const char *args, int from_tty) } else { - struct reggroup *group; + const reggroup *group; int first; =20 gdb_printf (_("\"tui reg\" must be followed by the name of " diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index 9192a73b177..5289d3a892d 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -23,6 +23,7 @@ #define TUI_TUI_REGS_H =20 #include "tui/tui-data.h" +#include "reggroups.h" =20 /* A data item window. */ =20 @@ -60,9 +61,9 @@ struct tui_data_window : public tui_win_info =20 void check_register_values (struct frame_info *frame); =20 - void show_registers (struct reggroup *group); + void show_registers (const reggroup *group); =20 - struct reggroup *get_current_group () const + const reggroup *get_current_group () const { return m_current_group; } @@ -99,7 +100,7 @@ private: display off the end of the register display. */ void display_reg_element_at_line (int start_element_no, int start_line_n= o); =20 - void show_register_group (struct reggroup *group, + void show_register_group (const reggroup *group, struct frame_info *frame, bool refresh_values_only); =20 @@ -125,7 +126,7 @@ private: /* Windows that are used to display registers. */ std::vector m_regs_content; int m_regs_column_count =3D 0; - struct reggroup *m_current_group =3D nullptr; + const reggroup *m_current_group =3D nullptr; =20 /* Width of each register's display area. */ int m_item_width =3D 0;