From patchwork Sun Jun 23 22:42:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33297 Received: (qmail 50426 invoked by alias); 23 Jun 2019 22:44:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 48680 invoked by uid 89); 23 Jun 2019 22:43:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.156) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 22:43:44 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 7B6B01DC41 for ; Sun, 23 Jun 2019 17:43:43 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBD5hdbwV90onfBD5hbzW3; Sun, 23 Jun 2019 17:43:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Na4F5i1B4vhj6FhC/Ftf2G+UZFaHZcHPNSASvtr+VBw=; b=Nh9VO2h2JhouEzoq1mC6505En1 Ivz2sEZqXvebF96FzfEX1Gr8jsHzGL/sOcPxDvxsumfIp+OD6JE34mtzj8guyI+xYkyFlM/mEmh4I CnogS0Fy/3GVh804sw45hT3IY; Received: from 75-166-12-78.hlrn.qwest.net ([75.166.12.78]:54396 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hfBD5-000vDQ-9k; Sun, 23 Jun 2019 17:43:43 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 20/66] Remove an unneeded NULL check Date: Sun, 23 Jun 2019 16:42:43 -0600 Message-Id: <20190623224329.16060-21-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> show_source_or_disasm_and_command will either create or reset the source window, so the final NULL check is not necessary. This patch removes it. gdb/ChangeLog 2019-06-23 Tom Tromey * tui/tui-layout.c (show_source_or_disasm_and_command): Remove NULL check. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-layout.c | 44 +++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 72ec924f72c..de78c6c0ac8 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -945,30 +945,28 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type) tui_make_visible (&(*win_info_ptr)->generic); tui_make_visible (base->execution_info); } - if ((*win_info_ptr) != NULL) - { - base->m_has_locator = true; - tui_make_visible (locator); - tui_show_locator_content (); - tui_show_source_content (*win_info_ptr); - if (TUI_CMD_WIN == NULL) - { - tui_win_list[CMD_WIN] = make_command_window (cmd_height, - src_height); - tui_refresh_win (&TUI_CMD_WIN->generic); - } - else - { - init_gen_win_info (&TUI_CMD_WIN->generic, - TUI_CMD_WIN->generic.type, - TUI_CMD_WIN->generic.height, - TUI_CMD_WIN->generic.width, - TUI_CMD_WIN->generic.origin.x, - TUI_CMD_WIN->generic.origin.y); - TUI_CMD_WIN->can_highlight = FALSE; - tui_make_visible (&TUI_CMD_WIN->generic); - } + base->m_has_locator = true; + tui_make_visible (locator); + tui_show_locator_content (); + tui_show_source_content (*win_info_ptr); + + if (TUI_CMD_WIN == NULL) + { + tui_win_list[CMD_WIN] = make_command_window (cmd_height, + src_height); + tui_refresh_win (&TUI_CMD_WIN->generic); + } + else + { + init_gen_win_info (&TUI_CMD_WIN->generic, + TUI_CMD_WIN->generic.type, + TUI_CMD_WIN->generic.height, + TUI_CMD_WIN->generic.width, + TUI_CMD_WIN->generic.origin.x, + TUI_CMD_WIN->generic.origin.y); + TUI_CMD_WIN->can_highlight = FALSE; + tui_make_visible (&TUI_CMD_WIN->generic); } tui_set_current_layout_to (layout_type); }