From patchwork Sun Jun 23 22:42:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33283 Received: (qmail 47411 invoked by alias); 23 Jun 2019 22:43:41 -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 47335 invoked by uid 89); 23 Jun 2019 22:43:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 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=HX-Languages-Length:1449 X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 22:43:40 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway31.websitewelcome.com (Postfix) with ESMTP id DBC82D9DB for ; Sun, 23 Jun 2019 17:43:38 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBD0hdbuy90onfBD0hbzUX; Sun, 23 Jun 2019 17:43:38 -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=K455cUvVkAnXpuChbUrNcaNsmCzaAG+4dJlAPOLOpbE=; b=wtW93myYAPZ0bZoG41711ARnyk Roc1iJSqGzzaJyfv0E1cJjuKX8jT1TuobQ4pK7duIcEE6EGPYiw13g8Cgf0B8KPS2iasUOCTHDZfd g5Ox7z9LCPQh5Q0Px8H7LzqRC; 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 1hfBD0-000vDQ-Ls; Sun, 23 Jun 2019 17:43:38 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 04/66] Remove an unnecessary NULL check from the TUI Date: Sun, 23 Jun 2019 16:42:27 -0600 Message-Id: <20190623224329.16060-5-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> 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-23 Tom Tromey * tui/tui-layout.c (init_and_make_win): Remove NULL check. --- gdb/ChangeLog | 4 ++++ gdb/tui/tui-layout.c | 18 ++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index bcae819e518..695c56012c1 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; }