mrw wrote: > But I think that it is already using -double- as a lua number type. Or > is lua being rather more subtle that I imagine ? I was thinking that > that lua simply converts an integer to a double anyway, all the time. I > may be wrong.
The Lua version 5.1.1 in LMS appears to differ from the downloadable tarball version 5.1.1 and the Lua website. So that hasn't helped me, I've probably been working off false assumptions. -LUA_TINT- seems to drive matters. It's in the LMS version 5.1.1, and 5.1.5, but not in the Lua 'stock' 5.1.1. It seems to be set to '-2' in -lua.h- : https://github.com/Logitech/squeezeplay/blob/public/7.8/src/lua-5.1.1/src/lua.h#L81 Here is where -lua_pushinteger- is defined: https://github.com/Logitech/squeezeplay/blob/public/7.8/src/lua-5.1.1/src/lapi.c#L462 And here is where the key -setivalue- is defined: https://github.com/Logitech/squeezeplay/blob/public/7.8/src/lua-5.1.1/src/lobject.h#L157 I observe that if -LUA_TINT- is defined, it all looks very complicated. Otherwise it just seems to cast the integer to a lua_Number. Code: -------------------- #define setivalue(obj,x) \ setnvalue( (obj), cast(lua_Number, (x)) ) -------------------- So, it looks like lua _is_ being rather more subtle that I imagined, and my assumptions about integers being converted to double all the time may simply not be true. I'm not sure what the implications would be on my previous thinking. My earlier thought of using -lua_pushnumber- to deal with "negative" jive_jiffies is probably not the best way to go... :) ------------------------------------------------------------------------ mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299 View this thread: http://forums.slimdevices.com/showthread.php?t=111663 _______________________________________________ Radio mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/radio
