diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-10 19:57:58 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-10 20:20:49 -0300 |
commit | e750294ed669ec541a6d297ab4f8906e66204794 (patch) | |
tree | 180802708dfac60762c3969f0b4d0a1654332f86 /libshiboken | |
parent | d1ec4ab5b10d8d2ef125af08bccf467076791815 (diff) |
Fixed checkType of int and floating point converters.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r-- | libshiboken/conversions.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index 0d9c38608..065820447 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -373,7 +373,7 @@ struct OverFlowChecker<float, true> template <typename PyIntEquiv> struct Converter_PyInt { - static inline bool checkType(PyObject* pyobj) { return PyNumber_Check(pyobj); } + static inline bool checkType(PyObject* pyobj) { return PyInt_Check(pyobj); } static inline bool isConvertible(PyObject* pyobj) { return PyNumber_Check(pyobj); } static inline PyObject* toPython(void* cppobj) { return toPython(*reinterpret_cast<PyIntEquiv*>(cppobj)); } static inline PyObject* toPython(const PyIntEquiv& cppobj) { return PyInt_FromLong((long) cppobj); } @@ -471,7 +471,7 @@ struct Converter<unsigned PY_LONG_LONG> template <typename PyFloatEquiv> struct Converter_PyFloat { - static inline bool checkType(PyObject* obj) { return PyNumber_Check(obj); } + static inline bool checkType(PyObject* obj) { return PyFloat_Check(obj); } static inline bool isConvertible(PyObject* obj) { return PyNumber_Check(obj); } static inline PyObject* toPython(void* cppobj) { return toPython(*reinterpret_cast<PyFloatEquiv*>(cppobj)); } static inline PyObject* toPython(PyFloatEquiv cppobj) { return PyFloat_FromDouble((double) cppobj); } |