[Numpy-svn] r5097 - trunk/numpy/core/include/numpy
numpy-svn at scipy.org
numpy-svn at scipy.org
Sat Apr 26 17:37:29 EDT 2008
Author: charris
Date: 2008-04-26 16:37:27 -0500 (Sat, 26 Apr 2008)
New Revision: 5097
Modified:
trunk/numpy/core/include/numpy/ndarrayobject.h
trunk/numpy/core/include/numpy/ufuncobject.h
Log:
Revert to 5092.
Modified: trunk/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 21:37:11 UTC (rev 5096)
+++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 21:37:27 UTC (rev 5097)
@@ -1137,22 +1137,25 @@
PyArray_FastTakeFunc *fasttake;
} PyArray_ArrFuncs;
-/* The item must be reference counted when it is inserted or extracted. */
-#define NPY_ITEM_REFCOUNT 0x01
-/* Same as needing REFCOUNT */
-#define NPY_ITEM_HASOBJECT 0x01
-/* Convert to list for pickling */
-#define NPY_LIST_PICKLE 0x02
-/* The item is a POINTER */
-#define NPY_ITEM_IS_POINTER 0x04
-/* memory needs to be initialized for this data-type */
-#define NPY_NEEDS_INIT 0x08
-/* operations need Python C-API so don't give-up thread. */
-#define NPY_NEEDS_PYAPI 0x10
-/* Use f.getitem when extracting elements of this data-type */
-#define NPY_USE_GETITEM 0x20
-/* Use f.setitem when setting creating 0-d array from this data-type.*/
-#define NPY_USE_SETITEM 0x40
+#define NPY_ITEM_REFCOUNT 0x01 /* The item must be reference counted
+ when it is inserted or extracted. */
+#define NPY_ITEM_HASOBJECT 0x01 /* Same as needing REFCOUNT */
+
+#define NPY_LIST_PICKLE 0x02 /* Convert to list for pickling */
+#define NPY_ITEM_IS_POINTER 0x04 /* The item is a POINTER */
+
+#define NPY_NEEDS_INIT 0x08 /* memory needs to be initialized
+ for this data-type */
+
+#define NPY_NEEDS_PYAPI 0x10 /* operations need Python C-API
+ so don't give-up thread. */
+
+#define NPY_USE_GETITEM 0x20 /* Use f.getitem when extracting elements
+ of this data-type */
+
+#define NPY_USE_SETITEM 0x40 /* Use f.setitem when setting creating
+ 0-d array from this data-type.
+ */
/* define NPY_IS_COMPLEX */
/* These are inherited for global data-type if any data-types in the field
@@ -1369,15 +1372,15 @@
#define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS
#define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL;
#define NPY_BEGIN_THREADS _save = PyEval_SaveThread();
-#define NPY_END_THREADS do {if (_save) PyEval_RestoreThread(_save);} while (0);
+#define NPY_END_THREADS if (_save) PyEval_RestoreThread(_save);
#define NPY_BEGIN_THREADS_DESCR(dtype) \
- do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \
- NPY_BEGIN_THREADS;} while (0);
+ if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \
+ NPY_BEGIN_THREADS
#define NPY_END_THREADS_DESCR(dtype) \
- do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \
- NPY_END_THREADS; } while (0);
+ if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \
+ NPY_END_THREADS
#define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__;
#define NPY_ALLOW_C_API __save__ = PyGILState_Ensure();
Modified: trunk/numpy/core/include/numpy/ufuncobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 21:37:11 UTC (rev 5096)
+++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 21:37:27 UTC (rev 5097)
@@ -174,8 +174,8 @@
#if NPY_ALLOW_THREADS
-#define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj)) _save = PyEval_SaveThread();} while (0)
-#define NPY_LOOP_END_THREADS do {if (!(loop->obj)) PyEval_RestoreThread(_save);} while (0)
+#define NPY_LOOP_BEGIN_THREADS if (!(loop->obj)) {_save = PyEval_SaveThread();}
+#define NPY_LOOP_END_THREADS if (!(loop->obj)) {PyEval_RestoreThread(_save);}
#else
#define NPY_LOOP_BEGIN_THREADS
#define NPY_LOOP_END_THREADS
@@ -213,12 +213,12 @@
#define UFUNC_PYVALS_NAME "UFUNC_PYVALS"
#define UFUNC_CHECK_ERROR(arg) \
- do {if (((arg)->obj && PyErr_Occurred()) || \
+ if (((arg)->obj && PyErr_Occurred()) || \
((arg)->errormask && \
PyUFunc_checkfperr((arg)->errormask, \
(arg)->errobj, \
&(arg)->first))) \
- goto fail;} while (0)
+ goto fail
/* This code checks the IEEE status flags in a platform-dependent way */
/* Adapted from Numarray */
More information about the Numpy-svn
mailing list