chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] C_word type / Cython (warning: passing argument 2 from i


From: David Dreisigmeyer
Subject: [Chicken-users] C_word type / Cython (warning: passing argument 2 from incompatible pointer type)
Date: Fri, 11 Feb 2011 17:47:24 -0500

Here's the solution on the Cython side.

Is C_word a long (or int) though?

> Here's my setup:
>
> OSX 10.6.6
> Chicken 4.6.0
> Python 2.7.1
> Cython 0.14
>
> ** The Chicken part:
>
> What type is C_word?  The only thing I see is this in chicken.h
>
> #ifdef C_SIXTY_FOUR
> # define C_word                   long
> # define C_u32                    uint32_t
> # define C_s32                    int32_t
> #else
> # define C_word                   int
> # define C_u32                    unsigned int
> # define C_s32                    int
> #endif
>
> but I get the following warning:
>
> warning: passing argument 2 of ‘CHICKEN_eval_string’ from incompatible
> pointer type
>
>
> ** The Cython part:
>
> I'm trying to use this with Cython, so I have (in my *.pxd):
>
> ctypedef long C_word (Note: I tried ctypedef int C_word also.)
>

Please add the ctypedef inside the cdef extern block below, and you
should be done...

> cdef extern from "chicken.h":
>    int CHICKEN_eval_string(char *, C_word *)
>
> cdef inline C_word C_chick_eval_s (char *IN_STR):
>    cdef C_word OUT_RESULT
>    status = CHICKEN_eval_string(IN_STR, &OUT_RESULT)
>    if (status == 0):
>        print "Chicken evaluation failed"
>    elif (str(OUT_RESULT) == '#<unspecified>'):
>        pass
>    else:
>        print OUT_RESULT
>    return OUT_RESULT
>
>
> Thanks!
>
> -Dave
>



--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169



reply via email to

[Prev in Thread] Current Thread [Next in Thread]