[Numpy-svn] r3178 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 18 15:26:11 CDT 2006


Author: oliphant
Date: 2006-09-18 15:25:17 -0500 (Mon, 18 Sep 2006)
New Revision: 3178

Modified:
   trunk/numpy/core/src/multiarraymodule.c
Log:
Fixed #282

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2006-09-18 20:12:21 UTC (rev 3177)
+++ trunk/numpy/core/src/multiarraymodule.c	2006-09-18 20:25:17 UTC (rev 3178)
@@ -4569,11 +4569,13 @@
 			if (align) {
 				int _align = newdescr->alignment;
 				if (_align > 1) totalsize =		\
-					((totalsize + _align - 1)/_align)*_align;
-				maxalign = MAX(maxalign,_align);
+					((totalsize + _align - 1)/_align)* \
+                                        _align;
 			}
 			PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(totalsize));
 		}
+                if (align)
+                        maxalign = MAX(maxalign,newdescr->alignment);
 		if (len == 3) PyTuple_SET_ITEM(tup, 2, item);
 		name = PyObject_GetItem(names, index);
 		Py_DECREF(index);
@@ -4586,13 +4588,14 @@
 		/* Insert into dictionary */
 		if (PyDict_GetItem(fields, name) != NULL) {
 			PyErr_SetString(PyExc_ValueError,
-					"name already used as a name or title");
+					"name already used as a name or "\
+                                        "title");
 			ret = PY_FAIL;
 		}
 		PyDict_SetItem(fields, name, tup);
 		Py_DECREF(name);
 		if (len == 3) {
-			if ((PyString_Check(item) || PyUnicode_Check(item)) && \
+			if ((PyString_Check(item) || PyUnicode_Check(item)) &&
 			    PyDict_GetItem(fields, item) != NULL) {
 				PyErr_SetString(PyExc_ValueError,
 						"title already used as a "\



More information about the Numpy-svn mailing list