From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnM6u-0002JU-Cb for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnM6q-0000np-C7 for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:08:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnM6q-0000nh-6d for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:08:40 -0400 From: Markus Armbruster References: <1427995743-7865-1-git-send-email-armbru@redhat.com> <1427995743-7865-3-git-send-email-armbru@redhat.com> <551DB94A.5050304@redhat.com> Date: Wed, 29 Apr 2015 09:08:36 +0200 In-Reply-To: <551DB94A.5050304@redhat.com> (Eric Blake's message of "Thu, 02 Apr 2015 15:48:58 -0600") Message-ID: <87fv7je7ij.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC 02/19] qapi: Fix C identifiers generated for names containing '.' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 04/02/2015 11:28 AM, Markus Armbruster wrote: >> c_fun() maps '.' to '_', c_var() doesn't. Nothing prevents '.' in >> QAPI names that get passed to c_var(). >> >> Which QAPI names get passed to c_fun(), to c_var(), or to both is not >> obvious. Names of command parameters and struct type members get >> passed to c_var(). >> >> c_var() strips a leading '*', but this cannot happen. c_fun() >> doesn't. >> >> Fix c_var() to work exactly like c_fun(). >> >> Perhaps they should be replaced by a single mapping function. > > How much harder is that to do? Not hard at all. I refrained from doing it for another reason, namely that it would remove "variable" vs. "function" information from the source. This distinction may not be useful, and whether it's actually done consistently in the source is even more doubtful, but I didn't wish to decide that when I wrote the patch. You're pursuing it in your "Fix C identifiers generated for names containing '.'" series now. I'll review. > Also, this commit probably means my qapi testsuite enhancements ought to > add tests that we support downstream extensions (__name.name_blah) in a > variety of situations. But I'm merely adding it to my (growing) list of > post-series additions, and won't hold up v6 adding it. > >> >> Signed-off-by: Markus Armbruster >> --- >> scripts/qapi.py | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) > > If it's not too hard to use a single mapping function, that might look > prettier. But from the raw perspective of fixing an inconsistency in > the code: > > Reviewed-by: Eric Blake Thanks!