From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 0220B3858D26; Sun, 16 Jun 2024 02:56:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0220B3858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1718506566; bh=+N/FFXF2siVLd+MCIM0HzcIuhd2itwT/wl+BKYcE0Bs=; h=From:To:Subject:Date:From; b=BJjiMdkbW2SkLZBfJk6MT7+l9mcyJQqzlaeP8MQNNaquHGpT8kJI8ipj6eQyy3nMh wJBtV34GUHfi0f5uNOPg3tDWSp6Axi5TbTBCh95bKFkAMnRb++EhuxS47lKKbWVIta rCJFYsO52RffG+6xK1cdeKmkL3ZS60+8mzaKIgS4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Make tui_register_info::highlight private X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 28775f62b963d148b87a0b4a08016f971fd1c4df X-Git-Newrev: a6687ef35cda4c85683682a55f75e5fed896f45a Message-Id: <20240616025606.0220B3858D26@sourceware.org> Date: Sun, 16 Jun 2024 02:56:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da6687ef35cda= 4c85683682a55f75e5fed896f45a commit a6687ef35cda4c85683682a55f75e5fed896f45a Author: Tom Tromey Date: Fri May 31 14:25:09 2024 -0600 Make tui_register_info::highlight private =20 This changes tui_register_info::highlight to be private, renaming it to m_highlight. Diff: --- gdb/tui/tui-regs.c | 18 ++++++++---------- gdb/tui/tui-regs.h | 8 ++++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 43b519ac127..2be81876010 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -95,13 +95,13 @@ tui_register_format (const frame_info_ptr &frame, int r= egnum) } =20 /* Compute the register value from the given frame and format it for - the display. update 'content' and set 'highlight' if the contents - changed. */ + the display. Update 'content' and set 'm_highlight' if the + contents changed. */ void tui_register_info::update (const frame_info_ptr &frame) { std::string new_content =3D tui_register_format (frame, m_regno); - highlight =3D content !=3D new_content; + m_highlight =3D content !=3D new_content; content =3D std::move (new_content); } =20 @@ -404,12 +404,11 @@ tui_data_window::check_register_values (const frame_i= nfo_ptr &frame) { for (tui_register_info &data_item_win : m_regs_content) { - bool was_hilighted =3D data_item_win.highlight; + bool was_hilighted =3D data_item_win.highlighted (); =20 data_item_win.update (frame); =20 - /* Register windows whose y =3D=3D 0 are outside the visible area. = */ - if ((data_item_win.highlight || was_hilighted) + if ((data_item_win.highlighted () || was_hilighted) && data_item_win.visible ()) data_item_win.rerender (handle.get (), m_item_width); } @@ -418,12 +417,11 @@ tui_data_window::check_register_values (const frame_i= nfo_ptr &frame) } } =20 -/* Display a register in a window. If hilite is TRUE, then the value - will be displayed in reverse video. */ +/* Display a register in a window. */ void tui_register_info::rerender (WINDOW *handle, int field_width) { - if (highlight) + if (m_highlight) /* We ignore the return value, casting it to void in order to avoid a compiler warning. The warning itself was introduced by a patch to ncurses 5.7 dated 2009-08-29, changing this macro to expand @@ -435,7 +433,7 @@ tui_register_info::rerender (WINDOW *handle, int field_= width) if (content.size () < field_width) waddstr (handle, n_spaces (field_width - content.size ())); =20 - if (highlight) + if (m_highlight) /* We ignore the return value, casting it to void in order to avoid a compiler warning. The warning itself was introduced by a patch to ncurses 5.7 dated 2009-08-29, changing this macro to expand diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index 69ba10724e7..61bfdd20d6f 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -34,7 +34,6 @@ struct tui_register_info : m_regno (regno) { update (frame); - highlight =3D false; } =20 DISABLE_COPY_AND_ASSIGN (tui_register_info); @@ -48,14 +47,19 @@ struct tui_register_info bool visible () const { return y > 0; } =20 + bool highlighted () const + { return m_highlight; } + /* Location. */ int x =3D 0; int y =3D 0; - bool highlight =3D false; std::string content; =20 private: =20 + /* True if currently highlighted. */ + bool m_highlight =3D false; + /* The register number. */ const int m_regno; };