diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-08-31 14:37:58 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-09-03 17:06:40 +0200 |
commit | 1889e57a7140c4f89c8fd9a217f8c3845eb48b5b (patch) | |
tree | 86307aa6c4f5b872aeaaf0ce760566c579c1c43c /scripts/qapi/gen.py | |
parent | 3e038d7d7a2616e12a07b08df6a9c9239ff7f228 (diff) |
qapi: Simplify QAPISchemaIfCond's interface for generating C
QAPISchemaIfCond.cgen() is only ever used like
gen_if(ifcond.cgen())
and
gen_endif(ifcond.cgen())
Simplify to
ifcond.gen_if()
and
ifcond.gen_endif()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210831123809.1107782-2-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[Import statements tidied up with isort]
Diffstat (limited to 'scripts/qapi/gen.py')
-rw-r--r-- | scripts/qapi/gen.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 51a597a025..ab26d5c937 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -24,8 +24,6 @@ from typing import ( from .common import ( c_fname, c_name, - gen_endif, - gen_if, guardend, guardstart, mcgen, @@ -95,9 +93,9 @@ def _wrap_ifcond(ifcond: QAPISchemaIfCond, before: str, after: str) -> str: if added[0] == '\n': out += '\n' added = added[1:] - out += gen_if(ifcond.cgen()) + out += ifcond.gen_if() out += added - out += gen_endif(ifcond.cgen()) + out += ifcond.gen_endif() return out |