mirror of
https://github.com/yuzu-mirror/unicorn.git
synced 2026-01-08 17:50:12 +01:00
qapi: Replace dirty is_c_ptr() by method c_null()
is_c_ptr() looks whether the end of the C text for the type looks like
a pointer. Works, but is fragile.
We now have a better tool: use QAPISchemaType method c_null(). The
initializers for non-pointers become prettier: 0, false or the
enumeration constant with the value 0 instead of {0}.
Backports commit 5710153e7310995b5d4127af267e36d8529b3b30 from qemu
This commit is contained in:
parent
abfa5da7da
commit
64e9fceab9
|
|
@ -1437,9 +1437,6 @@ def c_type(value, is_param=False):
|
|||
assert isinstance(value, str) and value != ""
|
||||
return c_name(value) + pointer_suffix
|
||||
|
||||
def is_c_ptr(value):
|
||||
return c_type(value).endswith(pointer_suffix)
|
||||
|
||||
def genindent(count):
|
||||
ret = ""
|
||||
for i in range(count):
|
||||
|
|
|
|||
Loading…
Reference in a new issue