Remove an unnecessary NULL check from the TUI
authorTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 16:23:10 +0000 (10:23 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:25 +0000 (07:48 -0600)
In init_and_make_win, opaque_win_info can't be NULL after a new window
is allocated.  This patch removes an unnecessary NULL check.

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

* tui/tui-layout.c (init_and_make_win): Remove NULL check.

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

index d01d1184d9225a93f1c8efda2da27a99586a031e..45415df087cd3db2fc07496951beae6c9cbc0387 100644 (file)
@@ -1,3 +1,7 @@
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-layout.c (init_and_make_win): Remove NULL check.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-data.h (struct tui_win_info): Make constructor
index bcae819e51825f996cc84bd6a9ffefe79ec861e4..695c56012c1c8aed61ab805f79c4d097f90ed306 100644 (file)
@@ -842,18 +842,16 @@ init_and_make_win (void *opaque_win_info,
   else
     generic = &((struct tui_win_info *) opaque_win_info)->generic;
 
-  if (opaque_win_info != NULL)
+  init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
+  if (!tui_win_is_auxillary (win_type))
     {
-      init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
-      if (!tui_win_is_auxillary (win_type))
-       {
-         if (generic->type == CMD_WIN)
-           ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE;
-         else
-           ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE;
-       }
-      tui_make_window (generic, box_it);
+      if (generic->type == CMD_WIN)
+       ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE;
+      else
+       ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE;
     }
+  tui_make_window (generic, box_it);
+
   return opaque_win_info;
 }