[Numpy-svn] r5378 - in branches/1.1.x/numpy/core: code_generators src

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Jul 9 07:25:01 EDT 2008


Author: cdavid
Date: 2008-07-09 06:24:45 -0500 (Wed, 09 Jul 2008)
New Revision: 5378

Added:
   branches/1.1.x/numpy/core/code_generators/numpy_api_order.txt
Removed:
   branches/1.1.x/numpy/core/code_generators/array_api_order.txt
   branches/1.1.x/numpy/core/code_generators/multiarray_api_order.txt
Modified:
   branches/1.1.x/numpy/core/code_generators/generate_array_api.py
   branches/1.1.x/numpy/core/src/arraymethods.c
   branches/1.1.x/numpy/core/src/arrayobject.c
   branches/1.1.x/numpy/core/src/arraytypes.inc.src
   branches/1.1.x/numpy/core/src/multiarraymodule.c
   branches/1.1.x/numpy/core/src/scalartypes.inc.src
Log:
Backport unifed multiarray/object api for code generator.

Deleted: branches/1.1.x/numpy/core/code_generators/array_api_order.txt
===================================================================
--- branches/1.1.x/numpy/core/code_generators/array_api_order.txt	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/code_generators/array_api_order.txt	2008-07-09 11:24:45 UTC (rev 5378)
@@ -1,86 +0,0 @@
-# The functions in the numpy_core C API. They are defined
-# here so that the order is set.  Do not append to this
-# list, append to multiarray_api_order.txt instead.
-PyArray_SetNumericOps
-PyArray_GetNumericOps
-PyArray_INCREF
-PyArray_XDECREF
-PyArray_SetStringFunction
-PyArray_DescrFromType
-PyArray_TypeObjectFromType
-PyArray_Zero
-PyArray_One
-PyArray_CastToType
-PyArray_CastTo
-PyArray_CastAnyTo
-PyArray_CanCastSafely
-PyArray_CanCastTo
-PyArray_ObjectType
-PyArray_DescrFromObject
-PyArray_ConvertToCommonType
-PyArray_DescrFromScalar
-PyArray_DescrFromTypeObject
-PyArray_Size
-PyArray_Scalar
-PyArray_FromScalar
-PyArray_ScalarAsCtype
-PyArray_CastScalarToCtype
-PyArray_CastScalarDirect
-PyArray_ScalarFromObject
-PyArray_GetCastFunc
-PyArray_FromDims
-PyArray_FromDimsAndDataAndDescr
-PyArray_FromAny
-PyArray_EnsureArray
-PyArray_EnsureAnyArray
-PyArray_FromFile
-PyArray_FromString
-PyArray_FromBuffer
-PyArray_FromIter
-PyArray_Return
-PyArray_GetField
-PyArray_SetField
-PyArray_Byteswap
-PyArray_Resize
-PyArray_MoveInto
-PyArray_CopyInto
-PyArray_CopyAnyInto
-PyArray_CopyObject
-PyArray_NewCopy
-PyArray_ToList
-PyArray_ToString
-PyArray_ToFile
-PyArray_Dump
-PyArray_Dumps
-PyArray_ValidType
-PyArray_UpdateFlags
-PyArray_New
-PyArray_NewFromDescr
-PyArray_DescrNew
-PyArray_DescrNewFromType
-PyArray_GetPriority
-PyArray_IterNew
-PyArray_MultiIterNew
-PyArray_PyIntAsInt
-PyArray_PyIntAsIntp
-PyArray_Broadcast
-PyArray_FillObjectArray
-PyArray_FillWithScalar
-PyArray_CheckStrides
-PyArray_DescrNewByteorder
-PyArray_IterAllButAxis
-PyArray_CheckFromAny
-PyArray_FromArray
-PyArray_FromInterface
-PyArray_FromStructInterface
-PyArray_FromArrayAttr
-PyArray_ScalarKind
-PyArray_CanCoerceScalar
-PyArray_NewFlagsObject
-PyArray_CanCastScalar
-PyArray_CompareUCS4
-PyArray_RemoveSmallest
-PyArray_ElementStrides
-PyArray_Item_INCREF
-PyArray_Item_XDECREF
-PyArray_FieldNames

