summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-07-08 01:50:46 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-07-08 01:50:46 +0000
commit21e52f005c9ee4a44a23cdec87d9eaa357bd31e5 (patch)
tree29c9c2491114a0a2789af4a36f1e8ca96b7a3b2f
parentb6f0858d8b714f83e4c8a390fad310648cf0f823 (diff)
downloadnumpy-21e52f005c9ee4a44a23cdec87d9eaa357bd31e5.tar.gz
Fix f2py and doc
-rw-r--r--numpy/core/include/numpy/ufuncobject.h2
-rw-r--r--numpy/doc/CAPI.txt24
-rw-r--r--numpy/f2py/cfuncs.py2
-rw-r--r--numpy/f2py/src/fortranobject.h2
4 files changed, 15 insertions, 15 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 416c183a1..0df3997e3 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -6,7 +6,7 @@ extern "C" {
#define NPY_MAXARGS 40
-typedef void (*PyUFuncGenericFunction) (char **, intp *, intp *, void *);
+typedef void (*PyUFuncGenericFunction) (char **, npy_intp *, npy_intp *, void *);
typedef struct {
PyObject_HEAD
diff --git a/numpy/doc/CAPI.txt b/numpy/doc/CAPI.txt
index 9286ee050..bfe062c66 100644
--- a/numpy/doc/CAPI.txt
+++ b/numpy/doc/CAPI.txt
@@ -26,7 +26,7 @@ of the API) that will need to be changed:
* If you passed ``array->dimensions`` and ``array->strides`` around
to functions, you will need to fix some code. These are now
- ``intp*`` pointers. On 32-bit systems there won't be a problem.
+ ``npy_intp*`` pointers. On 32-bit systems there won't be a problem.
However, on 64-bit systems, you will need to make changes to avoid
errors and segfaults.
@@ -54,8 +54,8 @@ This is a very flexible function.
::
PyObject * PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr,
- int nd, intp *dims,
- intp *strides, char *data,
+ int nd, npy_intp *dims,
+ npy_intp *strides, char *data,
int flags, PyObject *obj);
``subtype`` : ``PyTypeObject *``
@@ -76,11 +76,11 @@ This is a very flexible function.
``nd`` : ``int``
The number of dimensions (<``MAX_DIMS``)
-``*dims`` : ``intp *``
+``*dims`` : ``npy_intp *``
A pointer to the size in each dimension. Information will be
copied from here.
-``*strides`` : ``intp *``
+``*strides`` : ``npy_intp *``
The strides this array should have. For new arrays created by this
routine, this should be ``NULL``. If you pass in memory for this array
to use, then you can pass in the strides information as well
@@ -123,7 +123,7 @@ Note: The returned array object will be unitialized unless the type is
``PyArray_OBJECT`` in which case the memory will be set to ``NULL``.
``PyArray_SimpleNew(nd, dims, typenum)`` is a drop-in replacement for
-``PyArray_FromDims`` (except it takes ``intp*`` dims instead of ``int*`` dims
+``PyArray_FromDims`` (except it takes ``npy_intp*`` dims instead of ``int*`` dims
which matters on 64-bit systems) and it does not initialize the memory
to zero.
@@ -135,7 +135,7 @@ are loose wrappers around this function. These functions still take
``int *`` arguments. This should be fine on 32-bit systems, but on 64-bit
systems you may run into trouble if you frequently passed
``PyArray_FromDims`` the dimensions member of the old ``PyArrayObject`` structure
-because ``sizeof(intp) != sizeof(int)``.
+because ``sizeof(npy_intp) != sizeof(int)``.
Getting an arrayobject from an arbitrary Python object
@@ -292,11 +292,11 @@ array, or part of some larger record array. But, they may have other uses...
Some useful combinations of these flags:
-- ``BEHAVED_FLAGS = ALIGNED | WRITEABLE``
-- ``CARRAY_FLAGS = DEFAULT_FLAGS = CONTIGUOUS | BEHAVED_FLAGS``
-- ``CARRAY_FLAGS_RO = CONTIGUOUS | ALIGNED``
-- ``FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS``
-- ``FARRAY_FLAGS_RO = FORTRAN | ALIGNED``
+- ``BEHAVED = ALIGNED | WRITEABLE``
+- ``CARRAY = DEFAULT = CONTIGUOUS | BEHAVED``
+- ``CARRAY_RO = CONTIGUOUS | ALIGNED``
+- ``FARRAY = FORTRAN | BEHAVED``
+- ``FARRAY_RO = FORTRAN | ALIGNED``
The macro ``PyArray_CHECKFLAGS(obj, flags)`` can test any combination of flags.
There are several default combinations defined as macros already
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index f60113a04..48373678f 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -220,7 +220,7 @@ cppmacros['SWAP']="""\
\ta = b;\\
\tb = c;}
"""
-#cppmacros['ISCONTIGUOUS']='#define ISCONTIGUOUS(m) ((m)->flags & CONTIGUOUS)'
+#cppmacros['ISCONTIGUOUS']='#define ISCONTIGUOUS(m) ((m)->flags & NPY_CONTIGUOUS)'
cppmacros['PRINTPYOBJERR']="""\
#define PRINTPYOBJERR(obj)\\
\tfprintf(stderr,\"#modulename#.error is related to \");\\
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index 73d4fad60..b28848b79 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -96,7 +96,7 @@ typedef struct {
extern PyObject * PyFortranObject_New(FortranDataDef* defs, f2py_void_func init);
extern PyObject * PyFortranObject_NewAsAttr(FortranDataDef* defs);
-#define ISCONTIGUOUS(m) ((m)->flags & CONTIGUOUS)
+#define ISCONTIGUOUS(m) ((m)->flags & NPY_CONTIGUOUS)
#define F2PY_INTENT_IN 1
#define F2PY_INTENT_INOUT 2
#define F2PY_INTENT_OUT 4