diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2012-02-01 18:42:25 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-02-04 16:11:39 -0700 |
commit | 8a0e7cd26ea2803b8580dcca1d1306baa1d702dc (patch) | |
tree | 47af5fff3afe569556ea1824358296f87efdc327 /numpy | |
parent | c4b92ea0a2530c1dfe582d7f5635a0b793286166 (diff) | |
download | numpy-8a0e7cd26ea2803b8580dcca1d1306baa1d702dc.tar.gz |
UPDATE: Replace macros in old_defines.h by new.
With the exception of the numarray fixups these were all instances
that were results of code generation.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/code_generators/generate_umath.py | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/arraytypes.c.src | 22 | ||||
-rw-r--r-- | numpy/core/src/multiarray/scalartypes.c.src | 4 | ||||
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 4 | ||||
-rw-r--r-- | numpy/numarray/_capi.c | 4 | ||||
-rw-r--r-- | numpy/numarray/include/numpy/arraybase.h | 32 |
6 files changed, 34 insertions, 34 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index 052947e37..7e8ed1d2b 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -884,7 +884,7 @@ def make_arrays(funcdict): funclist.append('%s_%s' % (tname, name)) for x in t.in_ + t.out: - siglist.append('PyArray_%s' % (english_upper(chartoname[x]),)) + siglist.append('NPY_%s' % (english_upper(chartoname[x]),)) k += 1 diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index 8f72f919e..1d81be8a8 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -3550,11 +3550,11 @@ static PyArray_ArrFuncs _Py@NAME@_ArrFuncs = { static PyArray_Descr @from@_Descr = { PyObject_HEAD_INIT(&PyArrayDescr_Type) &Py@NAME@ArrType_Type, - PyArray_@from@LTR, - PyArray_@from@LTR, + NPY_@from@LTR, + NPY_@from@LTR, '@endian@', 0, - PyArray_@from@, + NPY_@from@, 0, _ALIGN(@align@), NULL, @@ -3659,11 +3659,11 @@ static PyArray_ArrFuncs _Py@NAME@_ArrFuncs = { NPY_NO_EXPORT PyArray_Descr @from@_Descr = { PyObject_HEAD_INIT(&PyArrayDescr_Type) &Py@NAME@ArrType_Type, - PyArray_@kind@LTR, - PyArray_@from@LTR, + NPY_@kind@LTR, + NPY_@from@LTR, '@endian@', @isobject@, - PyArray_@from@, + NPY_@from@, @num@*sizeof(@fromtyp@), _ALIGN(@fromtyp@), NULL, @@ -3900,8 +3900,8 @@ set_typeinfo(PyObject *dict) #else s = Py_BuildValue("ciii@cx@@cn@O", #endif - PyArray_@name@LTR, - PyArray_@name@, + NPY_@name@LTR, + NPY_@name@, BITSOF_@uname@, _ALIGN(@type@), @max@, @@ -3922,11 +3922,11 @@ set_typeinfo(PyObject *dict) */ PyDict_SetItemString(infodict, "@name@", #if defined(NPY_PY3K) - s = Py_BuildValue("CiiiO", PyArray_@name@LTR, + s = Py_BuildValue("CiiiO", NPY_@name@LTR, #else - s = Py_BuildValue("ciiiO", PyArray_@name@LTR, + s = Py_BuildValue("ciiiO", NPY_@name@LTR, #endif - PyArray_@name@, + NPY_@name@, BITSOF_@name@, _ALIGN(@type@), (PyObject *) &Py@Name@ArrType_Type)); diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index 71fc8ad95..dc9facfc4 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -2549,7 +2549,7 @@ finish: return NULL; } /* typecode will be NULL */ - typecode = PyArray_DescrFromType(PyArray_@TYPE@); + typecode = PyArray_DescrFromType(NPY_@TYPE@); dest = scalar_value(obj, typecode); src = scalar_value(robj, typecode); Py_DECREF(typecode); @@ -3719,7 +3719,7 @@ initialize_casting_tables(void) * #SCKIND = BOOL, (INTNEG, INTPOS)*5, FLOAT*4, * COMPLEX*3# */ - _npy_scalar_kinds_table[NPY_@NAME@] = PyArray_@SCKIND@_SCALAR; + _npy_scalar_kinds_table[NPY_@NAME@] = NPY_@SCKIND@_SCALAR; _npy_next_larger_type_table[NPY_@NAME@] = @BIGGERTYPE@; /**end repeat**/ diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index 113d39fa0..24f5ebfe8 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -600,8 +600,8 @@ _@name@_convert_to_ctype(PyObject *a, npy_@name@ *arg1) return -1; } descr1 = PyArray_DescrFromTypeObject((PyObject *)Py_TYPE(a)); - if (PyArray_CanCastSafely(descr1->type_num, PyArray_@NAME@)) { - PyArray_CastScalarDirect(a, descr1, arg1, PyArray_@NAME@); + if (PyArray_CanCastSafely(descr1->type_num, NPY_@NAME@)) { + PyArray_CastScalarDirect(a, descr1, arg1, NPY_@NAME@); Py_DECREF(descr1); return 0; } diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c index deb2cd478..7b866a8be 100644 --- a/numpy/numarray/_capi.c +++ b/numpy/numarray/_capi.c @@ -2828,7 +2828,7 @@ NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type, if (byteorder != NA_ByteOrder()) { PyArray_Descr *temp; - temp = PyArray_DescrNewByteorder(dtype, PyArray_SWAP); + temp = PyArray_DescrNewByteorder(dtype, NPY_SWAP); Py_DECREF(dtype); if (temp == NULL) return NULL; dtype = temp; @@ -2856,7 +2856,7 @@ NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type, newdims.len = ndim; newdims.ptr = shape; newself = (PyArrayObject *)\ - PyArray_Newshape(self, &newdims, PyArray_CORDER); + PyArray_Newshape(self, &newdims, NPY_CORDER); Py_DECREF(self); self = newself; } diff --git a/numpy/numarray/include/numpy/arraybase.h b/numpy/numarray/include/numpy/arraybase.h index 32f9948f4..02430b08a 100644 --- a/numpy/numarray/include/numpy/arraybase.h +++ b/numpy/numarray/include/numpy/arraybase.h @@ -20,22 +20,22 @@ typedef npy_float64 Float64; typedef enum { - tAny=-1, - tBool=PyArray_BOOL, - tInt8=PyArray_INT8, - tUInt8=PyArray_UINT8, - tInt16=PyArray_INT16, - tUInt16=PyArray_UINT16, - tInt32=PyArray_INT32, - tUInt32=PyArray_UINT32, - tInt64=PyArray_INT64, - tUInt64=PyArray_UINT64, - tFloat32=PyArray_FLOAT32, - tFloat64=PyArray_FLOAT64, - tComplex32=PyArray_COMPLEX64, - tComplex64=PyArray_COMPLEX128, - tObject=PyArray_OBJECT, /* placeholder... does nothing */ - tMaxType=PyArray_NTYPES, + tAny = -1, + tBool = NPY_BOOL, + tInt8 = NPY_INT8, + tUInt8 = NPY_UINT8, + tInt16 = NPY_INT16, + tUInt16 = NPY_UINT16, + tInt32 = NPY_INT32, + tUInt32 = NPY_UINT32, + tInt64 = NPY_INT64, + tUInt64 = NPY_UINT64, + tFloat32 = NPY_FLOAT32, + tFloat64 = NPY_FLOAT64, + tComplex32 = NPY_COMPLEX64, + tComplex64 = NPY_COMPLEX128, + tObject = NPY_OBJECT, /* placeholder... does nothing */ + tMaxType = NPY_NTYPES, tDefault = tFloat64, #if NPY_BITSOF_LONG == 64 tLong = tInt64, |