aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkmodule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkmodule.cpp')
-rw-r--r--sources/shiboken2/libshiboken/sbkmodule.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/sources/shiboken2/libshiboken/sbkmodule.cpp b/sources/shiboken2/libshiboken/sbkmodule.cpp
index a29ec38c..9321725d 100644
--- a/sources/shiboken2/libshiboken/sbkmodule.cpp
+++ b/sources/shiboken2/libshiboken/sbkmodule.cpp
@@ -43,10 +43,10 @@
#include <unordered_map>
/// This hash maps module objects to arrays of Python types.
-typedef std::unordered_map<PyObject *, PyTypeObject **> ModuleTypesMap;
+using ModuleTypesMap = std::unordered_map<PyObject *, PyTypeObject **> ;
/// This hash maps module objects to arrays of converters.
-typedef std::unordered_map<PyObject *, SbkConverter **> ModuleConvertersMap;
+using ModuleConvertersMap = std::unordered_map<PyObject *, SbkConverter **>;
/// All types produced in imported modules are mapped here.
static ModuleTypesMap moduleTypes;
@@ -57,10 +57,10 @@ namespace Shiboken
namespace Module
{
-PyObject* import(const char* moduleName)
+PyObject *import(const char *moduleName)
{
- PyObject* sysModules = PyImport_GetModuleDict();
- PyObject* module = PyDict_GetItemString(sysModules, moduleName);
+ PyObject *sysModules = PyImport_GetModuleDict();
+ PyObject *module = PyDict_GetItemString(sysModules, moduleName);
if (module)
Py_INCREF(module);
else
@@ -72,39 +72,39 @@ PyObject* import(const char* moduleName)
return module;
}
-PyObject* create(const char* moduleName, void* moduleData)
+PyObject *create(const char *moduleName, void *moduleData)
{
Shiboken::init();
#ifndef IS_PY3K
return Py_InitModule(moduleName, reinterpret_cast<PyMethodDef *>(moduleData));
#else
- return PyModule_Create(reinterpret_cast<PyModuleDef*>(moduleData));
+ return PyModule_Create(reinterpret_cast<PyModuleDef *>(moduleData));
#endif
}
-void registerTypes(PyObject* module, PyTypeObject** types)
+void registerTypes(PyObject *module, PyTypeObject **types)
{
- ModuleTypesMap::iterator iter = moduleTypes.find(module);
+ auto iter = moduleTypes.find(module);
if (iter == moduleTypes.end())
moduleTypes.insert(std::make_pair(module, types));
}
-PyTypeObject** getTypes(PyObject* module)
+PyTypeObject **getTypes(PyObject *module)
{
- ModuleTypesMap::iterator iter = moduleTypes.find(module);
+ auto iter = moduleTypes.find(module);
return (iter == moduleTypes.end()) ? 0 : iter->second;
}
-void registerTypeConverters(PyObject* module, SbkConverter** converters)
+void registerTypeConverters(PyObject *module, SbkConverter **converters)
{
- ModuleConvertersMap::iterator iter = moduleConverters.find(module);
+ auto iter = moduleConverters.find(module);
if (iter == moduleConverters.end())
moduleConverters.insert(std::make_pair(module, converters));
}
-SbkConverter** getTypeConverters(PyObject* module)
+SbkConverter **getTypeConverters(PyObject *module)
{
- ModuleConvertersMap::iterator iter = moduleConverters.find(module);
+ auto iter = moduleConverters.find(module);
return (iter == moduleConverters.end()) ? 0 : iter->second;
}