From 5710153e7310995b5d4127af267e36d8529b3b30 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 16 Sep 2015 13:06:15 +0200 Subject: 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}. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrange Message-Id: <1442401589-24189-13-git-send-email-armbru@redhat.com> --- scripts/qapi.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index ba32aac..0ffd02d 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1441,9 +1441,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 value.endswith(pointer_suffix) - def genindent(count): ret = "" for i in range(count): -- cgit v1.1