[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT [FFI]: pass integer to function as argument of type const void *
- From: Vladimir Protasov <eoranged@...>
- Date: Sat, 24 Dec 2011 02:39:30 +0400
Thanks, Adam, This worked just fine and solved the problem.
24.12.2011, 02:31, "Adam Strzelecki" <firstname.lastname@example.org>:
>> Is it any way to pass int to function, expecting *void?
>> I cannot change type in declaration to int*, because sometimes I need to pass strings instead of integers.
> Hmm... the function expects int* (pointer to int), but you are trying to pass int by value, which probably renders segfault because 22 is not valid address. Try that:
> ssh.ssh_options_set(session, 1, ffi.new("int", 22))
> Adam Strzelecki