From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67081 invoked by alias); 31 Oct 2016 03:29:37 -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 67071 invoked by uid 89); 31 Oct 2016 03:29:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=placement, Hx-languages-length:1230, H*RU:sk:gproxy7, HX-HELO:sk:gproxy7 X-HELO: gproxy7-pub.mail.unifiedlayer.com Received: from gproxy7-pub.mail.unifiedlayer.com (HELO gproxy7-pub.mail.unifiedlayer.com) (70.40.196.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 31 Oct 2016 03:29:26 +0000 Received: (qmail 9420 invoked by uid 0); 31 Oct 2016 03:29:25 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy7.mail.unifiedlayer.com with SMTP; 31 Oct 2016 03:29:25 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id 23VL1u00k2f2jeq013VPu7; Sun, 30 Oct 2016 21:29:23 -0600 X-Authority-Analysis: v=2.1 cv=PIacp5aC c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=BzObnAOqAAAA:8 a=8-R4PowjqHnq8VqUOH4A:9 a=PuSIgb6VMkSJ0_1bSHE4:22 Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:33112 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1c13Hm-0001FM-11; Sun, 30 Oct 2016 21:29:22 -0600 From: Tom Tromey To: Manish Goregaokar Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix handling of discriminantless univariant enums in Rust References: <87pomiwo1z.fsf@tromey.com> <87lgx6wntm.fsf@tromey.com> <87d1iiwlvx.fsf@tromey.com> <874m3tw784.fsf@tromey.com> Date: Mon, 31 Oct 2016 03:29:00 -0000 In-Reply-To: (Manish Goregaokar's message of "Sun, 30 Oct 2016 20:19:27 -0700") Message-ID: <87oa21urfz.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1c13Hm-0001FM-11 X-Source-Sender: 174-16-143-211.hlrn.qwest.net (bapiya) [174.16.143.211]:33112 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00854.txt.bz2 >>>>> "Manish" == Manish Goregaokar writes: Manish> Updated. Not sure what the style issues are, could you point them out? Sure. There's also the GNU coding standards document, plus some docs on the gdb wiki somewhere. Manish> } Manish> + else if (TYPE_NFIELDS (type) == 1) { Brace placement. Should line up with that "}" just above. Manish> + /* Sometimes univariant enums are encoded without a Manish> + discriminant. In that case, treating it as an encoded enum Manish> + with the first field being the actual type works. */ Subsequent text in a multi-line comment should line up under the "Sometimes". Period followed by two spaces ends a sentence, so one more space before "In". Manish> + const char* field_name = TYPE_NAME (TYPE_FIELD_TYPE (type, 0)); Manish> + const char* last = rust_last_path_segment (field_name); "char *" Manish> + ret.name = concat (TYPE_NAME (type), "::", last, (char *) NULL); Manish> + ret.field_no = RUST_ENCODED_ENUM_REAL; Manish> + ret.is_encoded = 1; Manish> + return ret; Manish> + } This brace and the whole block will be indented a bit more due to the brace placement issue. thanks, Tom