| 2171 | } |
| 2172 | |
| 2173 | static int |
| 2174 | _arraydescr_isnative(PyArray_Descr *self) |
| 2175 | { |
| 2176 | if (!PyDataType_HASFIELDS(self)) { |
| 2177 | return PyArray_ISNBO(self->byteorder); |
| 2178 | } |
| 2179 | else { |
| 2180 | PyObject *key, *value, *title = NULL; |
| 2181 | PyArray_Descr *new; |
| 2182 | int offset; |
| 2183 | Py_ssize_t pos = 0; |
| 2184 | while (PyDict_Next(self->fields, &pos, &key, &value)) { |
| 2185 | if (NPY_TITLE_KEY(key, value)) { |
| 2186 | continue; |
| 2187 | } |
| 2188 | if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { |
| 2189 | return -1; |
| 2190 | } |
| 2191 | if (!_arraydescr_isnative(new)) { |
| 2192 | return 0; |
| 2193 | } |
| 2194 | } |
| 2195 | } |
| 2196 | return 1; |
| 2197 | } |
| 2198 | |
| 2199 | /* |
| 2200 | * return Py_True if this data-type descriptor |
no outgoing calls
no test coverage detected