Message ID | 1446618049-13596-18-git-send-email-eblake@redhat.com |
---|---|
State | New |
Headers | show |
Eric Blake <eblake@redhat.com> writes: > From: Markus Armbruster <armbru@redhat.com> > > QAPISchemaObjectTypeVariants.check() parameter members is no > longer used, drop it. > > Signed-off-by: Markus Armbruster <armbru@redhat.com> > Message-Id: <1446559499-26984-3-git-send-email-armbru@redhat.com> > [Variant.check(seen) is used after all, so reword and reduce scope > of this patch; rearrange later in the series] Don't you need to update the subject? My "previous commit" was "qapi: Simplify QAPISchemaObjectTypeMember.check()", while yours is "qapi: Eliminate QAPISchemaObjectType.check() variable members". Not sure what moving my two patches apart buys you :) > Signed-off-by: Eric Blake <eblake@redhat.com> > > --- > v9: new patch > --- > scripts/qapi.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 4019389..3af5edb 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -991,7 +991,7 @@ class QAPISchemaObjectType(QAPISchemaType): > assert m.name not in seen > seen[m.name] = m > if self.variants: > - self.variants.check(schema, [], seen) > + self.variants.check(schema, seen) > self.members = seen.values() > > def is_implicit(self): > @@ -1046,7 +1046,7 @@ class QAPISchemaObjectTypeVariants(object): > self.tag_member = tag_member > self.variants = variants > > - def check(self, schema, members, seen): > + def check(self, schema, seen): > # seen is non-empty for unions, empty for alternates > if self.tag_name: # flat union > self.tag_member = seen[self.tag_name] > @@ -1086,7 +1086,7 @@ class QAPISchemaAlternateType(QAPISchemaType): > > def check(self, schema): > self.variants.tag_member.check(schema) > - self.variants.check(schema, [], {}) > + self.variants.check(schema, {}) > > def json_type(self): > return 'value'
On 11/04/2015 06:43 AM, Markus Armbruster wrote: > Eric Blake <eblake@redhat.com> writes: > >> From: Markus Armbruster <armbru@redhat.com> >> >> QAPISchemaObjectTypeVariants.check() parameter members is no >> longer used, drop it. >> >> Signed-off-by: Markus Armbruster <armbru@redhat.com> >> Message-Id: <1446559499-26984-3-git-send-email-armbru@redhat.com> >> [Variant.check(seen) is used after all, so reword and reduce scope >> of this patch; rearrange later in the series] > > Don't you need to update the subject? My "previous commit" was "qapi: > Simplify QAPISchemaObjectTypeMember.check()", while yours is "qapi: > Eliminate QAPISchemaObjectType.check() variable members". > > Not sure what moving my two patches apart buys you :) I'm not quite sure either. [Can I blame late-night coding?] For reference, this was your 3/7 patch. I was trying to get to the point of my 'qapi: Check for qapi collisions of flat union branches' (ended up as 19/27) as soon as possible after my tweaks to your 'qapi: Drop obsolete tag value collision assertions' (your 1/7), so that there was less of a gap where avoiding churn on passing vseen(dict) to Variant.check() looked like an unused variable. In my first attempt, I tried floating my patch right after yours. But I quickly discovered that my patch worked better if I built it on top of your 'qapi: Factor out QAPISchemaObjectTypeMember.check_clash()' (your 6/7), which in turn depended on several of your other patches. So the end result of what I posted happens to be whatever order worked for all my cherry-picking, and I still ended up having to tweak both your 1/7 and 3/7 after all. For v10, I may just go back to the order that you first supplied patches in (if for no other reason than to make your commit message more accurate about being a cleanup of the previous patch, with the meaning that you had given it).
diff --git a/scripts/qapi.py b/scripts/qapi.py index 4019389..3af5edb 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -991,7 +991,7 @@ class QAPISchemaObjectType(QAPISchemaType): assert m.name not in seen seen[m.name] = m if self.variants: - self.variants.check(schema, [], seen) + self.variants.check(schema, seen) self.members = seen.values() def is_implicit(self): @@ -1046,7 +1046,7 @@ class QAPISchemaObjectTypeVariants(object): self.tag_member = tag_member self.variants = variants - def check(self, schema, members, seen): + def check(self, schema, seen): # seen is non-empty for unions, empty for alternates if self.tag_name: # flat union self.tag_member = seen[self.tag_name] @@ -1086,7 +1086,7 @@ class QAPISchemaAlternateType(QAPISchemaType): def check(self, schema): self.variants.tag_member.check(schema) - self.variants.check(schema, [], {}) + self.variants.check(schema, {}) def json_type(self): return 'value'