qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Pavel Dovgalyuk" <pavel.dovgaluk@ispras.ru>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 0/2] qapi: Simplify enum generation
Date: Fri, 24 Feb 2023 16:54:49 +0100	[thread overview]
Message-ID: <20230224155451.20211-1-philmd@linaro.org> (raw)

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.

Philippe Mathieu-Daudé (2):
  qapi: Do not generate default switch case in
    gen_visit_object_members()
  qapi: Generate enum count as definition in gen_enum_lookup()

 audio/audio.c          |  6 ------
 audio/audio_template.h |  3 ---
 migration/migration.c  |  2 --
 replay/replay-input.c  | 12 ------------
 scripts/qapi/types.py  | 11 +++++++----
 scripts/qapi/visit.py  |  2 --
 softmmu/tpm-hmp-cmds.c |  2 --
 ui/input-linux.c       |  4 ----
 ui/input.c             |  6 ------
 9 files changed, 7 insertions(+), 41 deletions(-)

-- 
2.38.1



             reply	other threads:[~2023-02-24 15:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 15:54 Philippe Mathieu-Daudé [this message]
2023-02-24 15:54 ` [PATCH 1/2] qapi: Do not generate default switch case in gen_visit_object_members() Philippe Mathieu-Daudé
2023-02-27 12:40   ` Juan Quintela
2023-02-27 13:14   ` Markus Armbruster
2023-02-24 15:54 ` [PATCH 2/2] qapi: Generate enum count as definition in gen_enum_lookup() Philippe Mathieu-Daudé
2023-02-24 21:16   ` Richard Henderson
2023-02-27 12:41   ` Juan Quintela
2023-02-27 13:10   ` Markus Armbruster
2023-03-15 10:32     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230224155451.20211-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanb@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).