mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 07:35:47 +00:00
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]
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user