Remove self-assign from make_invisible_and_set_new_height
authorTom Tromey <tom@tromey.com>
Mon, 22 Jul 2019 14:34:25 +0000 (08:34 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 22 Jul 2019 14:34:25 +0000 (08:34 -0600)
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
gdb/tui/tui-win.c

index 63d67124322510d65ecd42c9cb7c2b6231e118e3..bf12f0ef41d0ae11f35f05da5aa8299db0a25c13 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2019-07-22  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to
index db4dc1088a634bf6dda00e451bab92808a2d96d1..785c623b7e2ce2afbb92505767631d158b079f0c 100644 (file)
@@ -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