diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-08 17:04:58 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:08:56 -0300 |
commit | 6d69fbb13907e80ab87f86bc9407fc4ab0a102d7 (patch) | |
tree | 0d96b5d81b1f70d6a51e4a22419745ede68cded8 /libshiboken/conversions.h | |
parent | 95d5b63552f804e7fc5b80428cabb34f57443c0b (diff) |
Create enum python types on the fly, avoiding generation of structs and duplication of many C functions.
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r-- | libshiboken/conversions.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index d4059b565..67e627926 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -491,11 +491,11 @@ struct EnumConverter static inline PyObject* toPython(void* cppobj) { return toPython(*reinterpret_cast<CppEnum*>(cppobj)); } static inline PyObject* toPython(CppEnum cppenum) { - return SbkEnumObject_New(SbkType<CppEnum>(), (long) cppenum); + return Shiboken::Enum::newItem(Shiboken::SbkType<CppEnum>(), (long) cppenum); } - static inline CppEnum toCpp(PyObject* pyobj) + static inline CppEnum toCpp(PyObject* pyObj) { - return (CppEnum) reinterpret_cast<SbkEnumObject*>(pyobj)->ob_ival; + return (CppEnum) Shiboken::Enum::getValue(pyObj);; } }; |