Dag, I still have problems with this (the 'sizeof(int[3])' part):
cdef inline object newarray_int3(int n, int (**p)[3]):
if n < 0: n = 0
cdef int (*array)[3] # = NULL ## XXX
cdef object ob = allocate(n*sizeof(int[3]), <void**>&array)
^
------------------------------------------------------------
/u/dalcinl/Devel/Cython/mpi4py-dev/src/MPI/asarray.pxi:13:44: Expected: type
Please, do not blame me for being too pedantic. I have to deal with
this because I need to wrap some MPI calls like the following:
int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
MPI_Group *newgroup)
It has been really hard for me to find an alternative way do build the
'ranges' arguments avoiding Cython or C compiler errors/warnings.
However, perhaps I could change sizeof(int[3]) to 3*sizeof(int). It
seems it should be equivalent, but I'm not completelly sure? Can
someone comment on this?
On Mon, Aug 4, 2008 at 3:46 PM, Dag Sverre Seljebotn
<[EMAIL PROTECTED]> wrote:
> Lisandro Dalcin wrote:
>> Current cython-devel trunk broke my code, for example, try to run
>> cython on this snippet:
>>
>> cdef extern from *:
>>
>> cdef void foo(int[])
>>
>> ctypedef int MyInt
>> cdef void foo(MyInt[])
>>
>> struct MyStruct:
>> pass
>> cdef void bar(MyStruct[])
>>
>> ctypedef MyStruct* MyStructP
>> cdef void baz(MyStructP[])
>>
>>
>> I get error messages like (just the first shown):
>>
>> Error converting Pyrex file to C:
>> ------------------------------------------------------------
>> ...
>> cdef extern from *:
>>
>> cdef void foo(int[])
>>
>> ctypedef int MyInt
>> cdef void foo(MyInt[])
>> ^
>> ------------------------------------------------------------
>>
>> /u/dalcinl/Devel/Cython/sandbox/arrdecl.pyx:6:23: Buffer types only
>> allowed as function local variables
>>
>
> OK this is fixed now. Apologies.
>
> (The fix rules out empty [] for buffer access, but this fits in with the
> latest buffer discussion of "auto-acquire if enough defaults are
> provided".).
>
> --
> Dag Sverre
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev