[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/9] qapi: allow build_params to return "void"
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH 2/9] qapi: allow build_params to return "void" |
Date: |
Wed, 4 Jul 2018 16:45:00 +0800 |
When there is no parameter at all for a function prototype, return
"void" for the parameter list. This will happen after the next patch
where we removed the Error* for some of the emit functions.
Signed-off-by: Peter Xu <address@hidden>
---
scripts/qapi/common.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 8b6708dbf1..105c82742f 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1963,7 +1963,7 @@ extern const QEnumLookup %(c_name)s_lookup;
def build_params(arg_type, boxed, extra):
if not arg_type:
assert not boxed
- return extra
+ return extra if extra else "void"
ret = ''
sep = ''
if boxed:
@@ -1980,7 +1980,7 @@ def build_params(arg_type, boxed, extra):
c_name(memb.name))
if extra:
ret += sep + extra
- return ret
+ return ret if ret else "void"
#
--
2.17.1