Modified: branches/1.1.x/numpy/core/code_generators/generate_array_api.py
===================================================================
--- branches/1.1.x/numpy/core/code_generators/generate_array_api.py	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/code_generators/generate_array_api.py	2008-07-09 11:24:45 UTC (rev 5378)
@@ -118,6 +118,12 @@
 };
 """
 
+c_api_header = """
+===========
+Numpy C-API
+===========
+"""
+
 def generate_api(output_dir, force=False):
     basename = 'multiarray_api'
 
@@ -125,7 +131,7 @@
     c_file = os.path.join(output_dir, '__%s.c' % basename)
     d_file = os.path.join(output_dir, '%s.txt' % basename)
     targets = (h_file, c_file, d_file)
-    sources = ['array_api_order.txt',  'multiarray_api_order.txt']
+    sources = ['numpy_api_order.txt']
 
     if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
         return targets
@@ -139,17 +145,11 @@
     c_file = targets[1]
     doc_file = targets[2]
 
-    objectapi_list = genapi.get_api_functions('OBJECT_API',
-                                              sources[0])
-    multiapi_list = genapi.get_api_functions('MULTIARRAY_API',
-                                             sources[1])
-    # API fixes for __arrayobject_api.h
+    numpyapi_list = genapi.get_api_functions('NUMPY_API', sources[0])
 
+    # API fixes for __arrayobject_api.h
     fixed = 10
     numtypes = len(types) + fixed
-    numobject = len(objectapi_list) + numtypes
-    nummulti = len(multiapi_list)
-    numtotal = numobject + nummulti
 
     module_list = []
     extension_list = []
@@ -167,14 +167,9 @@
         extension_list.append(astr)
 
     # set up object API
-    genapi.add_api_list(numtypes, 'PyArray_API', objectapi_list,
+    genapi.add_api_list(numtypes, 'PyArray_API', numpyapi_list,
                         module_list, extension_list, init_list)
 
-    # set up multiarray module API
-    genapi.add_api_list(numobject, 'PyArray_API', multiapi_list,
-                        module_list, extension_list, init_list)
-
-
     # Write to header
     fid = open(header_file, 'w')
     s = h_template % ('\n'.join(module_list), '\n'.join(extension_list))
@@ -189,25 +184,10 @@
 
     # write to documentation
     fid = open(doc_file, 'w')
-    fid.write('''
-===========
-Numpy C-API
-===========
-
-Object API
-==========
-''')
-    for func in objectapi_list:
+    fid.write(c_api_header)
+    for func in numpyapi_list:
         fid.write(func.to_ReST())
         fid.write('\n\n')
-    fid.write('''
-
-Multiarray API
-==============
-''')
-    for func in multiapi_list:
-        fid.write(func.to_ReST())
-        fid.write('\n\n')
     fid.close()
 
     return targets

Deleted: branches/1.1.x/numpy/core/code_generators/multiarray_api_order.txt
===================================================================
--- branches/1.1.x/numpy/core/code_generators/multiarray_api_order.txt	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/code_generators/multiarray_api_order.txt	2008-07-09 11:24:45 UTC (rev 5378)
@@ -1,86 +0,0 @@
-PyArray_Transpose
-PyArray_TakeFrom
-PyArray_PutTo
-PyArray_PutMask
-PyArray_Repeat
-PyArray_Choose
-PyArray_Sort
-PyArray_ArgSort
-PyArray_SearchSorted
-PyArray_ArgMax
-PyArray_ArgMin
-PyArray_Reshape
-PyArray_Newshape
-PyArray_Squeeze
-PyArray_View
-PyArray_SwapAxes
-PyArray_Max
-PyArray_Min
-PyArray_Ptp
-PyArray_Mean
-PyArray_Trace
-PyArray_Diagonal
-PyArray_Clip
-PyArray_Conjugate
-PyArray_Nonzero
-PyArray_Std
-PyArray_Sum
-PyArray_CumSum
-PyArray_Prod
-PyArray_CumProd
-PyArray_All
-PyArray_Any
-PyArray_Compress
-PyArray_Flatten
-PyArray_Ravel
-PyArray_MultiplyList
-PyArray_MultiplyIntList
-PyArray_GetPtr
-PyArray_CompareLists
-PyArray_AsCArray
-PyArray_As1D
-PyArray_As2D
-PyArray_Free
-PyArray_Converter
-PyArray_IntpFromSequence
-PyArray_Concatenate
-PyArray_InnerProduct
-PyArray_MatrixProduct
-PyArray_CopyAndTranspose
-PyArray_Correlate
-PyArray_TypestrConvert
-PyArray_DescrConverter
-PyArray_DescrConverter2
-PyArray_IntpConverter
-PyArray_BufferConverter
-PyArray_AxisConverter
-PyArray_BoolConverter
-PyArray_ByteorderConverter
-PyArray_OrderConverter
-PyArray_EquivTypes
-PyArray_Zeros
-PyArray_Empty
-PyArray_Where
-PyArray_Arange
-PyArray_ArangeObj
-PyArray_SortkindConverter
-PyArray_LexSort
-PyArray_Round
-PyArray_EquivTypenums
-PyArray_RegisterDataType
-PyArray_RegisterCastFunc
-PyArray_RegisterCanCast
-PyArray_InitArrFuncs
-PyArray_IntTupleFromIntp
-PyArray_TypeNumFromName
-PyArray_ClipmodeConverter
-PyArray_OutputConverter
-PyArray_BroadcastToShape
-_PyArray_SigintHandler
-_PyArray_GetSigintBuf
-PyArray_DescrAlignConverter
-PyArray_DescrAlignConverter2
-PyArray_SearchsideConverter
-PyArray_CheckAxis
-PyArray_OverflowMultiplyList
-PyArray_CompareString

Copied: branches/1.1.x/numpy/core/code_generators/numpy_api_order.txt (from rev 5229, trunk/numpy/core/code_generators/numpy_api_order.txt)

Modified: branches/1.1.x/numpy/core/src/arraymethods.c
===================================================================
--- branches/1.1.x/numpy/core/src/arraymethods.c	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/src/arraymethods.c	2008-07-09 11:24:45 UTC (rev 5378)
@@ -246,7 +246,7 @@
 
 
 /* steals typed reference */
-/*OBJECT_API
+/*NUMPY_API
   Get a subset of bytes from each element of the array
 */
 static PyObject *
@@ -295,7 +295,7 @@
 }
 
 
-/*OBJECT_API
+/*NUMPY_API
   Set a subset of bytes from each element of the array
 */
 static int
@@ -351,7 +351,7 @@
 /* This doesn't change the descriptor just the actual data...
  */
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_Byteswap(PyArrayObject *self, Bool inplace)
 {
@@ -1351,7 +1351,7 @@
     return Py_None;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_Dump(PyObject *self, PyObject *file, int protocol)
 {
@@ -1376,7 +1376,7 @@
     return 0;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_Dumps(PyObject *self, int protocol)
 {

Modified: branches/1.1.x/numpy/core/src/arrayobject.c
===================================================================
--- branches/1.1.x/numpy/core/src/arrayobject.c	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/src/arrayobject.c	2008-07-09 11:24:45 UTC (rev 5378)
@@ -21,7 +21,7 @@
 */
 /*#include <stdio.h>*/
 
-/*OBJECT_API
+/*NUMPY_API
  * Get Priority from object
  */
 static double
@@ -68,7 +68,7 @@
 */
 
 
-/*OBJECT_API
+/*NUMPY_API
   Get pointer to zero of correct type for array.
 */
 static char *
@@ -103,7 +103,7 @@
     return zeroval;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Get pointer to one of correct type for array
 */
 static char *
@@ -149,7 +149,7 @@
 
 
 /* Incref all objects found at this record */
-/*OBJECT_API
+/*NUMPY_API
  */
 static void
 PyArray_Item_INCREF(char *data, PyArray_Descr *descr)
@@ -181,7 +181,7 @@
 }
 
 /* XDECREF all objects found at this record */
-/*OBJECT_API
+/*NUMPY_API
  */
 static void
 PyArray_Item_XDECREF(char *data, PyArray_Descr *descr)
@@ -216,7 +216,7 @@
 
 /* Used for arrays of python objects to increment the reference count of */
 /* every python object in the array. */
-/*OBJECT_API
+/*NUMPY_API
   For object arrays, increment all internal references.
 */
 static int
@@ -272,7 +272,7 @@
     return 0;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Decrement all internal references for object arrays.
   (or arrays with object fields)
 */
@@ -535,7 +535,7 @@
 
 /* Helper functions */
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static intp
 PyArray_PyIntAsIntp(PyObject *o)
 {
@@ -635,7 +635,7 @@
 
 static PyObject *array_int(PyArrayObject *v);
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_PyIntAsInt(PyObject *o)
 {
@@ -745,7 +745,7 @@
     return NULL;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Compute the size of an array (in number of items)
 */
 static intp
@@ -1137,7 +1137,7 @@
     }
 }
 
-/*OBJECT_API
+/*NUMPY_API
  * Copy an Array into another array -- memory must not overlap
  * Does not require src and dest to have "broadcastable" shapes
  * (only the same number of elements).
@@ -1216,7 +1216,7 @@
     return 0;
 }
 
-/*OBJECT_API
+/*NUMPY_API
  * Copy an Array into another array -- memory must not overlap.
  */
 static int
@@ -1226,7 +1226,7 @@
 }
 
 
-/*OBJECT_API
+/*NUMPY_API
  * Move the memory of one array into another.
  */
 static int
@@ -1236,7 +1236,7 @@
 }
 
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object)
 {
@@ -1300,7 +1300,7 @@
 /* They all zero-out the memory as previously done */
 
 /* steals reference to descr -- and enforces native byteorder on it.*/
-/*OBJECT_API
+/*NUMPY_API
   Like FromDimsAndData but uses the Descr structure instead of typecode
   as input.
 */
@@ -1333,7 +1333,7 @@
     return ret;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Construct an empty array from dimensions and typenum
 */
 static PyObject *
@@ -1356,7 +1356,7 @@
 /* end old calls */
 
 
-/*OBJECT_API
+/*NUMPY_API
   Copy an array.
 */
 static PyObject *
@@ -1388,7 +1388,7 @@
 static PyObject *array_big_item(PyArrayObject *, intp);
 
 /* Does nothing with descr (cannot be NULL) */
-/*OBJECT_API
+/*NUMPY_API
   Get scalar-equivalent to a region of memory described by a descriptor.
 */
 static PyObject *
@@ -1542,7 +1542,7 @@
 
 /* Return Array Scalar if 0-d array object is encountered */
 
-/*OBJECT_API
+/*NUMPY_API
   Return either an array or the appropriate Python object if the array
   is 0d and matches a Python type.
 */
@@ -1572,7 +1572,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Initialize arrfuncs to NULL
 */
 static void
@@ -1643,7 +1643,7 @@
   found.  Only works for user-defined data-types.
 */
 
-/*MULTIARRAY_API
+/*NUMPY_API
  */
 static int
 PyArray_TypeNumFromName(char *str)
@@ -1665,7 +1665,7 @@
   needs the userdecrs table and PyArray_NUMUSER variables
   defined in arraytypes.inc
 */
-/*MULTIARRAY_API
+/*NUMPY_API
   Register Data type
   Does not change the reference count of descr
 */
@@ -1717,7 +1717,7 @@
     return typenum;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Register Casting Function
   Replaces any function currently stored.
 */
@@ -1762,7 +1762,7 @@
     return newtypes;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Register a type number indicating that a descriptor can be cast
   to it safely
 */
@@ -1811,7 +1811,7 @@
    This will need the addition of a Fortran-order iterator.
  */
 
-/*OBJECT_API
+/*NUMPY_API
   To File
 */
 static int
@@ -1952,7 +1952,7 @@
     return 0;
 }
 
-/*OBJECT_API
+/*NUMPY_API
  * To List
  */
 static PyObject *
@@ -1987,7 +1987,7 @@
     return lp;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_ToString(PyArrayObject *self, NPY_ORDER order)
 {
@@ -3365,7 +3365,7 @@
     }
 
 
-/*OBJECT_API
+/*NUMPY_API
   Set internal structure with number functions that all arrays will use
 */
 int
@@ -3413,7 +3413,7 @@
                     (PyDict_SetItemString(dict, #op, n_ops.op)==-1))    \
         goto fail;
 
-/*OBJECT_API
+/*NUMPY_API
   Get dictionary showing number functions that all arrays will use
 */
 static PyObject *
@@ -4362,7 +4362,7 @@
 static PyObject *PyArray_StrFunction=NULL;
 static PyObject *PyArray_ReprFunction=NULL;
 
-/*OBJECT_API
+/*NUMPY_API
   Set the array print function to be a Python function.
 */
 static void
@@ -4417,7 +4417,7 @@
 
 
 
-/*OBJECT_API
+/*NUMPY_API
  */
 static int
 PyArray_CompareUCS4(npy_ucs4 *s1, npy_ucs4 *s2, register size_t len)
@@ -4433,7 +4433,7 @@
     return 0;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
  */
 static int
 PyArray_CompareString(char *s1, char *s2, size_t len)
@@ -5028,7 +5028,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   PyArray_CheckAxis
 */
 static PyObject *
@@ -5079,7 +5079,7 @@
 #include "arraymethods.c"
 
 /* Lifted from numarray */
-/*MULTIARRAY_API
+/*NUMPY_API
   PyArray_IntTupleFromIntp
 */
 static PyObject *
@@ -5107,7 +5107,7 @@
 
 /* Returns the number of dimensions or -1 if an error occurred */
 /*  vals must be large enough to hold maxvals */
-/*MULTIARRAY_API
+/*NUMPY_API
   PyArray_IntpFromSequence
 */
 static int
@@ -5255,7 +5255,7 @@
 }
 
 
-/*OBJECT_API
+/*NUMPY_API
  */
 static int
 PyArray_ElementStrides(PyObject *arr)
@@ -5271,7 +5271,7 @@
     return 1;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Update Several Flags at once.
 */
 static void
@@ -5321,7 +5321,7 @@
    or negative).
 */
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static Bool
 PyArray_CheckStrides(int elsize, int nd, intp numbytes, intp offset,
                      intp *dims, intp *newstrides)
@@ -5389,7 +5389,7 @@
     return itemsize;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Generic new array creation routine.
 */
 static PyObject *
@@ -5492,7 +5492,7 @@
 
 
 /* steals a reference to descr (even on failure) */
-/*OBJECT_API
+/*NUMPY_API
   Generic new array creation routine.
 */
 static PyObject *
@@ -5718,7 +5718,7 @@
 }
 
 
-/*OBJECT_API
+/*NUMPY_API
   Resize (reallocate data).  Only works if nothing else is referencing
   this array and it is contiguous.
   If refcheck is 0, then the reference count is not checked
@@ -5888,7 +5888,7 @@
 }
 
 /* Assumes contiguous */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static void
 PyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj)
 {
@@ -5920,7 +5920,7 @@
     }
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_FillWithScalar(PyArrayObject *arr, PyObject *obj)
 {
@@ -7738,7 +7738,7 @@
 }
 
 
-/*OBJECT_API
+/*NUMPY_API
   Is the typenum valid?
 */
 static int
@@ -7758,7 +7758,7 @@
 /* For backward compatibility */
 
 /* steals reference to at --- cannot be NULL*/
-/*OBJECT_API
+/*NUMPY_API
  *Cast an array using typecode structure.
  */
 static PyObject *
@@ -7819,7 +7819,7 @@
 
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Get a cast function to cast from the input descriptor to the
   output type_number (must be a registered data-type).
   Returns NULL if un-successful.
@@ -8017,7 +8017,7 @@
  * as the size of the casting buffer.
  */
 
-/*OBJECT_API
+/*NUMPY_API
  * Cast to an already created array.
  */
 static int
@@ -8181,7 +8181,7 @@
     return retval;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Cast to an already created array.  Arrays don't have to be "broadcastable"
   Only requirement is they have the same number of elements.
 */
@@ -8231,7 +8231,7 @@
 
 
 /* steals reference to newtype --- acc. NULL */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags)
 {
@@ -8489,7 +8489,7 @@
     return descr;
 }
 
-/*OBJECT_API */
+/*NUMPY_API */
 static PyObject *
 PyArray_FromStructInterface(PyObject *input)
 {
@@ -8545,7 +8545,7 @@
 
 #define PyIntOrLong_Check(obj) (PyInt_Check(obj) || PyLong_Check(obj))
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_FromInterface(PyObject *input)
 {
@@ -8696,7 +8696,7 @@
     return NULL;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_FromArrayAttr(PyObject *op, PyArray_Descr *typecode, PyObject *context)
 {
@@ -8745,7 +8745,7 @@
 
 /* Does not check for ENSURECOPY and NOTSWAPPED in flags */
 /* Steals a reference to newtype --- which can be NULL */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth,
                 int max_depth, int flags, PyObject *context)
@@ -8873,14 +8873,14 @@
 }
 
 /* new reference -- accepts NULL for mintype*/
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyArray_Descr *
 PyArray_DescrFromObject(PyObject *op, PyArray_Descr *mintype)
 {
     return _array_find_type(op, mintype, MAX_DIMS);
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Return the typecode of the array a Python object would be converted
   to
 */
@@ -8943,7 +8943,7 @@
 
 
 /* steals a reference to descr -- accepts NULL */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth,
                      int max_depth, int requires, PyObject *context)
@@ -8984,7 +8984,7 @@
 /*  Because it decrefs op if any conversion needs to take place
     so it can be used like PyArray_EnsureArray(some_function(...)) */
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_EnsureArray(PyObject *op)
 {
@@ -9009,7 +9009,7 @@
     return new;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_EnsureAnyArray(PyObject *op)
 {
@@ -9017,7 +9017,7 @@
     return PyArray_EnsureArray(op);
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Check the type coercion rules.
 */
 static int
@@ -9124,7 +9124,7 @@
 }
 
 /* leaves reference count alone --- cannot be NULL*/
-/*OBJECT_API*/
+/*NUMPY_API*/
 static Bool
 PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to)
 {
@@ -9156,7 +9156,7 @@
     return ret;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   See if array scalars can be cast.
 */
 static Bool
@@ -9177,7 +9177,7 @@
 /*  Aided by Peter J. Verveer's  nd_image package and numpy's arraymap  ****/
 /*         and Python's array iterator                                   ***/
 
-/*OBJECT_API
+/*NUMPY_API
   Get Iterator.
 */
 static PyObject *
@@ -9221,7 +9221,7 @@
     return (PyObject *)it;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get Iterator broadcast to a particular shape
 */
 static PyObject *
@@ -9288,7 +9288,7 @@
 
 
 
-/*OBJECT_API
+/*NUMPY_API
   Get Iterator that iterates over all but one axis (don't use this with
   PyArray_ITER_GOTO1D).  The axis will be over-written if negative
   with the axis having the smallest stride.
@@ -9338,7 +9338,7 @@
 /* don't use with PyArray_ITER_GOTO1D because factors are not
    adjusted */
 
-/*OBJECT_API
+/*NUMPY_API
   Adjusts previously broadcasted iterators so that the axis with
   the smallest sum of iterator strides is not iterated over.
   Returns dimension which is smallest in the range [0,multi->nd).
@@ -10119,7 +10119,7 @@
 /* Adjust dimensionality and strides for index object iterators
    --- i.e. broadcast
 */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_Broadcast(PyArrayMultiIterObject *mit)
 {
@@ -10761,7 +10761,7 @@
 /** END of Subscript Iterator **/
 
 
-/*OBJECT_API
+/*NUMPY_API
   Get MultiIterator,
 */
 static PyObject *
@@ -11033,7 +11033,7 @@
     0                                         /* tp_weaklist */
 };
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyArray_Descr *
 PyArray_DescrNewFromType(int type_num)
 {
@@ -11060,7 +11060,7 @@
 **/
 
 /* base cannot be NULL */
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyArray_Descr *
 PyArray_DescrNew(PyArray_Descr *base)
 {
@@ -11701,7 +11701,7 @@
    byte-order is not changed but any fields are:
 */
 
-/*OBJECT_API
+/*NUMPY_API
   Deep bytorder change of a data-type descriptor
   *** Leaves reference count of self unchanged --- does not DECREF self ***
   */
@@ -12088,7 +12088,7 @@
 
 /** Array Flags Object **/
 
-/*OBJECT_API
+/*NUMPY_API
   Get New ArrayFlagsObject
 */
 static PyObject *

Modified: branches/1.1.x/numpy/core/src/arraytypes.inc.src
===================================================================
--- branches/1.1.x/numpy/core/src/arraytypes.inc.src	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/src/arraytypes.inc.src	2008-07-09 11:24:45 UTC (rev 5378)
@@ -2470,7 +2470,7 @@
     &VOID_Descr,
 };
 
-/*OBJECT_API
+/*NUMPY_API
  Get the PyArray_Descr structure for a type.
 */
 static PyArray_Descr *

Modified: branches/1.1.x/numpy/core/src/multiarraymodule.c
===================================================================
--- branches/1.1.x/numpy/core/src/multiarraymodule.c	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/src/multiarraymodule.c	2008-07-09 11:24:45 UTC (rev 5378)
@@ -100,7 +100,7 @@
 /* An Error object -- rarely used? */
 static PyObject *MultiArrayError;
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Multiply a List of ints
 */
 static int
@@ -111,7 +111,7 @@
     return s;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Multiply a List
 */
 static intp
@@ -122,7 +122,7 @@
     return s;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Multiply a List of Non-negative numbers with over-flow detection.
 */
 static intp
@@ -138,7 +138,7 @@
     return s;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Produce a pointer into array
 */
 static void *
@@ -152,7 +152,7 @@
     return (void *)dptr;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get axis from an object (possibly None) -- a converter function,
 */
 static int
@@ -170,7 +170,7 @@
     return PY_SUCCEED;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Compare Lists
 */
 static int
@@ -184,7 +184,7 @@
 }
 
 /* steals a reference to type -- accepts NULL */
-/*MULTIARRAY_API
+/*NUMPY_API
   View
 */
 static PyObject *
@@ -222,7 +222,7 @@
 
 /* Returns a contiguous array */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Ravel
 */
 static PyObject *
@@ -260,7 +260,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Round
 */
 static PyObject *
@@ -382,7 +382,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Flatten
 */
 static PyObject *
@@ -416,7 +416,7 @@
 
    / * Not recommended */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Reshape an array
 */
 static PyObject *
@@ -624,7 +624,7 @@
    copy-only-if-necessary
 */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   New shape for an array
 */
 static PyObject *
@@ -771,7 +771,7 @@
    return the same array.
 */
 
-/*MULTIARRAY_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_Squeeze(PyArrayObject *self)
 {
@@ -811,7 +811,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Mean
 */
 static PyObject *
@@ -843,7 +843,7 @@
 }
 
 /* Set variance to 1 to by-pass square-root calculation and return variance */
-/*MULTIARRAY_API
+/*NUMPY_API
   Std
 */
 static PyObject *
@@ -962,7 +962,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Sum
 */
 static PyObject *
@@ -978,7 +978,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Prod
 */
 static PyObject *
@@ -994,7 +994,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   CumSum
 */
 static PyObject *
@@ -1010,7 +1010,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   CumProd
 */
 static PyObject *
@@ -1027,7 +1027,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Any
 */
 static PyObject *
@@ -1044,7 +1044,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   All
 */
 static PyObject *
@@ -1062,7 +1062,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Compress
 */
 static PyObject *
@@ -1091,7 +1091,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Nonzero
 */
 static PyObject *
@@ -1188,7 +1188,7 @@
     return res2;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Clip
 */
 static PyObject *
@@ -1417,7 +1417,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Conjugate
 */
 static PyObject *
@@ -1447,7 +1447,7 @@
     }
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Trace
 */
 static PyObject *
@@ -1463,7 +1463,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Diagonal
 */
 static PyObject *
@@ -1598,7 +1598,7 @@
 */
 
 /* steals a reference to typedescr -- can be NULL*/
-/*MULTIARRAY_API
+/*NUMPY_API
   Simulat a C-array
 */
 static int
@@ -1657,7 +1657,7 @@
 
 /* Deprecated --- Use PyArray_AsCArray instead */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert to a 1D C-array
 */
 static int
@@ -1673,7 +1673,7 @@
     return 0;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert to a 2D C-array
 */
 static int
@@ -1693,7 +1693,7 @@
 
 /* End Deprecated */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Free pointers created if As2D is called
 */
 static int
@@ -1748,7 +1748,7 @@
 /* If axis is MAX_DIMS or bigger, then each sequence object will
    be flattened before concatenation
 */
-/*MULTIARRAY_API
+/*NUMPY_API
   Concatenate an arbitrary Python sequence into an array.
 */
 static PyObject *
@@ -1859,7 +1859,7 @@
     return NULL;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   SwapAxes
 */
 static PyObject *
@@ -1906,7 +1906,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Return Transpose.
 */
 static PyObject *
@@ -1978,7 +1978,7 @@
     return (PyObject *)ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Repeat the array.
 */
 static PyObject *
@@ -2101,7 +2101,7 @@
 }
 
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static NPY_SCALARKIND
 PyArray_ScalarKind(int typenum, PyArrayObject **arr)
 {
@@ -2128,7 +2128,7 @@
     return PyArray_OBJECT_SCALAR;
 }
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static int
 PyArray_CanCoerceScalar(int thistype, int neededtype,
                         NPY_SCALARKIND scalar)
@@ -2168,7 +2168,7 @@
 }
 
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyArrayObject **
 PyArray_ConvertToCommonType(PyObject *op, int *retn)
 {
@@ -2284,7 +2284,7 @@
     return NULL;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
  */
 static PyObject *
 PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *ret,
@@ -2645,7 +2645,7 @@
         }                                                               \
     }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Sort an array in-place
 */
 static int
@@ -2731,7 +2731,7 @@
                                          global_obj);
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   ArgSort an array
 */
 static PyObject *
@@ -2821,7 +2821,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   LexSort an array providing indices that will sort a collection of arrays
   lexicographically.  The first key is sorted on first, followed by the second key
   -- requires that arg"merge"sort is available for each sort_key
@@ -3086,7 +3086,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert object to searchsorted side
 */
 static int
@@ -3114,7 +3114,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Numeric.searchsorted(a,v)
 */
 static PyObject *
@@ -3214,7 +3214,7 @@
 /* Could perhaps be redone to not make contiguous arrays
  */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Numeric.innerproduct(a,v)
 */
 static PyObject *
@@ -3326,7 +3326,7 @@
 
 
 /* just like inner product but does the swapaxes stuff on the fly */
-/*MULTIARRAY_API
+/*NUMPY_API
   Numeric.matrixproduct(a,v)
 */
 static PyObject *
@@ -3458,7 +3458,7 @@
     return NULL;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Fast Copy and Transpose
 */
 static PyObject *
@@ -3521,7 +3521,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Numeric.correlate(a1,a2,mode)
 */
 static PyObject *
@@ -3631,7 +3631,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   ArgMin
 */
 static PyObject *
@@ -3661,7 +3661,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Max
 */
 static PyObject *
@@ -3678,7 +3678,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Min
 */
 static PyObject *
@@ -3695,7 +3695,7 @@
     return ret;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Ptp
 */
 static PyObject *
@@ -3730,7 +3730,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   ArgMax
 */
 static PyObject *
@@ -3839,7 +3839,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Take
 */
 static PyObject *
@@ -4001,7 +4001,7 @@
     return NULL;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Put values into an array
 */
 static PyObject *
@@ -4167,7 +4167,7 @@
     return PyArray_PutMask((PyArrayObject *)array, values, mask);
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Put values into an array according to a mask.
 */
 static PyObject *
@@ -4276,7 +4276,7 @@
    as you get a new reference to it.
 */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Useful to pass as converter function for O& processing in
   PyArgs_ParseTuple.
 */
@@ -4295,7 +4295,7 @@
     }
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Useful to pass as converter function for O& processing in
   PyArgs_ParseTuple for output arrays
 */
@@ -4319,7 +4319,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert an object to true / false
 */
 static int
@@ -4333,7 +4333,7 @@
     return PY_SUCCEED;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert an object to FORTRAN / C / ANY
 */
 static int
@@ -4372,7 +4372,7 @@
     return PY_SUCCEED;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert an object to NPY_RAISE / NPY_CLIP / NPY_WRAP
 */
 static int
@@ -4418,7 +4418,7 @@
 
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Typestr converter
 */
 static int
@@ -4551,7 +4551,7 @@
 */
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get buffer chunk from object
 */
 static int
@@ -4591,7 +4591,7 @@
    PyDimMem_FREE(seq.ptr)**
 */
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get intp chunk from sequence
 */
 static int
@@ -5238,7 +5238,7 @@
 */
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get type-descriptor from an object forcing alignment if possible
   None goes to DEFAULT type.
 */
@@ -5267,7 +5267,7 @@
     return PY_SUCCEED;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get type-descriptor from an object forcing alignment if possible
   None goes to NULL.
 */
@@ -5297,7 +5297,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Get typenum from an object -- None goes to NULL
 */
 static int
@@ -5321,7 +5321,7 @@
 */
 
 /* new reference in *at */
-/*MULTIARRAY_API
+/*NUMPY_API
   Get typenum from an object -- None goes to PyArray_DEFAULT
 */
 static int
@@ -5505,7 +5505,7 @@
     return PY_FAIL;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert object to endian
 */
 static int
@@ -5543,7 +5543,7 @@
     return PY_SUCCEED;
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Convert object to sort kind
 */
 static int
@@ -5596,7 +5596,7 @@
    equivalent (same basic kind and same itemsize).
 */
 
-/*MULTIARRAY_API*/
+/*NUMPY_API*/
 static unsigned char
 PyArray_EquivTypes(PyArray_Descr *typ1, PyArray_Descr *typ2)
 {
@@ -5618,7 +5618,7 @@
     return (typ1->kind == typ2->kind);
 }
 
-/*MULTIARRAY_API*/
+/*NUMPY_API*/
 static unsigned char
 PyArray_EquivTypenums(int typenum1, int typenum2)
 {
@@ -5768,7 +5768,7 @@
 
 /* accepts NULL type */
 /* steals referenct to type */
-/*MULTIARRAY_API
+/*NUMPY_API
   Empty
 */
 static PyObject *
@@ -5889,7 +5889,7 @@
 
 /* steal a reference */
 /* accepts NULL type */
-/*MULTIARRAY_API
+/*NUMPY_API
   Zeros
 */
 static PyObject *
@@ -6172,7 +6172,7 @@
 }
 #undef FROM_BUFFER_SIZE
 
-/*OBJECT_API
+/*NUMPY_API
 
   Given a pointer to a string ``data``, a string length ``slen``, and
   a ``PyArray_Descr``, return an array corresponding to the data
@@ -6332,7 +6332,7 @@
     return r;
 }
 
-/*OBJECT_API
+/*NUMPY_API
 
   Given a ``FILE *`` pointer ``fp``, and a ``PyArray_Descr``, return an
   array corresponding to the data encoded in that file.
@@ -6452,7 +6452,7 @@
 
 
 /* steals a reference to dtype (which cannot be NULL) */
-/*OBJECT_API */
+/*NUMPY_API */
 static PyObject *
 PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, intp count)
 {
@@ -6567,7 +6567,7 @@
 }
 
 
-/*OBJECT_API*/
+/*NUMPY_API*/
 static PyObject *
 PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type,
                    intp count, intp offset)
@@ -6737,7 +6737,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Arange,
 */
 static PyObject *
@@ -6841,7 +6841,7 @@
 }
 
 /* this doesn't change the references */
-/*MULTIARRAY_API
+/*NUMPY_API
   ArangeObj,
 */
 static PyObject *
@@ -7065,7 +7065,7 @@
 }
 
 
-/*MULTIARRAY_API
+/*NUMPY_API
   Where
 */
 static PyObject *
@@ -7373,7 +7373,7 @@
 
 SIGJMP_BUF _NPY_SIGINT_BUF;
 
-/*MULTIARRAY_API
+/*NUMPY_API
  */
 static void
 _PyArray_SigintHandler(int signum)
@@ -7382,7 +7382,7 @@
     SIGLONGJMP(_NPY_SIGINT_BUF, signum);
 }
 
-/*MULTIARRAY_API
+/*NUMPY_API
  */
 static void*
 _PyArray_GetSigintBuf(void)

Modified: branches/1.1.x/numpy/core/src/scalartypes.inc.src
===================================================================
--- branches/1.1.x/numpy/core/src/scalartypes.inc.src	2008-07-09 11:13:25 UTC (rev 5377)
+++ branches/1.1.x/numpy/core/src/scalartypes.inc.src	2008-07-09 11:24:45 UTC (rev 5378)
@@ -131,7 +131,7 @@
 /* no error checking is performed -- ctypeptr must be same type as scalar */
 /* in case of flexible type, the data is not copied
    into ctypeptr which is expected to be a pointer to pointer */
-/*OBJECT_API
+/*NUMPY_API
  Convert to c-type
 */
 static void
@@ -160,7 +160,7 @@
 /* This may not work right on narrow builds for NumPy unicode scalars.
  */
 
-/*OBJECT_API
+/*NUMPY_API
  Cast Scalar to c-type
 */
 static int
@@ -197,7 +197,7 @@
         return 0;
 }
 
-/*OBJECT_API
+/*NUMPY_API
  Cast Scalar to c-type
 */
 static int
@@ -220,7 +220,7 @@
 */
 
 /* steals reference to outcode */
-/*OBJECT_API
+/*NUMPY_API
  Get 0-dim array from scalar
 */
 static PyObject *
@@ -292,7 +292,7 @@
         return ret;
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Get an Array Scalar From a Python Object
   Returns NULL if unsuccessful but error is only
   set if another error occurred. Currently only Numeric-like
@@ -2720,7 +2720,7 @@
 }
 
 /*New reference */
-/*OBJECT_API
+/*NUMPY_API
  */
 static PyArray_Descr *
 PyArray_DescrFromTypeObject(PyObject *type)
@@ -2785,7 +2785,7 @@
         return _descr_from_subtype(type);
 }
 
-/*OBJECT_API
+/*NUMPY_API
   Return the tuple of ordered field names from a dictionary.
 */
 static PyObject *
@@ -2812,7 +2812,7 @@
 }
 
 /* New reference */
-/*OBJECT_API
+/*NUMPY_API
  Return descr object from array scalar.
 */
 static PyArray_Descr *
@@ -2856,7 +2856,7 @@
 }
 
 /* New reference */
-/*OBJECT_API
+/*NUMPY_API
  Get a typeobject from a type-number -- can return NULL.
 */
 static PyObject *




More information about the Numpy-svn mailing list