Correctly interpret SWIG return code of type check

This commit is contained in:
Thomas Krijnen
2015-06-17 19:44:15 +00:00
parent 48676a733f
commit 6aabbd4a55
+1 -2
View File
@@ -76,8 +76,7 @@
IfcParse::IfcLateBoundEntity* cast_pyobject(PyObject* element) { IfcParse::IfcLateBoundEntity* cast_pyobject(PyObject* element) {
void *arg = 0; void *arg = 0;
int res = SWIG_ConvertPtr(element, &arg, SWIGTYPE_p_IfcParse__IfcLateBoundEntity, 0); int res = SWIG_ConvertPtr(element, &arg, SWIGTYPE_p_IfcParse__IfcLateBoundEntity, 0);
if (!res) return static_cast<IfcParse::IfcLateBoundEntity*>(0); return static_cast<IfcParse::IfcLateBoundEntity*>(SWIG_IsOK(res) ? arg : 0);
return reinterpret_cast<IfcParse::IfcLateBoundEntity*>(arg);
} }
template <typename T> template <typename T>