From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJmpk-00047P-Ge for qemu-devel@nongnu.org; Mon, 27 Jul 2015 14:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJmph-0000w1-Ak for qemu-devel@nongnu.org; Mon, 27 Jul 2015 14:09:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJmph-0000vx-51 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 14:09:01 -0400 From: Markus Armbruster References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-29-git-send-email-armbru@redhat.com> <55B021D5.5070602@redhat.com> Date: Mon, 27 Jul 2015 20:08:57 +0200 In-Reply-To: <55B021D5.5070602@redhat.com> (Eric Blake's message of "Wed, 22 Jul 2015 17:05:57 -0600") Message-ID: <87twspscau.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC v2 28/47] qapi-commands: Convert to QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 07/01/2015 02:22 PM, Markus Armbruster wrote: >> Output unchanged except for white-space. > > Indeed, and the diffstat shows it was only one blank line: > > qga-qmp-marshal.c | 1 + > 1 file changed, 1 insertion(+) > > MUCH friendlier to review :) > >> >> Signed-off-by: Markus Armbruster >> --- >> scripts/qapi-commands.py | 157 >> ++++++++++++++++++++++++++--------------------- >> scripts/qapi.py | 2 +- >> 2 files changed, 87 insertions(+), 72 deletions(-) >> > > Here, I can confidently say: > > Reviewed-by: Eric Blake Thanks! >> +++ b/scripts/qapi.py >> @@ -1366,7 +1366,7 @@ def c_type(value, is_param=False): >> return c_name(value) + pointer_suffix >> >> def is_c_ptr(value): >> - return c_type(value).endswith(pointer_suffix) >> + return value.endswith(pointer_suffix) > > Perhaps this cleanup could be floated earlier in the series? Before this patch, is_c_ptr() is called with an argument suitable for c_type(). It returns true when c_type() returns a string ending with pointer_suffix. This patch replaces uses of function c_type() by QAPISchemaType method c_type(). Two ways to do that for the is_c_ptr() calls: 1. Change the argument to a QAPISchemaType object, and make is_c_ptr() call its .c_type(). 2. Change the argument to a string, and make the caller compute it by calling the appropriate object's .c_type(). I picked 2. It hardly matters, because is_c_ptr() will go away in the next patch. I could do a part of 2. in an earlier patch, namely lifting the c_type() call into the callers. But I can't do the conversion from function to method any earlier, because the objects become available only in this patch.