Received: from eggs.gnu.org ([2001:4830:134:3::10]:34434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwn9z-0000Ii-Bs for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:23:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwn9y-0007lO-LV for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:23:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwn9y-0007lD-Fw for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:23:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 11269A58BD for ; Thu, 12 Nov 2015 08:23:09 +0000 (UTC) From: Markus Armbruster References: <1447279028-2114-1-git-send-email-eblake@redhat.com> <1447279028-2114-2-git-send-email-eblake@redhat.com> Date: Thu, 12 Nov 2015 09:23:07 +0100 In-Reply-To: <1447279028-2114-2-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 11 Nov 2015 14:57:07 -0700") Message-ID: <87bnazvd78.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for-2.5 1/2] input: Avoid CamelCase in InputEvent enums List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, kraxel@redhat.com Eric Blake writes: > Our documentation states that we prefer 'lower-case', rather than > 'CamelCase', for qapi enum values. The InputButton and InputAxis > enums violated this convention. However, they are currently used > primarily for generating code that is used internally; their only > exposure through QMP is via the experimental 'x-input-send-event' > command. Since this is experimental, changing the QMP wire format > for that command is acceptable. > > The existing c_enum_const() code in the generator for turning the > enum names into C constants happens to munge both pre- and > post-patch spellings to the same C code, which means making the > change now touches very few files. But we are considering a > future patch which would change c_enum_const() to use > c_name(V).upper() rather than camel_to_upper(), which would render > 'WheelUp' as INPUT_BUTTON_WHEELUP instead of its current > INPUT_BUTTON_WHEEL_UP. Making the change to the enum values now > will isolate these enums from any impact if the generator munging > algorithm is changed. > > Note that SDL code uses the spelling WHEELUP rather than WHEEL_UP > in its constants, but that shouldn't drive our decision. > > Fix a typo in the qapi docs for InputAxis while at it. > > CC: Gerd Hoffmann > Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster I can take this through my tree if Gerd doesn't object.