Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/fast/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static PyArray_Descr *dtype_of(PyObject *obj)
{
if (PyArray_Check(obj)) {
PyArray_Descr *descr = PyArray_DESCR((PyArrayObject *)obj);
Py_INCREF(descr);
Py_INCREF((PyObject *)descr);
return descr;
}
PyArray_Descr *descr = NULL;
Expand All @@ -249,7 +249,7 @@ static PyArray_Descr *dtype_of(PyObject *obj)
return NULL;
}
descr = PyArray_DESCR((PyArrayObject *)array);
Py_INCREF(descr);
Py_INCREF((PyObject *)descr);
Py_DECREF(array);
return descr;
}
Expand All @@ -276,13 +276,13 @@ static PyObject *broadcast_view(PyArrayObject *array, npy_intp *dims, int nd)
}
}
PyArray_Descr *descr = PyArray_DESCR(array);
Py_INCREF(descr);
Py_INCREF((PyObject *)descr);
PyObject *view = PyArray_NewFromDescr(&PyArray_Type, descr, nd, dims, strides,
PyArray_DATA(array), 0, NULL);
if (view == NULL) {
return NULL;
}
Py_INCREF(array);
Py_INCREF((PyObject *)array);
if (PyArray_SetBaseObject((PyArrayObject *)view, (PyObject *)array) < 0) {
Py_DECREF(view);
return NULL;
Expand All @@ -308,7 +308,7 @@ static int subdtype(PyArray_Descr *descr, PyObject *base)
cls = (PyObject *)base_descr->typeobj;
}
int result = PyObject_IsSubclass((PyObject *)descr->typeobj, cls);
Py_XDECREF(base_descr);
Py_XDECREF((PyObject *)base_descr);
if (result < 0) {
PyErr_Clear();
return -1;
Expand Down
1 change: 1 addition & 0 deletions src/fast/fast.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion src/fast/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static PyObject *fast_wrap(PyObject *module, PyObject *const *args, Py_ssize_t n
Context *context = (Context *)PyType_GenericAlloc(ContextType, 0);
if (text == NULL || copied_name == NULL || def == NULL || context == NULL) {
Py_DECREF(doc);
Py_XDECREF(context);
Py_XDECREF((PyObject *)context);
free(text);
free(copied_name);
free(def);
Expand Down
Loading