From b816a45767ed12dae689e65da0c9c518d9e47b07 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Wed, 7 Aug 2024 20:21:01 +0200 Subject: [PATCH] fix: use more fitting calls, cast return type --- swiglpk/glpk.i | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swiglpk/glpk.i b/swiglpk/glpk.i index c13e2d8..a8550a6 100644 --- a/swiglpk/glpk.i +++ b/swiglpk/glpk.i @@ -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) @@ -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) { @@ -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) @@ -294,7 +294,7 @@ doubleArray* as_doubleArray(PyObject *list) { double_arr[idx+1] = PyFloat_AsDouble(item); } - return pinst; + return (doubleArray*)pinst; } %}