[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT [FFI]: pass integer to function as argument of type const void *
- From: Adam Strzelecki <ono@...>
- Date: Fri, 23 Dec 2011 23:31:13 +0100
> 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))