Closed daurnimator closed 12 years ago
I think I know what's going on. The return of ffi.cast is a lua number. Thus it gets converted to a double in the vararg. ffi.cast('int', x) should return a boxed int.
You should be able to use ffi.cast('uintptr_t') for now.
This was actually caused by #40 where the tonumber('04000', 8) was being parsed as base 10.
I noticed that casting didn't work how it does in luajit. When calling a vararg function, the casts don't seem to do the correct thing. Consider a short example that sets a file descriptor as non-blocking:
Looking via strace, this is actually doing: