forked from lemonjesus/qemu-ipod-nano
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qapi: Enforce union and alternate branch naming rules
Union branch names should use '-', not '_'. Enforce this. The only offenders are in tests/. Fix them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-29-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
- Loading branch information
Markus Armbruster
committed
Mar 23, 2021
1 parent
407efbf
commit d83b476
Showing
7 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
alternate-clash.json: In alternate 'Alt1': | ||
alternate-clash.json:4: branch 'a_b' collides with branch 'a-b' | ||
alternate-clash.json:6: name of 'data' member 'a_b' must not use uppercase or '_' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Alternate branch name collision | ||
# Reject an alternate that would result in a collision in generated C | ||
# names (this would try to generate two union members named 'a_b'). | ||
# Naming rules make collision impossible (even with the pragma). If | ||
# that wasn't the case, then we'd get a collision in generated C: two | ||
# union members a_b. | ||
{ 'pragma': { 'member-name-exceptions': [ 'Alt1' ] } } | ||
{ 'alternate': 'Alt1', | ||
'data': { 'a-b': 'bool', 'a_b': 'int' } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
union-clash-branches.json: In union 'TestUnion': | ||
union-clash-branches.json:4: branch 'a_b' collides with branch 'a-b' | ||
union-clash-branches.json:6: name of 'data' member 'a_b' must not use uppercase or '_' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Union branch name collision | ||
# Reject a union that would result in a collision in generated C names (this | ||
# would try to generate two members 'a_b'). | ||
# Naming rules make collision impossible (even with the pragma). If | ||
# that wasn't the case, then we'd get collisions in generated C: two | ||
# union members a_b, and two enum members TEST_UNION_A_B. | ||
{ 'pragma': { 'member-name-exceptions': [ 'TestUnion' ] } } | ||
{ 'union': 'TestUnion', | ||
'data': { 'a-b': 'int', 'a_b': 'str' } } |