[Pyrex] syntax error I don't see

Marco Bubke marco at bubke.de
Thu Nov 4 00:34:07 CET 2004


Hi 

I haven't changed the code but now pyrexc says:

/home/marco/projects/calliopeia/gl.pyx:3:5: Syntax error in C variable 
declaration

Here is the beginning of the code:

import __builtin__

cdef from "numarray/numarray.h":
  struct PyArray_Descr: 
    int type_num, elsize 
    char type 
  
  cdef enum NumarrayType:
    tAny
  
    tBool
  
    tInt8
    tUInt8
  
    tInt16
    tUInt16
  
    tInt32
    tUInt32 
  
    tInt64
    tUInt64
  
    tFloat32
    tFloat64
  
    tComplex32
    tComplex64
  
    tObject
  
    tDefault = tFloat64

    tLong = tInt32,

    tMaxType
    
  cdef enum NumRequirements:
    NUM_CONTIGUOUS
    NUM_NOTSWAPPED
    NUM_ALIGNED
    NUM_WRITABLE

    NUM_C_ARRAY
    NUM_UNCONVERTED 
  
  
  ctypedef class numarray._numarray._numarray [object PyArrayObject]:
    # Compatibility with Numeric
    cdef char *data
    cdef int nd
    #cdef int dimensions[MAXDIM], strides[MAXDIM]
    cdef int *dimensions, *strides
    cdef object base
    cdef PyArray_Descr *descr
    cdef int flags
    # New attributes for numarray objects
    cdef object _data         # object must meet buffer API
    cdef object _shadows      # ill-behaved original array.
    cdef int    nstrides      # elements in strides array
    cdef long   byteoffset    # offset into buffer where array data begins
    cdef long   bytestride    # basic seperation of elements in bytes
    cdef long   itemsize      # length of 1 element in bytes
    cdef char   byteorder     # NUM_BIG_ENDIAN, NUM_LITTLE_ENDIAN
    cdef char   _aligned      # test override flag
    cdef char   _contiguous   # test override flag


Can this be a bug?

tnx

marco



More information about the Pyrex mailing list