This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[FYI] Remove self-assign from make_invisible_and_set_new_height
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Mon, 22 Jul 2019 08:36:55 -0600
- Subject: [FYI] Remove self-assign from make_invisible_and_set_new_height
In https://sourceware.org/ml/gdb-patches/2019-07/msg00509.html, Jan
pointed out that clang points out that
make_invisible_and_set_new_height self-assigns "height".
This patch fixes the bug by renaming the formal parameter.
gdb/ChangeLog
2019-07-22 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_win_info::make_invisible_and_set_new_height):
Don't self-assign.
---
gdb/ChangeLog | 5 +++++
gdb/tui/tui-win.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index db4dc1088a6..785c623b7e2 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1194,10 +1194,10 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
/* See tui-data.h. */
void
-tui_win_info::make_invisible_and_set_new_height (int height)
+tui_win_info::make_invisible_and_set_new_height (int height_)
{
make_visible (false);
- height = height;
+ height = height_;
if (height > 1)
viewport_height = height - 1;
else
--
2.17.2