Received: from eggs.gnu.org ([2001:4830:134:3::10]:60581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcpZL-0003ld-3m for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcpZH-0003KL-2o for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:54:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcpZG-0003KH-Tb for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:54:47 -0400 From: Markus Armbruster References: <1442401589-24189-1-git-send-email-armbru@redhat.com> <1442401589-24189-7-git-send-email-armbru@redhat.com> <55FAF1C2.7010401@redhat.com> Date: Fri, 18 Sep 2015 08:54:44 +0200 In-Reply-To: <55FAF1C2.7010401@redhat.com> (Eric Blake's message of "Thu, 17 Sep 2015 11:00:50 -0600") Message-ID: <87h9ms9pzf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 09/16/2015 05:06 AM, Markus Armbruster wrote: >> Fixes flat unions to get the base's base members. Test case is from >> commit 2fc0043, in qapi-schema-test.json: >> >> { 'union': 'UserDefFlatUnion', >> 'base': 'UserDefUnionBase', >> 'discriminator': 'enum1', >> 'data': { 'value1' : 'UserDefA', >> 'value2' : 'UserDefB', >> 'value3' : 'UserDefB' } } >> >> { 'struct': 'UserDefUnionBase', >> 'base': 'UserDefZero', >> 'data': { 'string': 'str', 'enum1': 'EnumOne' } } >> >> { 'struct': 'UserDefZero', >> 'data': { 'integer': 'int' } } >> >> Patch's effect on UserDefFlatUnion: >> >> struct UserDefFlatUnion { >> /* Members inherited from UserDefUnionBase: */ >> + int64_t integer; >> char *string; > > There is another change not listed here. When you were developing with > scaffolding patches, you split the 'typedef struct UserDefFlatUnion {' > into two lines in that patch, and then the diff seen by this patch when > generating the commit message didn't see anything change. But now that > you reverted the scaffolding out of the series, it is now THIS patch > that is converting from inline: > > typedef struct UserDefFlatUnion { > ... > } UserDefFlatUnion; > > to the separate: > > typedef struct UserDefFlatUnion; > ... > struct UserDefFlatUnion { > ... > }; > > >> -def generate_fwd_struct(name): >> +def gen_fwd_object_or_array(name): >> return mcgen(''' >> >> typedef struct %(name)s %(name)s; >> - >> -typedef struct %(name)sList { >> - union { >> - %(name)s *value; >> - uint64_t padding; >> - }; >> - struct %(name)sList *next; >> -} %(name)sList; >> ''', >> name=c_name(name)) >> >> -def generate_fwd_enum_struct(name): >> +def gen_array(name, element_type): >> return mcgen(''' >> >> -typedef struct %(name)sList { >> +struct %(name)s { > > My R-b still stands, but it would be nice to update this commit message > to reflect that this change was intentional. Can do. Thanks!