From patchwork Mon Jun 24 18:48:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33361 Received: (qmail 63058 invoked by alias); 24 Jun 2019 18:49:17 -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 60950 invoked by uid 89); 24 Jun 2019 18:49:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SEMBLACK, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jun 2019 18:48:57 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 7F7F64012110C for ; Mon, 24 Jun 2019 13:48:56 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fU1Qh6TxuYTGMfU1Qh18q3; Mon, 24 Jun 2019 13:48:56 -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=kX1mjT9SLeBsaS8Ueq//qpE2qwtXHs1Ul2jLFIMdMDA=; b=NuTK1M3LQQMHzSvMwD5dd/iC3n ZA9N03vM3C+zehll3PvnNFr1J4oh9FfoDl4harr+xKrDo9rNUYxgct7nTLHiyOkchkGzlT5z9utrS b/gcDq+Jzoqr+4ONzU6qZlcw0; Received: from 75-166-12-78.hlrn.qwest.net ([75.166.12.78]:56746 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hfU1Q-003qDK-9r; Mon, 24 Jun 2019 13:48:56 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 66/66] Tidy tui_delete_win Date: Mon, 24 Jun 2019 12:48:41 -0600 Message-Id: <20190624184841.3492-17-tom@tromey.com> In-Reply-To: <20190624184841.3492-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> <20190624184841.3492-1-tom@tromey.com> tui_delete_win does its own NULL check, so ~tui_gen_win_info does not need to do it. Also, tui_delete_win has an extraneous "return". 2019-06-23 Tom Tromey * tui/tui-wingeneral.c (tui_delete_win): Remove "return". * tui/tui-data.c (~tui_gen_win_info): Remove "if". --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-data.c | 6 +----- gdb/tui/tui-wingeneral.c | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 1ecf486e37f..4a16c4f03f2 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -350,11 +350,7 @@ tui_source_window_base::tui_source_window_base (enum tui_win_type type) tui_gen_win_info::~tui_gen_win_info () { - if (handle != NULL) - { - tui_delete_win (handle); - handle = NULL; - } + tui_delete_win (handle); xfree (title); } diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 13063ae9356..cf8d9fc3959 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -63,8 +63,6 @@ tui_delete_win (WINDOW *window) { if (window != NULL) delwin (window); - - return; }