diff options
author | mattip <matti.picus@gmail.com> | 2018-06-19 04:13:10 -0700 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-06-19 22:54:57 -0700 |
commit | 73494682ab4cb3469ade494c113672094ce13f47 (patch) | |
tree | db056cbc90ebb640f45411b5ce8fe345adb6f633 | |
parent | 82bc85de39dfae3c04de250c3ca409ad41863ea6 (diff) | |
download | numpy-73494682ab4cb3469ade494c113672094ce13f47.tar.gz |
fixes from review
-rw-r--r-- | numpy/core/src/multiarray/nditer_api.c | 6 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_constr.c | 5 | ||||
-rw-r--r-- | numpy/core/src/multiarray/nditer_pywrap.c | 2 | ||||
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 4 |
4 files changed, 8 insertions, 9 deletions
diff --git a/numpy/core/src/multiarray/nditer_api.c b/numpy/core/src/multiarray/nditer_api.c index f88ab56e9..7a33ac05e 100644 --- a/numpy/core/src/multiarray/nditer_api.c +++ b/numpy/core/src/multiarray/nditer_api.c @@ -2800,11 +2800,7 @@ npyiter_has_writeback(NpyIter *iter) } nop = NIT_NOP(iter); op_itflags = NIT_OPITFLAGS(iter); - /* If NPY_OP_ITFLAG_HAS_WRITEBACK flag set on operand, resolve it. - * If the resolution fails (should never happen), continue from the - * next operand and discard the writeback scratch buffers, and return - * failure status - */ + for (iop=0; iop<nop; iop++) { if (op_itflags[iop] & NPY_OP_ITFLAG_HAS_WRITEBACK) { return NPY_TRUE; diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c index edfc43e3d..c56376f58 100644 --- a/numpy/core/src/multiarray/nditer_constr.c +++ b/numpy/core/src/multiarray/nditer_constr.c @@ -691,7 +691,10 @@ NpyIter_Deallocate(NpyIter *iter) } } - /* Deallocate all the dtypes and objects that were iterated */ + /* + * Deallocate all the dtypes and objects that were iterated and resolve + * any writeback buffers created by the iterator + */ for(iop = 0; iop < nop; ++iop, ++dtype, ++object) { if (op_itflags[iop] & NPY_OP_ITFLAG_HAS_WRITEBACK) { if (resolve && PyArray_ResolveWritebackIfCopy(*object) < 0) { diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c index 480a6ad5a..5a9f3c5fa 100644 --- a/numpy/core/src/multiarray/nditer_pywrap.c +++ b/numpy/core/src/multiarray/nditer_pywrap.c @@ -1185,7 +1185,7 @@ npyiter_dealloc(NewNpyArrayIterObject *self) "operands. Typically nditer is used as a context manager " "otherwise 'close' must be called before reading iteration " "results.", 1) < 0) { - PyObject * s; + PyObject *s; s = PyUString_FromString("npyiter_dealloc"); if (s) { diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index bc117549d..59fc5aa20 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -2814,7 +2814,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, Py_XDECREF(full_args.in); Py_XDECREF(full_args.out); - NPY_UF_DBG_PRINT("Returning Success\n"); + NPY_UF_DBG_PRINT1("Returning code %d\n", reval); return retval; @@ -3013,7 +3013,7 @@ PyUFunc_GenericFunction(PyUFuncObject *ufunc, Py_XDECREF(full_args.out); Py_XDECREF(wheremask); - NPY_UF_DBG_PRINT("Returning Success\n"); + NPY_UF_DBG_PRINT("Returning success code 0\n"); return 0; |