From patchwork Tue May 5 12:30:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 468098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D8E791409F8 for ; Tue, 5 May 2015 22:34:13 +1000 (AEST) Received: from localhost ([::1]:38926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypc3A-0006Lp-1t for incoming@patchwork.ozlabs.org; Tue, 05 May 2015 08:34:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypc0H-0001RV-I5 for qemu-devel@nongnu.org; Tue, 05 May 2015 08:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypc0B-0002de-MM for qemu-devel@nongnu.org; Tue, 05 May 2015 08:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypc0B-0002dA-G9 for qemu-devel@nongnu.org; Tue, 05 May 2015 08:31:07 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t45CV2lI013657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 May 2015 08:31:03 -0400 Received: from red.redhat.com (ovpn-113-25.phx2.redhat.com [10.3.113.25]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t45CUvnA009312; Tue, 5 May 2015 08:31:01 -0400 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 5 May 2015 06:30:46 -0600 Message-Id: <1430829055-4739-6-git-send-email-eblake@redhat.com> In-Reply-To: <1430829055-4739-1-git-send-email-eblake@redhat.com> References: <1430829055-4739-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v3 05/14] qapi: Simplify c_enum_const() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Eric Blake --- scripts/qapi.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index b3628fd..9209fd5 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -961,6 +961,4 @@ def camel_to_upper(value): return new_name.lstrip('_').upper() def c_enum_const(type_name, const_name): - abbrev_string = camel_to_upper(type_name) - value_string = camel_to_upper(const_name) - return "%s_%s" % (abbrev_string, value_string) + return camel_to_upper(type_name + '_' + const_name)