From patchwork Wed Aug 21 02:25: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: 34212 Received: (qmail 29872 invoked by alias); 21 Aug 2019 02:25:56 -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 29406 invoked by uid 89); 21 Aug 2019 02:25:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 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.47.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Aug 2019 02:25:41 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 9663E2FD5 for ; Tue, 20 Aug 2019 21:25:40 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0GJgiPvop3Qi00GJgi6a7q; Tue, 20 Aug 2019 21:25:40 -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=8OR8WyGSBZ0pflRe+8gNQflWdSNe9PIdsVHEt6+l5yU=; b=VPDGVyM2f7X6k6A5q36Npbs2Vl ehjOY9GjTAsLqgOoWJTkl0wOv2qPqCyLl6yCnKo+Xpv2QAbHkPfDLsae2d4TA1kbm9IuAYULS92vk rJPKK3zLcD1P3caabhf5WDldo; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:48672 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1i0GJg-001K6n-Bu; Tue, 20 Aug 2019 21:25:40 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 07/15] Remove NULL checks from box_win Date: Tue, 20 Aug 2019 20:25:27 -0600 Message-Id: <20190821022535.9762-8-tom@tromey.com> In-Reply-To: <20190821022535.9762-1-tom@tromey.com> References: <20190821022535.9762-1-tom@tromey.com> box_win can't be called with a NULL window, or with an invisible window. So, the NULL checks in that function can be removed. gdb/ChangeLog 2019-08-20 Tom Tromey * tui/tui-wingeneral.c (box_win): Assume win_info and win_info->handle cannot be NULL. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-wingeneral.c | 35 ++++++++++++++++------------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index ab0363f856c..01f288be862 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -58,30 +58,27 @@ static void box_win (struct tui_win_info *win_info, bool highlight_flag) { - if (win_info && win_info->handle) - { - WINDOW *win; - int attrs; + WINDOW *win; + int attrs; - win = win_info->handle; - if (highlight_flag) - attrs = tui_active_border_attrs; - else - attrs = tui_border_attrs; + win = win_info->handle; + if (highlight_flag) + attrs = tui_active_border_attrs; + else + attrs = tui_border_attrs; - wattron (win, attrs); + wattron (win, attrs); #ifdef HAVE_WBORDER - wborder (win, tui_border_vline, tui_border_vline, - tui_border_hline, tui_border_hline, - tui_border_ulcorner, tui_border_urcorner, - tui_border_llcorner, tui_border_lrcorner); + wborder (win, tui_border_vline, tui_border_vline, + tui_border_hline, tui_border_hline, + tui_border_ulcorner, tui_border_urcorner, + tui_border_llcorner, tui_border_lrcorner); #else - box (win, tui_border_vline, tui_border_hline); + box (win, tui_border_vline, tui_border_hline); #endif - if (!win_info->title.empty ()) - mvwaddstr (win, 0, 3, win_info->title.c_str ()); - wattroff (win, attrs); - } + if (!win_info->title.empty ()) + mvwaddstr (win, 0, 3, win_info->title.c_str ()); + wattroff (win, attrs); }