From patchwork Mon Jun 24 18:48:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33359 Received: (qmail 62599 invoked by alias); 24 Jun 2019 18:49:14 -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 60923 invoked by uid 89); 24 Jun 2019 18:49:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 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_JMF_BL, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.187.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jun 2019 18:48:57 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 22E38400C783E for ; Mon, 24 Jun 2019 13:10:57 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fU1QhMF0MiQerfU1Qhrvy2; 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=CBJ/49SPVHqnEBA6veDJwhFsfW9UlcjHjmSuTWRRTMI=; b=pj9v9GEZiN1TnhAsVWBqoUdTYA 9VGyuwZdLfMsulNjxn6UqiwvJ3jwBDU3ftjP8ooqrb2NYmP6x/hc/vdvwtSuspM+3VuEP/ThyGZ3P V6AlkrJd91oqSSdxBHCb59Rh1; 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-0Y; Mon, 24 Jun 2019 13:48:56 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 65/66] Make tui_gen_win_info constructor protected Date: Mon, 24 Jun 2019 12:48:40 -0600 Message-Id: <20190624184841.3492-16-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> Now that all the window types have their own concrete classes, the tui_gen_win_info constructor can be protected. 2019-06-23 Tom Tromey * tui/tui-layout.c (init_and_make_win): Assert on unrecognized type. * tui/tui-data.h (struct tui_gen_win_info): Make constructor protected. --- gdb/ChangeLog | 7 +++++++ gdb/tui/tui-data.h | 4 ++++ gdb/tui/tui-layout.c | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 147149389cf..3936aedec95 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -34,11 +34,15 @@ struct tui_point /* Generic window information. */ struct tui_gen_win_info { +protected: + explicit tui_gen_win_info (enum tui_win_type t) : type (t) { } +public: + virtual ~tui_gen_win_info (); /* Call to refresh this window. */ diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 9dbb5995998..d9a1f08ac1f 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -815,9 +815,7 @@ init_and_make_win (tui_gen_win_info *win_info, break; default: - gdb_assert (tui_win_is_auxiliary (win_type)); - win_info = new tui_gen_win_info (win_type); - break; + gdb_assert_not_reached (_("unhandled window type")); } }