From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85104 invoked by alias); 19 Jun 2017 20:55:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 85050 invoked by uid 89); 19 Jun 2017 20:55:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 20:55:15 +0000 Received: by simark.ca (Postfix, from userid 33) id 538711E560; Mon, 19 Jun 2017 16:55:18 -0400 (EDT) To: Yao Qi Subject: Re: [PATCH 03/25] Class-fy tdesc_reg tdesc_type and tdesc_feature X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 19 Jun 2017 20:55:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <1497256916-4958-4-git-send-email-yao.qi@linaro.org> References: <1497256916-4958-1-git-send-email-yao.qi@linaro.org> <1497256916-4958-4-git-send-email-yao.qi@linaro.org> Message-ID: <05fab3f56fccb28c0c5e0d091670a366@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00540.txt.bz2 On 2017-06-12 10:41, Yao Qi wrote: > This patch class-fies them, adding ctor, dtor, and deleting > copy ctor and assignment operator. > > gdb: > > 2017-05-20 Yao Qi > > * target-descriptions.c (tdesc_reg): Add ctor, dtor. > Delete copy ctor and assignment operator. > (tdesc_type): Likewise. > (tdesc_feature): Likewise. > (tdesc_free_reg): Remove. > (tdesc_create_reg): Use new. > (tdesc_free_type): Remove. > (tdesc_create_vector): Use new. > (tdesc_create_union): Likewise. > (tdesc_create_flags): Likewise. > (tdesc_create_enum): Likewise. > (tdesc_free_feature): Delete. > (free_target_description): Use delete. > --- > gdb/target-descriptions.c | 200 > +++++++++++++++++++++++----------------------- > 1 file changed, 100 insertions(+), 100 deletions(-) > > diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c > index 9a7e2dd..e2dcd1d 100644 > --- a/gdb/target-descriptions.c > +++ b/gdb/target-descriptions.c > @@ -48,6 +48,32 @@ DEF_VEC_O(property_s); > > typedef struct tdesc_reg > { > +public: Since you are using the "struct" keyword, members are public by default, so you don't have to put "public:". Same things for other types. Otherwise it LGTM. Of course, more c++ification is always possible, but I think it's fine to go in small increments. Just FYI, I tested this on top of my "poison-xnew" branch, which points out the invalid use of XNEW/xfree on non-POD types, and it built fine. Simon