Skip to content

Commit 8cd683f

Browse files
committed
not sure if this is the best fix
1 parent f374ad7 commit 8cd683f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/method_bodies.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,32 @@ geo_strf_dyn_height(PyObject *NPY_UNUSED(self), PyObject *args)
2626
ct_a = (PyArrayObject *)PyArray_ContiguousFromAny(ct_o, NPY_DOUBLE, 1, 1);
2727
if (ct_a == NULL)
2828
{
29-
Py_XDECREF(sa_a);
29+
Py_XDECREF((PyObject *)sa_a);
3030
return NULL;
3131
}
3232
p_a = (PyArrayObject *)PyArray_ContiguousFromAny(p_o, NPY_DOUBLE, 1, 1);
3333
if (p_a == NULL)
3434
{
35-
Py_XDECREF(sa_a);
36-
Py_XDECREF(ct_a);
35+
Py_XDECREF((PyObject *)sa_a);
36+
Py_XDECREF((PyObject *)ct_a);
3737
return NULL;
3838
}
3939
n_levels = PyArray_DIM(sa_a, 0);
4040
if (PyArray_DIM(ct_a, 0) != n_levels || PyArray_DIM(p_a, 0) != n_levels)
4141
{
4242
PyErr_SetString(PyExc_ValueError,
4343
"Arguments SA, CT, and p must have the same dimensions.");
44-
Py_XDECREF(sa_a);
45-
Py_XDECREF(ct_a);
46-
Py_XDECREF(p_a);
44+
Py_XDECREF((PyObject *)sa_a);
45+
Py_XDECREF((PyObject *)ct_a);
46+
Py_XDECREF((PyObject *)p_a);
4747
return NULL;
4848
}
4949
dh_a = (PyArrayObject *)PyArray_NewLikeArray(sa_a, NPY_CORDER, NULL, 0);
5050
if (dh_a == NULL)
5151
{
52-
Py_XDECREF(sa_a);
53-
Py_XDECREF(ct_a);
54-
Py_XDECREF(p_a);
52+
Py_XDECREF((PyObject *)sa_a);
53+
Py_XDECREF((PyObject *)ct_a);
54+
Py_XDECREF((PyObject *)p_a);
5555
return NULL;
5656
}
5757
ret = gsw_geo_strf_dyn_height((double *)PyArray_DATA(sa_a),
@@ -60,15 +60,15 @@ geo_strf_dyn_height(PyObject *NPY_UNUSED(self), PyObject *args)
6060
p_ref,
6161
n_levels,
6262
(double *)PyArray_DATA(dh_a));
63-
Py_XDECREF(sa_a);
64-
Py_XDECREF(ct_a);
65-
Py_XDECREF(p_a);
63+
Py_XDECREF((PyObject *)sa_a);
64+
Py_XDECREF((PyObject *)ct_a);
65+
Py_XDECREF((PyObject *)p_a);
6666

6767
if (ret == NULL)
6868
{
6969
PyErr_SetString(PyExc_RuntimeError,
7070
"gws_geo_strf_dyn_height failed; check input arguments");
71-
Py_XDECREF(dh_a);
71+
Py_XDECREF((PyObject *)dh_a);
7272
return NULL;
7373
}
7474
return (PyObject *)dh_a;

0 commit comments

Comments
 (0)