comparison PyExtensionManager.cpp @ 66:5664fe298af2

Update to Python 2.7 and clean up the build (avoid using deprecated NumPy API, fix compiler warnings)
author Chris Cannam
date Mon, 17 Nov 2014 09:37:59 +0000
parents 27bab3a16c9a
children 146d14ab15e7
comparison
equal deleted inserted replaced
65:0df94e3f0fdb 66:5664fe298af2
20 using std::string; 20 using std::string;
21 using std::vector; 21 using std::vector;
22 using std::find; 22 using std::find;
23 23
24 //static 24 //static
25 char* PyExtensionManager::m_exposedNames[] = { 25 const char* PyExtensionManager::m_exposedNames[] = {
26 "ParameterDescriptor", 26 "ParameterDescriptor",
27 "OutputDescriptor", 27 "OutputDescriptor",
28 "ParameterList", 28 "ParameterList",
29 "OutputList", 29 "OutputList",
30 "FeatureList", 30 "FeatureList",
150 PyObject *pyPlugDict = PyModule_GetDict(pyPlugModule); 150 PyObject *pyPlugDict = PyModule_GetDict(pyPlugModule);
151 if (!pyPlugDict) return; 151 if (!pyPlugDict) return;
152 152
153 int i = 0; 153 int i = 0;
154 while (PyExtensionManager::m_exposedNames[i]) { 154 while (PyExtensionManager::m_exposedNames[i]) {
155 char* name = PyExtensionManager::m_exposedNames[i]; 155 const char* name = PyExtensionManager::m_exposedNames[i];
156 i++; 156 i++;
157 PyObject *key = PyString_FromString(name); 157 PyObject *key = PyString_FromString(name);
158 if (!key) break; 158 if (!key) break;
159 if (PyDict_Contains(pyPlugDict,key)) { 159 if (PyDict_Contains(pyPlugDict,key)) {
160 if (PyDict_SetItem(pyPlugDict,key,Py_None) != 0) 160 if (PyDict_SetItem(pyPlugDict,key,Py_None) != 0)