From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61791 invoked by alias); 12 Apr 2017 16:15:41 -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 50991 invoked by uid 89); 12 Apr 2017 16:15:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:57802 X-HELO: gproxy8.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Apr 2017 16:15:16 +0000 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id 30BC81AB260 for ; Wed, 12 Apr 2017 10:15:14 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id 7UFB1v0062f2jeq01UFEAE; Wed, 12 Apr 2017 10:15:14 -0600 X-Authority-Analysis: v=2.2 cv=LIwWeNe9 c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=AzvcPWV-tVgA:10 a=20KFwNOVAAAA:8 a=VOG16tjv1v3ad25galUA:9 Received: from 75-166-65-226.hlrn.qwest.net ([75.166.65.226]:57802 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cyKvG-0006x2-80; Wed, 12 Apr 2017 10:15:10 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA v2 10/17] C++ify mi_parse References: <20170411150112.23207-1-tom@tromey.com> <20170411150112.23207-11-tom@tromey.com> <56430d1d-abb1-5e22-87dd-14158939d842@redhat.com> Date: Wed, 12 Apr 2017 16:15:00 -0000 In-Reply-To: <56430d1d-abb1-5e22-87dd-14158939d842@redhat.com> (Pedro Alves's message of "Wed, 12 Apr 2017 12:26:16 +0100") Message-ID: <87y3v561rm.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1cyKvG-0006x2-80 X-Source-Sender: 75-166-65-226.hlrn.qwest.net (bapiya) [75.166.65.226]:57802 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2017-04/txt/msg00348.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> The patch made mi_parse be a non-POD (non-trivial dtor), so I Pedro> think we should get rid of that memset at the same time. This change was a little bigger than the others. I've added this constructor: mi_parse::mi_parse () : op (MI_COMMAND), command (NULL), token (NULL), cmd (NULL), cmd_start (NULL), args (NULL), argv (NULL), argc (0), all (0), thread_group (-1), thread (-1), frame (-1), language (language_unknown) { } ... and changed the construction of the object like: @@ -241,12 +241,5 @@ - memset (parse, 0, sizeof (*parse)); - parse->all = 0; - parse->thread_group = -1; - parse->thread = -1; - parse->frame = -1; - parse->language = language_unknown; - - cleanup = make_cleanup (mi_parse_cleanup, parse); + std::unique_ptr parse (new struct mi_parse); /* Before starting, skip leading white space. */ cmd = skip_spaces_const (cmd); Tom