Skip to content

Commit

Permalink
fix: use more fitting calls, cast return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Aug 7, 2024
1 parent 65f32b3 commit b816a45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions swiglpk/glpk.i
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ intArray* as_intArray(PyObject *list) {
return NULL;
}

PyObject *pinst = PyObject_Call(pclass, pargs);
PyObject *pinst = PyObject_CallObject(pclass, pargs);
Py_DECREF(pclass);
Py_DECREF(pargs);
if (!pinst)
Expand Down Expand Up @@ -216,7 +216,7 @@ intArray* as_intArray(PyObject *list) {
int_arr[idx+1] = PyInt_AsLong(item);
}

return pinst;
return (intArray*)pinst;
}

doubleArray* as_doubleArray(PyObject *list) {
Expand Down Expand Up @@ -251,7 +251,7 @@ doubleArray* as_doubleArray(PyObject *list) {
return NULL;
}

PyObject *pinst = PyObject_Call(pclass, pargs);
PyObject *pinst = PyObject_CallObject(pclass, pargs);
Py_DECREF(pclass);
Py_DECREF(pargs);
if (!pinst)
Expand Down Expand Up @@ -294,7 +294,7 @@ doubleArray* as_doubleArray(PyObject *list) {
double_arr[idx+1] = PyFloat_AsDouble(item);
}

return pinst;
return (doubleArray*)pinst;
}
%}

Expand Down

0 comments on commit b816a45

Please sign in to comment.