lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Nick Trout
> Sent: Wednesday, May 02, 2001 12:18 PM
> To: Multiple recipients of list
> Subject: Re: toLua 4.0a improvements
>
>
>
> >>From: Eric Ries
> >>toLua output
> >>1. toLua doesn't convert enumerated types correctly (although
> this is not
> really toLua's fault, since it doesn't deal with enumerated types
> explicitly), so we have to cast them to int first.
>
> I assume you're having problems accessing enumeration in classes? I got
> round this by doing:

Actually, although I have also encountered the problem you describe, I was
referring to this output from toLua:

MyEnumType tolua_var_1 = ((MyEnumType) tolua_getnumber(tolua_S,2,0));

needs to be:

MyEnumType tolua_var_1 = ((MyEnumType)(int)  tolua_getnumber(tolua_S,2,0));

> >>2. MS VC++ doesn't like the way toLua handles bool values, so have to
> change
> foo = (bool) (tolua_getbool(..));
> to
> foo = (tolua_getbool(..) != 0);
>
> Yep - I would like this changed as well please.

I'm attaching my toLuaFrontend perl script (for reals this time - last time
I forgot to actually attach it). Let me know if you find it useful.

Eric

Attachment: toLuaFrontend.pl
Description: Binary data