diff mbox

[v4,05/16] qapi: Simplify c_enum_const()

Message ID 1431607862-9238-6-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake May 14, 2015, 12:50 p.m. UTC
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 scripts/qapi.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Alberto Garcia May 19, 2015, 8:12 a.m. UTC | #1
On Thu 14 May 2015 02:50:51 PM CEST, Eric Blake <eblake@redhat.com> wrote:
> From: Markus Armbruster <armbru@redhat.com>
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto
Markus Armbruster May 19, 2015, 10:15 a.m. UTC | #2
Alberto Garcia <berto@igalia.com> writes:

> On Thu 14 May 2015 02:50:51 PM CEST, Eric Blake <eblake@redhat.com> wrote:
>> From: Markus Armbruster <armbru@redhat.com>
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> Reviewed-by: Alberto Garcia <berto@igalia.com>

Already in master.  Thanks anyway!
diff mbox

Patch

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 1258f76..b917cad 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)