diff options
author | mattip <matti.picus@gmail.com> | 2019-11-07 14:40:10 -0700 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-11-07 14:40:10 -0700 |
commit | 576fc474cc3e0442a3faed5ad08de08cb74febbc (patch) | |
tree | 3cbc41bbba6c0adab5e454014a77e905a47a2184 /numpy | |
parent | ca5ae6426239e838bc6020726f5e93d0dcf74707 (diff) | |
download | numpy-576fc474cc3e0442a3faed5ad08de08cb74febbc.tar.gz |
MAINT: fixes from review
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 2426073b6..5900e2456 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -713,11 +713,11 @@ discover_itemsize(PyObject *s, int nd, int *itemsize, int string_type) return 0; } -enum NDISOVER_RET { +typedef enum { DISCOVERED_OK = 0, DISCOVERED_RAGGED = 1, - DISCOVERED_DICT = 2 -}; + DISCOVERED_OBJECT = 2 +} discovered_t; /* * Take an arbitrary object and discover how many dimensions it @@ -726,7 +726,7 @@ enum NDISOVER_RET { static int discover_dimensions(PyObject *obj, int *maxndim, npy_intp *d, int check_it, int stop_at_string, int stop_at_tuple, - enum NDISOVER_RET *out_is_object) + discovered_t *out_is_object) { PyObject *e; npy_intp n, i; @@ -912,7 +912,7 @@ discover_dimensions(PyObject *obj, int *maxndim, npy_intp *d, int check_it, if (PyErr_ExceptionMatches(PyExc_KeyError)) { PyErr_Clear(); *maxndim = 0; - *out_is_object = DISCOVERED_DICT; + *out_is_object = DISCOVERED_OBJECT; return 0; } else { @@ -1817,7 +1817,7 @@ PyArray_GetArrayParamsFromObject(PyObject *op, if (!writeable && PySequence_Check(op)) { int check_it, stop_at_string, stop_at_tuple; int type_num, type; - enum NDISOVER_RET is_object = DISCOVERED_OK; + discovered_t is_object = DISCOVERED_OK; /* * Determine the type, using the requested data type if @@ -1893,6 +1893,7 @@ PyArray_GetArrayParamsFromObject(PyObject *op, return -1; } } + /* either DISCOVERED_OBJECT or there is a requested_dtype */ Py_DECREF(*out_dtype); *out_dtype = PyArray_DescrFromType(NPY_OBJECT); if (*out_dtype == NULL) { |