diff options
| author | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 00:24:12 +0000 |
|---|---|---|
| committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 00:24:12 +0000 |
| commit | 1acf453e6bdbac5e176806b0ad07ad33e32a5f40 (patch) | |
| tree | 87a5ee0373b5ac70c33df30ba84ee9dff5035667 /numpy/numarray | |
| parent | 8904c7ab8d3e5fb1233e80586c5a4c6b7df4a14b (diff) | |
| download | numpy-1acf453e6bdbac5e176806b0ad07ad33e32a5f40.tar.gz | |
Apply npy_ and NPY_ prefixes to all C-API names that don't already have PyArray_ prefixes.
Diffstat (limited to 'numpy/numarray')
| -rw-r--r-- | numpy/numarray/_capi.c | 22 | ||||
| -rw-r--r-- | numpy/numarray/numpy/arraybase.h | 22 | ||||
| -rw-r--r-- | numpy/numarray/numpy/nummacro.h | 10 |
3 files changed, 31 insertions, 23 deletions
diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c index 2de18988f..f28e90fc0 100644 --- a/numpy/numarray/_capi.c +++ b/numpy/numarray/_capi.c @@ -1026,9 +1026,9 @@ NA_OutputArray(PyObject *a, NumarrayType t, int requires) } ret = (PyArrayObject *)PyArray_Empty(PyArray_NDIM(a), PyArray_DIMS(a), dtype, 0); - ret->flags |= UPDATEIFCOPY; + ret->flags |= NPY_UPDATEIFCOPY; ret->base = a; - PyArray_FLAGS(a) &= ~WRITEABLE; + PyArray_FLAGS(a) &= ~NPY_WRITEABLE; Py_INCREF(a); return ret; } @@ -1045,7 +1045,7 @@ copy from the temporary back to the original. static PyArrayObject * NA_IoArray(PyObject *a, NumarrayType t, int requires) { - PyArrayObject *shadow = NA_InputArray(a, t, requires | UPDATEIFCOPY ); + PyArrayObject *shadow = NA_InputArray(a, t, requires | NPY_UPDATEIFCOPY ); if (!shadow) return NULL; @@ -2217,7 +2217,7 @@ NA_isPythonScalar(PyObject *o) return rval; } -#if (SIZEOF_INTP == 8) +#if (NPY_SIZEOF_INTP == 8) #define PlatBigInt PyInt_FromLong #define PlatBigUInt PyLong_FromUnsignedLong #else @@ -2460,7 +2460,7 @@ NA_typeObjectToTypeNo(PyObject *typeObj) { PyArray_Descr *dtype; int i; - if (PyArray_DescrConverter(typeObj, &dtype) == PY_FAIL) i=-1; + if (PyArray_DescrConverter(typeObj, &dtype) == NPY_FAIL) i=-1; else i=dtype->type_num; return i; } @@ -2482,7 +2482,7 @@ static PyObject * NA_getType( PyObject *type) { PyArray_Descr *typeobj = NULL; - if (!type && PyArray_DescrConverter(type, &typeobj) == PY_FAIL) { + if (!type && PyArray_DescrConverter(type, &typeobj) == NPY_FAIL) { PyErr_Format(PyExc_ValueError, "NA_getType: unknown type."); typeobj = NULL; } @@ -2672,7 +2672,7 @@ NA_swapAxes(PyArrayObject *array, int x, int y) array->strides[x] = array->strides[y]; array->strides[y] = temp; - PyArray_UpdateFlags(array, UPDATE_ALL_FLAGS); + PyArray_UpdateFlags(array, NPY_UPDATE_ALL); return 0; } @@ -2761,7 +2761,7 @@ NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type, 0, NULL); } else { - intp size = dtype->elsize; + npy_intp size = dtype->elsize; int i; for(i=0; i<self->nd; i++) { size *= self->dimensions[i]; @@ -2777,20 +2777,20 @@ NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type, static void NA_updateAlignment(PyArrayObject *self) { - PyArray_UpdateFlags(self, ALIGNED); + PyArray_UpdateFlags(self, NPY_ALIGNED); } static void NA_updateContiguous(PyArrayObject *self) { - PyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN); + PyArray_UpdateFlags(self, NPY_CONTIGUOUS | NPY_FORTRAN); } static void NA_updateStatus(PyArrayObject *self) { - PyArray_UpdateFlags(self, UPDATE_ALL_FLAGS); + PyArray_UpdateFlags(self, NPY_UPDATE_ALL); } static int diff --git a/numpy/numarray/numpy/arraybase.h b/numpy/numarray/numpy/arraybase.h index 6461d80fc..9ed87eb13 100644 --- a/numpy/numarray/numpy/arraybase.h +++ b/numpy/numarray/numpy/arraybase.h @@ -2,10 +2,21 @@ #define _arraybase_h 1 #define SZ_BUF 79 -#define MAXDIM MAX_DIMS +#define MAXDIM NPY_MAXDIMS #define MAXARGS 18 -#define maybelong intp +typedef npy_intp maybelong; +typedef npy_bool Bool; +typedef npy_int8 Int8; +typedef npy_uint8 UInt8; +typedef npy_int16 Int16; +typedef npy_uint16 UInt16; +typedef npy_int32 Int32; +typedef npy_uint32 UInt32; +typedef npy_int64 Int64; +typedef npy_int64 UInt64; +typedef npy_float32 Float32; +typedef npy_float64 Float64; typedef enum { @@ -43,15 +54,14 @@ typedef enum NUM_BIG_ENDIAN = 1 } NumarrayByteOrder; -#define Complex64 Complex64_ typedef struct { Float32 r, i; } Complex32; typedef struct { Float64 r, i; } Complex64; -#define WRITABLE WRITEABLE +#define WRITABLE NPY_WRITEABLE #define CHECKOVERFLOW 0x800 #define UPDATEDICT 0x1000 -#define FORTRAN_CONTIGUOUS FORTRAN -#define IS_CARRAY (CONTIGUOUS | ALIGNED) +#define FORTRAN_CONTIGUOUS NPY_FORTRAN +#define IS_CARRAY (NPY_CONTIGUOUS | NPY_ALIGNED) #define PyArray(m) ((PyArrayObject *)(m)) #define PyArray_ISFORTRAN_CONTIGUOUS(m) (((PyArray(m))->flags & FORTRAN_CONTIGUOUS) != 0) diff --git a/numpy/numarray/numpy/nummacro.h b/numpy/numarray/numpy/nummacro.h index 1fe7631d1..e9acd6e31 100644 --- a/numpy/numarray/numpy/nummacro.h +++ b/numpy/numarray/numpy/nummacro.h @@ -100,7 +100,6 @@ typedef enum #define NA_SET_TEMP(ai, type, v) (((type *) &__temp__)[0] = v) #define NA_SWAPComplex64 NA_COMPLEX_SWAP16 -#define NA_SWAPComplex64_ NA_COMPLEX_SWAP16 #define NA_SWAPComplex32 NA_COMPLEX_SWAP8 #define NA_SWAPFloat64 NA_SWAP8 #define NA_SWAPFloat32 NA_SWAP4 @@ -115,7 +114,6 @@ typedef enum #define NA_SWAPBool NA_SWAP1 #define NA_COPYComplex64 NA_COPY16 -#define NA_COPYComplex64_ NA_COPY16 #define NA_COPYComplex32 NA_COPY8 #define NA_COPYFloat64 NA_COPY8 #define NA_COPYFloat32 NA_COPY4 @@ -149,7 +147,7 @@ static type _NA_GETPa_##type(char *ptr) \ return temp; \ } -_makeGetPb(Complex64_) +_makeGetPb(Complex64) _makeGetPb(Complex32) _makeGetPb(Float64) _makeGetPb(Float32) @@ -163,7 +161,7 @@ _makeGetPb(Int8) _makeGetPb(UInt8) _makeGetPb(Bool) -_makeGetPa(Complex64_) +_makeGetPa(Complex64) _makeGetPa(Complex32) _makeGetPa(Float64) _makeGetPa(Float32) @@ -194,7 +192,7 @@ static void _NA_SETPa_##type(char *ptr, type v) \ return; \ } -_makeSetPb(Complex64_) +_makeSetPb(Complex64) _makeSetPb(Complex32) _makeSetPb(Float64) _makeSetPb(Float32) @@ -208,7 +206,7 @@ _makeSetPb(Int8) _makeSetPb(UInt8) _makeSetPb(Bool) -_makeSetPa(Complex64_) +_makeSetPa(Complex64) _makeSetPa(Complex32) _makeSetPa(Float64) _makeSetPa(Float32) |
