mbox series

[v2,0/3] qapi: Simplify enum generation

Message ID 20230315111304.21692-1-philmd@linaro.org
Headers show
Series qapi: Simplify enum generation | expand

Message

Philippe Mathieu-Daudé March 15, 2023, 11:13 a.m. UTC
QAPI generating enum count as part of the enum forces handling
impossible switch cases. Modify qapi/types.py to generate the
enum count as a definition.
Do not try to cover the unreachable 'default' case.
Clean files covering unreachable foo__MAX case.

Since v1:
- Update documentation (Markus)
- Do not generate empty enums (Markus)
- Collect R-b tags

Philippe Mathieu-Daudé (3):
  scripts/git.orderfile: Display QAPI script changes before schema ones
  qapi: Do not generate empty enum
  qapi: Generate enum count as definition

 docs/devel/qapi-code-gen.rst | 10 +++++-----
 scripts/qapi/schema.py       |  5 ++++-
 scripts/qapi/types.py        | 11 +++++++----
 scripts/qapi/visit.py        |  2 --
 audio/audio_template.h       |  3 ---
 audio/audio.c                |  6 ------
 migration/migration.c        |  2 --
 replay/replay-input.c        | 12 ------------
 softmmu/tpm-hmp-cmds.c       |  2 --
 ui/input-linux.c             |  4 ----
 ui/input.c                   |  6 ------
 scripts/git.orderfile        |  2 ++
 12 files changed, 18 insertions(+), 47 deletions(-)

Comments

Philippe Mathieu-Daudé March 15, 2023, 11:22 a.m. UTC | #1
On 15/3/23 12:13, Philippe Mathieu-Daudé wrote:
> QAPI generating enum count as part of the enum forces handling
> impossible switch cases. Modify qapi/types.py to generate the
> enum count as a definition.
> Do not try to cover the unreachable 'default' case.
> Clean files covering unreachable foo__MAX case.
> 
> Since v1:
> - Update documentation (Markus)
> - Do not generate empty enums (Markus)
> - Collect R-b tags
> 
> Philippe Mathieu-Daudé (3):
>    scripts/git.orderfile: Display QAPI script changes before schema ones
>    qapi: Do not generate empty enum

Wrong branch... v3 coming.