summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2008-08-10 20:05:49 +0000
committerTravis Oliphant <oliphant@enthought.com>2008-08-10 20:05:49 +0000
commit75c15c8c697eba656e333612821d44cdd46134fe (patch)
tree5c060635957de96064cf5dcc59c11e05b99f9b8b /numpy/core/src/arrayobject.c
parentfd932a4a0aa9e3c26f3fa968b06b9332dfc229b8 (diff)
downloadnumpy-75c15c8c697eba656e333612821d44cdd46134fe.tar.gz
*Full recompile needed*: changed the name of hasobject structure member to flags in the PyArray_Descr structure and increased it's size to int
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 1fbbe6a9e..5b2390f03 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -11155,7 +11155,7 @@ static PyMemberDef arraydescr_members[] = {
{"byteorder", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL},
{"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL},
{"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL},
- {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL},
+ {"flags", T_UBYTE, offsetof(PyArray_Descr, flags), RO, NULL},
{NULL},
};
@@ -11553,7 +11553,7 @@ arraydescr_reduce(PyArray_Descr *self, PyObject *args)
PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize));
PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment));
- PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject));
+ PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->flags));
PyTuple_SET_ITEM(ret, 2, state);
return ret;
@@ -11565,7 +11565,8 @@ arraydescr_reduce(PyArray_Descr *self, PyObject *args)
static int
_descr_find_object(PyArray_Descr *self)
{
- if (self->hasobject || self->type_num == PyArray_OBJECT ||
+ if (PyDataType_FLAGCHK(self, NPY_ITEM_HASOBJECT) ||
+ self->type_num == PyArray_OBJECT ||
self->kind == 'O')
return NPY_OBJECT_DTYPE_FLAGS;
if (PyDescr_HASFIELDS(self)) {
@@ -11581,7 +11582,7 @@ _descr_find_object(PyArray_Descr *self)
return 0;
}
if (_descr_find_object(new)) {
- new->hasobject = NPY_OBJECT_DTYPE_FLAGS;
+ new->flags = NPY_OBJECT_DTYPE_FLAGS;
return NPY_OBJECT_DTYPE_FLAGS;
}
}
@@ -11712,9 +11713,9 @@ arraydescr_setstate(PyArray_Descr *self, PyObject *args)
self->alignment = alignment;
}
- self->hasobject = dtypeflags;
+ self->flags = dtypeflags;
if (version < 3) {
- self->hasobject = _descr_find_object(self);
+ self->flags = _descr_find_object(self);
}
Py_INCREF(Py_None);
return Py_None;