[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    tolua vs double pointers arguments
From:       kolya <kolya () d-inter ! ru>
Date:       2006-08-28 14:53:47
Message-ID: 1104369239.20060828185347 () d-inter ! ru
[Download RAW message or body]

I have C++ function
void f(Foo **arg);
that I'm exposing to Lua using toLua.

tolua produces .cpp file that expects Foo *, not Foo**.
Generated file looks like

....
!tolua_isusertype(tolua_S,5,"Foo",0,&tolua_err) ||
....

and then

arg = (Foo *)tolua_tousertype(...)
f(&arg);

C++ function is designed to store something into pointer "arg". But
tolua fails to understand it.

Moreover, if I am using triple pointer:
void f(Foo ***arg);

tolua generates something like that:

Foo**arg = ((Foo*)  tolua_tousertype(...);

that could not compile due to type mismatch in left hand side and
right hand side.

Or maybe I am doing something wrong? Thanks in advance.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic