From bbb83c0fe889e5b6c4eecda45b94617102d574f2 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 25 Apr 2008 06:01:52 +0000 Subject: Some cleanups --- numpy/core/src/arrayobject.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 719bb5342..3d53325bc 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -4173,36 +4173,44 @@ dump_data(char **string, int *n, int *max_n, char *data, int nd, if (nd == 0) { - if ((op = descr->f->getitem(data, self)) == NULL) return -1; + if ((op = descr->f->getitem(data, self)) == NULL) { + return -1; + } sp = PyObject_Repr(op); - if (sp == NULL) {Py_DECREF(op); return -1;} + if (sp == NULL) { + Py_DECREF(op); + return -1; + } ostring = PyString_AsString(sp); N = PyString_Size(sp)*sizeof(char); *n += N; CHECK_MEMORY - memmove(*string+(*n-N), ostring, N); + memmove(*string + (*n - N), ostring, N); Py_DECREF(sp); Py_DECREF(op); return 0; - } else { + } + else { CHECK_MEMORY (*string)[*n] = '['; *n += 1; - for(i=0; idata, self->nd, self->dimensions, self->strides, self) < 0) { - _pya_free(string); return NULL; + _pya_free(string); + return NULL; } if (repr) { -- cgit v1.2.1