Re: [racket] Sending a cvector to foreign functions.

2011-01-25 Thread Noel Welsh
This is an error in Racket that has to do with syntax certificates -- basically protecting certain variables. I think it is used to implement the (unsafe!) call you have to do to use the FFI. If you don't have (unsafe!) in your code try adding it. If you do I'll have to defer to one of the people w

Re: [racket] Sending a cvector to foreign functions.

2011-01-25 Thread Lewis
Interesting, catches it at compile-time now. Though I can make neither head nor tail of the error.. compile: access from an uncertified context to unexported variable from module: "/usr/lib/racket/collects/ffi/unsafe/cvector.rkt" in: _cvector* === context === /usr/lib/racket/collects/ffi/unsafe.

Re: [racket] Sending a cvector to foreign functions.

2011-01-25 Thread Noel Welsh
Your code looks correct to me. Things you might try: - Check tiles are constructed correctly - Replace _cvector with (_cvector i _tile) for increased error checking Sorry I can't be more helpful. These problems are really hard to debug as the errors could be in so many places. N. On Tue, Jan 25

Re: [racket] Sending a cvector to foreign functions.

2011-01-24 Thread Lewis
Right you are Noel it turns out the C code had a few bugs of its own. I have independently tested it now, and all is working fine from there. The C prototype is now void render(int x_camera, int y_camera, Visual pc, Tile* world); However I still get the error. http://paste.pocoo.org/show/326448

Re: [racket] Sending a cvector to foreign functions.

2011-01-24 Thread Noel Welsh
It is really hard to say (and debug). Have you independently tested the C code? N. On Mon, Jan 24, 2011 at 5:50 AM, Lewis wrote: > Greetings, > > I am trying to send a racket cvector to a C function in a lib I a > writing. The C function in question has the prototype > ... > > Unfortunately, whe

[racket] Sending a cvector to foreign functions.

2011-01-23 Thread Lewis
Greetings, I am trying to send a racket cvector to a C function in a lib I a writing. The C function in question has the prototype void render(int x_camera, int y_camera, Visual pc, Tile **world); The important bit is the last argument, Tile **world. I have registered this in racket as (define