Fix warning about loss of precision. I could just declare it as lua_Number but then do you call truncf (which would likely result in a double to float conversion anyway) or trunc which might convert from float to double if LUA_NUMBER had been defined to be float.
This commit is contained in:
@@ -375,7 +375,8 @@ XNode *LuaManager::GetLuaInformation() const
|
||||
}
|
||||
case LUA_TNUMBER:
|
||||
{
|
||||
float fNum = lua_tonumber( L, -1 );
|
||||
// lua_Number is most likely a double unless LUA_NUMBER was defined to be float.
|
||||
float fNum = float( lua_tonumber(L, -1) );
|
||||
|
||||
if( fNum == truncf(fNum) )
|
||||
mConstants[lua_tostring(L, -2)] = int( fNum );
|
||||
|
||||
Reference in New Issue
Block a user