From 376a36e792d160b1db7267c4a49edb39ef53c1bf Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 18 Apr 2008 16:16:05 +0000 Subject: Cleanup white space, fix a spelling, align some comments. --- numpy/core/src/arrayobject.c | 190 +++++++++++++++++++++---------------------- 1 file changed, 95 insertions(+), 95 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 260fdf468..4496b53d4 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -876,7 +876,7 @@ int _flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) { dptr = PyArray_BYTES(dst); elsize = PyArray_ITEMSIZE(dst); nbytes = elsize * PyArray_DIM(src, axis); - + /* Refcount note: src and dst have the same size */ PyArray_INCREF((PyArrayObject *)src); PyArray_XDECREF((PyArrayObject *)dst); @@ -1004,7 +1004,7 @@ _broadcast_copy(PyArrayObject *dest, PyArrayObject *src, PyArray_INCREF(dest); PyArray_XDECREF(src); - + Py_DECREF(multi); return 0; } @@ -1558,7 +1558,7 @@ _default_copyswapn(void *dst, npy_intp dstride, void *src, PyArray_CopySwapFunc *copyswap; char *dstptr = dst; char *srcptr = src; - + copyswap = PyArray_DESCR(arr)->f->copyswap; for (i=0; i= 0x02050000 - (unaryfunc)array_index, /* nb_index */ + (unaryfunc)array_index, /* nb_index */ #endif }; @@ -4131,27 +4131,27 @@ array_contains(PyArrayObject *self, PyObject *el) static PySequenceMethods array_as_sequence = { #if PY_VERSION_HEX >= 0x02050000 - (lenfunc)array_length, /*sq_length*/ - (binaryfunc)NULL, /* sq_concat is handled by nb_add*/ + (lenfunc)array_length, /*sq_length*/ + (binaryfunc)NULL, /*sq_concat is handled by nb_add*/ (ssizeargfunc)NULL, (ssizeargfunc)array_item_nice, (ssizessizeargfunc)array_slice, - (ssizeobjargproc)array_ass_item, /*sq_ass_item*/ + (ssizeobjargproc)array_ass_item, /*sq_ass_item*/ (ssizessizeobjargproc)array_ass_slice, /*sq_ass_slice*/ - (objobjproc) array_contains, /* sq_contains */ - (binaryfunc) NULL, /* sg_inplace_concat */ + (objobjproc) array_contains, /*sq_contains */ + (binaryfunc) NULL, /*sg_inplace_concat */ (ssizeargfunc)NULL, #else - (inquiry)array_length, /*sq_length*/ - (binaryfunc)NULL, /* sq_concat is handled by nb_add*/ - (intargfunc)NULL, /* sq_repeat is handled nb_multiply*/ + (inquiry)array_length, /*sq_length*/ + (binaryfunc)NULL, /*sq_concat is handled by nb_add*/ + (intargfunc)NULL, /*sq_repeat is handled nb_multiply*/ (intargfunc)array_item_nice, /*sq_item*/ (intintargfunc)array_slice, /*sq_slice*/ - (intobjargproc)array_ass_item, /*sq_ass_item*/ + (intobjargproc)array_ass_item, /*sq_ass_item*/ (intintobjargproc)array_ass_slice, /*sq_ass_slice*/ - (objobjproc) array_contains, /* sq_contains */ - (binaryfunc) NULL, /* sg_inplace_concat */ - (intargfunc) NULL /* sg_inplace_repeat */ + (objobjproc) array_contains, /*sq_contains */ + (binaryfunc) NULL, /*sg_inplace_concat */ + (intargfunc) NULL /*sg_inplace_repeat */ #endif }; @@ -6807,63 +6807,63 @@ array_alloc(PyTypeObject *type, Py_ssize_t nitems) static PyTypeObject PyArray_Type = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "numpy.ndarray", /*tp_name*/ - sizeof(PyArrayObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + 0, /*ob_size*/ + "numpy.ndarray", /*tp_name*/ + sizeof(PyArrayObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - (destructor)array_dealloc, /*tp_dealloc */ - (printfunc)NULL, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ - (reprfunc)array_repr, /*tp_repr*/ - &array_as_number, /*tp_as_number*/ - &array_as_sequence, /*tp_as_sequence*/ - &array_as_mapping, /*tp_as_mapping*/ - (hashfunc)0, /*tp_hash*/ - (ternaryfunc)0, /*tp_call*/ - (reprfunc)array_str, /*tp_str*/ - - (getattrofunc)0, /*tp_getattro*/ - (setattrofunc)0, /*tp_setattro*/ - &array_as_buffer, /*tp_as_buffer*/ + (destructor)array_dealloc, /*tp_dealloc */ + (printfunc)NULL, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + (cmpfunc)0, /*tp_compare*/ + (reprfunc)array_repr, /*tp_repr*/ + &array_as_number, /*tp_as_number*/ + &array_as_sequence, /*tp_as_sequence*/ + &array_as_mapping, /*tp_as_mapping*/ + (hashfunc)0, /*tp_hash*/ + (ternaryfunc)0, /*tp_call*/ + (reprfunc)array_str, /*tp_str*/ + + (getattrofunc)0, /*tp_getattro*/ + (setattrofunc)0, /*tp_setattro*/ + &array_as_buffer, /*tp_as_buffer*/ (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE - | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/ + | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/ /*Documentation string */ - 0, /*tp_doc*/ + 0, /*tp_doc*/ - (traverseproc)0, /*tp_traverse */ - (inquiry)0, /*tp_clear */ - (richcmpfunc)array_richcompare, /*tp_richcompare */ - offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */ + (traverseproc)0, /*tp_traverse */ + (inquiry)0, /*tp_clear */ + (richcmpfunc)array_richcompare, /*tp_richcompare */ + offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */ /* Iterator support (use standard) */ - (getiterfunc)array_iter, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ + (getiterfunc)array_iter, /* tp_iter */ + (iternextfunc)0, /* tp_iternext */ /* Sub-classing (new-style object) support */ - array_methods, /* tp_methods */ - 0, /* tp_members */ - array_getsetlist, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)0, /* tp_init */ - array_alloc, /* tp_alloc */ - (newfunc)array_new, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + array_methods, /* tp_methods */ + 0, /* tp_members */ + array_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)0, /* tp_init */ + array_alloc, /* tp_alloc */ + (newfunc)array_new, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0 /* tp_weaklist */ }; /* The rest of this code is to build the right kind of array from a python */ @@ -11040,7 +11040,7 @@ arraydescr_names_set(PyArray_Descr *self, PyObject *val) PyObject *new_names; if (self->names == NULL) { PyErr_SetString(PyExc_ValueError, "there are no fields defined"); - return -1; + return -1; } N = PyTuple_GET_SIZE(self->names); @@ -11057,14 +11057,14 @@ arraydescr_names_set(PyArray_Descr *self, PyObject *val) valid = PyString_Check(item); Py_DECREF(item); if (!valid) { - PyErr_Format(PyExc_ValueError, - "item #%d of names is of type %s and not string", + PyErr_Format(PyExc_ValueError, + "item #%d of names is of type %s and not string", i, item->ob_type->tp_name); return -1; } } /* Update dictionary keys in fields */ - new_names = PySequence_Tuple(val); + new_names = PySequence_Tuple(val); for (i=0; ifields, key); new_key = PyTuple_GET_ITEM(new_names, i); PyDict_SetItem(self->fields, new_key, item); - PyDict_DelItem(self->fields, key); + PyDict_DelItem(self->fields, key); } /* Replace names */ Py_DECREF(self->names); self->names = new_names; - + return 0; } -- cgit v1.2.1