From patchwork Sun Jun 23 22:42:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33282 Received: (qmail 47340 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 47322 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:1583 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:39 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 07501D9DA for ; Sun, 23 Jun 2019 17:43:38 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBCzhdbuh90onfBD0hbzUJ; 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=om5rlBoj3kcU3tA0ugXUixZ8JebD2XQKydXorp2W6J0=; b=vZdIBEc+ie4ucgGklPk+LLFap/ 1OXVjLw28mEyxzH0eoalBQZazHjXaMNPv42C8nyoDJpqvBxJBkCydfscuasvSUoV7AmK7kLt75I+2 X1tvt8EPXA3UCBzBu6+QTORjT; 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 1hfBCz-000vDQ-Q0; Sun, 23 Jun 2019 17:43:37 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 01/66] Use new and delete for TUI windows Date: Sun, 23 Jun 2019 16:42:24 -0600 Message-Id: <20190623224329.16060-2-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> This changes tui_win_info to use new and delete, rather than XNEW and xfree. gdb/ChangeLog 2019-06-23 Tom Tromey * tui/tui-data.h (struct tui_win_info): Add constructor. * tui/tui-data.c (tui_alloc_win_info): Use new. (tui_free_window): Use delete. --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-data.c | 5 ++--- gdb/tui/tui-data.h | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index b67cb48c2e6..117bda3c200 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -531,9 +531,8 @@ init_win_info (struct tui_win_info *win_info) struct tui_win_info * tui_alloc_win_info (enum tui_win_type type) { - struct tui_win_info *win_info = XNEW (struct tui_win_info); + struct tui_win_info *win_info = new struct tui_win_info (type); - win_info->generic.type = type; init_win_info (win_info); return win_info; @@ -654,7 +653,7 @@ tui_free_window (struct tui_win_info *win_info) } if (win_info->generic.title) xfree (win_info->generic.title); - xfree (win_info); + delete win_info; } diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index c696feed280..34822e2a92d 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -271,6 +271,13 @@ struct tui_command_info /* This defines information about each logical window. */ struct tui_win_info { + tui_win_info (enum tui_win_type type) + { + generic.type = type; + } + + DISABLE_COPY_AND_ASSIGN (tui_win_info); + struct tui_gen_win_info generic; /* General window information. */ union {