Cast result of floating point retrieval before receiving it

This commit is contained in:
Rapptz 2013-12-14 00:07:41 -05:00
parent c59fc9e536
commit a6306d7012

View File

@ -45,7 +45,7 @@ inline T get_unsigned(lua_State* L, std::false_type, int index = -1) {
template<typename T>
inline T get_arithmetic(lua_State* L, std::false_type, int index = -1) {
// T is a floating point
return lua_tonumber(L, index);
return static_cast<T>(lua_tonumber(L, index));
}
template<typename T>