From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAOX1-0003f6-Gp for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:23:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAOWw-0006EN-QR for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:22:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAOWw-0006Dl-JD for qemu-devel@nongnu.org; Wed, 01 Jul 2015 16:22:50 -0400 From: Markus Armbruster Date: Wed, 1 Jul 2015 22:22:34 +0200 Message-Id: <1435782155-31412-47-git-send-email-armbru@redhat.com> In-Reply-To: <1435782155-31412-1-git-send-email-armbru@redhat.com> References: <1435782155-31412-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH RFC v2 46/47] qapi-introspect: Map all integer types to 'int' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com How many bits we use internally is an implementation detail. It could be pressed into external interface service as a very approximate range information, but that's probably a bad idea. If we need range information, we better do it properly. Reduces output of query-schema by a negligible 0.5 out of 80KiB. Signed-off-by: Markus Armbruster --- scripts/qapi-introspect.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py index e7efc4a..961fe88 100644 --- a/scripts/qapi-introspect.py +++ b/scripts/qapi-introspect.py @@ -46,6 +46,13 @@ char %(c_name)s[] = "[" self.used_types = None def _use_type(self, typ): + # Map the various integer types to plain int + if typ.json_type() == 'int': + typ = self.schema.lookup_type('int') + elif isinstance(typ, QAPISchemaArrayType) \ + and typ.element_type.json_type() == 'int': + typ = self.schema.lookup_type('intList') + # Add type to work queue if new if typ not in self.used_types: self.used_types.append(typ) return typ.name -- 1.9.3