[Spice-commits] python_modules/ptypes.py

Alon Levy alon at kemper.freedesktop.org
Thu Jun 14 03:54:00 PDT 2012


 python_modules/ptypes.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a976c16cf3f77c38d9006c3d39c96d6c8aa04110
Author: Alon Levy <alevy at redhat.com>
Date:   Thu Jun 14 11:43:20 2012 +0300

    python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation
    
    Fixes the resulting enums.h from the invocation of:
    ./spice_codegen.py --generate-enums spice.proto spice-protocol/spice/enums.h
    
    Right now any enum will contain None as the enum members, with this fix
    it will contain the real enum members, i.e. SPICE_FOO.

diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 132ba99..d9fbfe2 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -234,7 +234,7 @@ class EnumBaseType(Type):
         return codegen.prefix_camel(self.name)
 
     def c_enumname(self, value):
-        self.c_enumname_by_name(self.names[value])
+        return self.c_enumname_by_name(self.names[value])
 
     def c_enumname_by_name(self, name):
         if self.has_attr("prefix"):


More information about the Spice-commits mailing list