public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Remove an unnecessary NULL check from the TUI
Date: Tue, 25 Jun 2019 13:57:00 -0000	[thread overview]
Message-ID: <20190625135724.112152.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ec328aa512ee09ab326d59b417836bb950083230

commit ec328aa512ee09ab326d59b417836bb950083230
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Jun 16 10:23:10 2019 -0600

    Remove an unnecessary NULL check from the TUI
    
    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.

Diff:
---
 gdb/ChangeLog        |  4 ++++
 gdb/tui/tui-layout.c | 18 ++++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d01d118..45415df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 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
 	protected.  Make destructor virtual.  Add initializers.
 	(tui_source_window, tui_data_window, tui_cmd_window): New
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index bcae819..695c560 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -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;
 }


                 reply	other threads:[~2019-06-25 13:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190625135724.112152.qmail@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).