From patchwork Sun Jun 23 22:43:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33328 Received: (qmail 62397 invoked by alias); 23 Jun 2019 23:26:35 -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 62315 invoked by uid 89); 23 Jun 2019 23:26:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.3 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: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.149.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 23:26:32 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id A06C61E257 for ; Sun, 23 Jun 2019 18:26:31 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBsVh9XEciQerfBsVhfNS3; Sun, 23 Jun 2019 18:26:31 -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=jyUjv7zxrvUp5JreeNPtQNAOjXq8YoVVkn4v5Z7zYt4=; b=RWUcQKhUwXx0vOEVQXKEJ3BHas ifks8ptJ62NWfxyJ+EGmfqRpUDE0HZA7HA1kOcoBZa/5IN8PBFC0+2FOetgYOE4Bt3n6SfWceIV6O KnvZ2XkgAzaqVHmReXrfNap5r; 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 1hfBDD-000vDQ-AE; Sun, 23 Jun 2019 17:43:51 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 48/66] Remove tui_alloc_win_info Date: Sun, 23 Jun 2019 16:43:11 -0600 Message-Id: <20190623224329.16060-49-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> There is only a single caller of tui_alloc_win_info, and we're going to add more "new" cases to that caller, so remove tui_alloc_win_info and inline it into init_and_make_win. 2019-06-23 Tom Tromey * tui/tui-data.h (tui_alloc_win_info): Don't declare. * tui/tui-layout.c (init_and_make_win): Use "new" directly. * tui/tui-data.c (tui_alloc_win_info): Remove. --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-data.c | 22 ---------------------- gdb/tui/tui-data.h | 1 - gdb/tui/tui-layout.c | 27 +++++++++++++++++++++++---- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 7af9c19fa4d..9b247b46808 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -419,28 +419,6 @@ tui_source_window_base::tui_source_window_base (enum tui_win_type type) start_line_or_addr.u.addr = 0; } -struct tui_win_info * -tui_alloc_win_info (enum tui_win_type type) -{ - switch (type) - { - case SRC_WIN: - return new tui_source_window (); - - case DISASSEM_WIN: - return new tui_disasm_window (); - - case DATA_WIN: - return new tui_data_window (); - - case CMD_WIN: - return new tui_cmd_window (); - } - - gdb_assert_not_reached (_("Unhandled window type")); -} - - /* Allocates the content and elements in a block. */ tui_win_content tui_alloc_content (int num_elements, enum tui_win_type type) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index d875eb7bbc9..7392a4e4133 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -531,7 +531,6 @@ extern struct tui_win_info *tui_win_list[MAX_MAJOR_WINDOWS]; /* Data Manipulation Functions. */ extern void tui_initialize_static_data (void); -extern struct tui_win_info *tui_alloc_win_info (enum tui_win_type); extern void tui_init_generic_part (struct tui_gen_win_info *); extern tui_win_content tui_alloc_content (int, enum tui_win_type); extern int tui_add_content_elements (struct tui_gen_win_info *, diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 6507b06dd39..6d343921d4c 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -798,10 +798,29 @@ init_and_make_win (tui_gen_win_info *win_info, { if (win_info == NULL) { - if (tui_win_is_auxillary (win_type)) - win_info = new tui_gen_win_info (win_type); - else - win_info = tui_alloc_win_info (win_type); + switch (win_type) + { + case SRC_WIN: + win_info = new tui_source_window (); + break; + + case DISASSEM_WIN: + win_info = new tui_disasm_window (); + break; + + case DATA_WIN: + win_info = new tui_data_window (); + break; + + case CMD_WIN: + win_info = new tui_cmd_window (); + break; + + default: + gdb_assert (tui_win_is_auxillary (win_type)); + win_info = new tui_gen_win_info (win_type); + break; + } } win_info->reset (win_type, height, width, origin_x, origin_y);