massive typemap unification
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7676 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5bbd841acc
commit
7e5e4fd1f9
144 changed files with 6378 additions and 7248 deletions
|
|
@ -173,33 +173,18 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
|||
size_t i;
|
||||
for (i = 0; constants[i].type; ++i) {
|
||||
switch(constants[i].type) {
|
||||
case SWIG_PY_INT:
|
||||
obj = PyInt_FromLong(constants[i].lvalue);
|
||||
break;
|
||||
case SWIG_PY_FLOAT:
|
||||
obj = PyFloat_FromDouble(constants[i].dvalue);
|
||||
break;
|
||||
case SWIG_PY_STRING:
|
||||
if (constants[i].pvalue) {
|
||||
obj = PyString_FromString((char *) constants[i].pvalue);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
obj = Py_None;
|
||||
}
|
||||
break;
|
||||
case SWIG_PY_POINTER:
|
||||
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
|
||||
break;
|
||||
case SWIG_PY_BINARY:
|
||||
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
|
||||
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype), 0);
|
||||
break;
|
||||
default:
|
||||
obj = 0;
|
||||
break;
|
||||
}
|
||||
if (obj) {
|
||||
PyDict_SetItemString(d,constants[i].name,obj);
|
||||
Py_DECREF(obj);
|
||||
PyDict_SetItemString(d, constants[i].name, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -250,10 +235,6 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
|
|||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------*
|
||||
* Initialize type list
|
||||
* -----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue