Make tui_gen_win_info constructor protected
authorTom Tromey <tom@tromey.com>
Sun, 23 Jun 2019 22:34:39 +0000 (16:34 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:51 +0000 (07:48 -0600)
Now that all the window types have their own concrete classes, the
tui_gen_win_info constructor can be protected.

gdb/ChangeLog
2019-06-25  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (init_and_make_win): Assert on unrecognized
type.
* tui/tui-data.h (struct tui_gen_win_info): Make constructor
protected.

gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-layout.c

index 43ed9bca9faa34b24cfb67d1d6df11748d195cb0..62e90533cacd35da6e132410e13b18ce384186ce 100644 (file)
@@ -1,3 +1,10 @@
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-layout.c (init_and_make_win): Assert on unrecognized
+       type.
+       * tui/tui-data.h (struct tui_gen_win_info): Make constructor
+       protected.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-winsource.c
index b7cf05c7812cb207921a3da241043126e9cb9fb8..8991a4a5172ef55e571c27c4b8ef15f23f102aa9 100644 (file)
@@ -34,11 +34,15 @@ struct tui_point
 /* Generic window information.  */
 struct tui_gen_win_info
 {
+protected:
+
   explicit tui_gen_win_info (enum tui_win_type t)
     : type (t)
   {
   }
 
+public:
+
   virtual ~tui_gen_win_info ();
 
   /* Call to refresh this window.  */
index 9dbb59959988c9cfd563906e68dfc75e91f9d61b..d9a1f08ac1fb3840c93c5824495fb7ff0b4bdc28 100644 (file)
@@ -815,9 +815,7 @@ init_and_make_win (tui_gen_win_info *win_info,
          break;
 
        default:
-         gdb_assert (tui_win_is_auxiliary (win_type));
-         win_info = new tui_gen_win_info (win_type);
-         break;
+         gdb_assert_not_reached (_("unhandled window type"));
        }
     }