aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkconverter_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkconverter_p.h')
-rw-r--r--sources/shiboken2/libshiboken/sbkconverter_p.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/sources/shiboken2/libshiboken/sbkconverter_p.h b/sources/shiboken2/libshiboken/sbkconverter_p.h
index b38561780..7efccbab4 100644
--- a/sources/shiboken2/libshiboken/sbkconverter_p.h
+++ b/sources/shiboken2/libshiboken/sbkconverter_p.h
@@ -215,22 +215,6 @@ struct OverFlowChecker<float, PY_LONG_LONG, true> :
};
// Basic primitive type converters ---------------------------------------------------------
-template<typename T> PyTypeObject* SbkType() { return 0; }
-template<> inline PyTypeObject* SbkType<PY_LONG_LONG>() { return &PyLong_Type; }
-template<> inline PyTypeObject* SbkType<bool>() { return &PyBool_Type; }
-template<> inline PyTypeObject* SbkType<char>() { return &PyInt_Type; }
-template<> inline PyTypeObject* SbkType<const char*>() { return &PyString_Type; }
-template<> inline PyTypeObject* SbkType<double>() { return &PyFloat_Type; }
-template<> inline PyTypeObject* SbkType<float>() { return &PyFloat_Type; }
-template<> inline PyTypeObject* SbkType<int>() { return &PyInt_Type; }
-template<> inline PyTypeObject* SbkType<long>() { return &PyLong_Type; }
-template<> inline PyTypeObject* SbkType<short>() { return &PyInt_Type; }
-template<> inline PyTypeObject* SbkType<signed char>() { return &PyInt_Type; }
-template<> inline PyTypeObject* SbkType<unsigned PY_LONG_LONG>() { return &PyLong_Type; }
-template<> inline PyTypeObject* SbkType<unsigned char>() { return &PyInt_Type; }
-template<> inline PyTypeObject* SbkType<unsigned int>() { return &PyLong_Type; }
-template<> inline PyTypeObject* SbkType<unsigned long>() { return &PyLong_Type; }
-template<> inline PyTypeObject* SbkType<unsigned short>() { return &PyInt_Type; }
template <typename T> struct Primitive {};
@@ -242,8 +226,11 @@ struct OnePrimitive
static void toCpp(PyObject*, void*) {}
static SbkConverter* createConverter()
{
- SbkConverter* converter = Shiboken::Conversions::createConverter(SbkType<T>(), Primitive<T>::toPython);
- Shiboken::Conversions::addPythonToCppValueConversion(converter, Primitive<T>::toCpp, Primitive<T>::isConvertible);
+ SbkConverter* converter = Shiboken::Conversions::createConverter(Shiboken::SbkType<T>(),
+ Primitive<T>::toPython);
+ Shiboken::Conversions::addPythonToCppValueConversion(converter,
+ Primitive<T>::toCpp,
+ Primitive<T>::isConvertible);
return converter;
}
};