[Numpy-svn] r2717 - in trunk/numpy/core: include/numpy src

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Jul 1 12:53:18 EDT 2006


Author: oliphant
Date: 2006-07-01 11:53:14 -0500 (Sat, 01 Jul 2006)
New Revision: 2717

Modified:
   trunk/numpy/core/include/numpy/arrayobject.h
   trunk/numpy/core/src/arrayobject.c
   trunk/numpy/core/src/scalartypes.inc.src
Log:
Fix typo shown in #164 and change dummy to two in PyArrayInterface

Modified: trunk/numpy/core/include/numpy/arrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/arrayobject.h	2006-06-30 21:56:21 UTC (rev 2716)
+++ trunk/numpy/core/include/numpy/arrayobject.h	2006-07-01 16:53:14 UTC (rev 2717)
@@ -1463,7 +1463,7 @@
    http://numeric.scipy.org/array_interface.html for the full
    documentation. */
 typedef struct {
-    int dummy;            /* contains the integer 2 as a sanity check */
+    int two;              /* contains the integer 2 as a sanity check */
     int nd;               /* number of dimensions */
     char typekind;        /* kind in array --- character code of typestr */
     int itemsize;         /* size of each element */

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2006-06-30 21:56:21 UTC (rev 2716)
+++ trunk/numpy/core/src/arrayobject.c	2006-07-01 16:53:14 UTC (rev 2717)
@@ -540,7 +540,7 @@
 #elif SIZEOF_INTP == SIZEOF_INT
 	descr = &INT_Descr;
 #else
-	descr = &LONGLONG_DESCR;
+	descr = &LONGLONG_Descr;
 #endif
 	arr = NULL;
 
@@ -5787,7 +5787,7 @@
         PyArrayInterface *inter;
 
         inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface));
-        inter->dummy = 2;
+        inter->two = 2;
         inter->nd = self->nd;
         inter->typekind = self->descr->kind;
         inter->itemsize = self->descr->elsize;
@@ -6253,7 +6253,7 @@
 		if (PyCObject_Check(e)) {
 			PyArrayInterface *inter;
 			inter = (PyArrayInterface *)PyCObject_AsVoidPtr(e);
-			if (inter->dummy == 2) {
+			if (inter->two == 2) {
 				d = inter->nd;
 			}
 		}
@@ -6453,7 +6453,7 @@
                 char buf[40];
                 if (PyCObject_Check(ip)) {
                         inter=(PyArrayInterface *)PyCObject_AsVoidPtr(ip);
-                        if (inter->dummy == 2) {
+                        if (inter->two == 2) {
                                 snprintf(buf, 40, "|%c%d", inter->typekind,
 					 inter->itemsize);
 				chktype = _array_typedescr_fromstr(buf);
@@ -7214,7 +7214,7 @@
 	}
 	if (!PyCObject_Check(attr)) goto fail;
 	inter = PyCObject_AsVoidPtr(attr);
-	if (inter->dummy != 2) goto fail;
+	if (inter->two != 2) goto fail;
 	if ((inter->flags & NOTSWAPPED) != NOTSWAPPED) {
 		endian = PyArray_OPPBYTE;
 		inter->flags &= ~NOTSWAPPED;

Modified: trunk/numpy/core/src/scalartypes.inc.src
===================================================================
--- trunk/numpy/core/src/scalartypes.inc.src	2006-06-30 21:56:21 UTC (rev 2716)
+++ trunk/numpy/core/src/scalartypes.inc.src	2006-07-01 16:53:14 UTC (rev 2717)
@@ -729,7 +729,7 @@
  
         arr = (PyArrayObject *)PyArray_FromScalar(self, NULL);
         inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface));
-        inter->dummy = 2;
+        inter->two = 2;
         inter->nd = 0;
         inter->flags = arr->flags;
         inter->typekind = arr->descr->kind;




More information about the Numpy-svn mailing list