Lua/LuaInstance: Fix LuaImplReplyVal for enum flags
This commit is contained in:
@@ -122,7 +122,7 @@ namespace Nz
|
|||||||
unsigned int ret = LuaImplQueryArg(instance, index, &pot2Val, TypeTag<UnderlyingT>());
|
unsigned int ret = LuaImplQueryArg(instance, index, &pot2Val, TypeTag<UnderlyingT>());
|
||||||
|
|
||||||
*arg = static_cast<T>(IntegralLog2Pot(pot2Val));
|
*arg = static_cast<T>(IntegralLog2Pot(pot2Val));
|
||||||
return 1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@@ -134,7 +134,7 @@ namespace Nz
|
|||||||
unsigned int ret = LuaImplQueryArg(instance, index, &pot2Val, 1U << static_cast<UnderlyingT>(defValue), TypeTag<UnderlyingT>());
|
unsigned int ret = LuaImplQueryArg(instance, index, &pot2Val, 1U << static_cast<UnderlyingT>(defValue), TypeTag<UnderlyingT>());
|
||||||
|
|
||||||
*arg = static_cast<T>(IntegralLog2Pot(pot2Val));
|
*arg = static_cast<T>(IntegralLog2Pot(pot2Val));
|
||||||
return 1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
@@ -232,8 +232,8 @@ namespace Nz
|
|||||||
template<typename E>
|
template<typename E>
|
||||||
int LuaImplReplyVal(const LuaInstance& instance, Flags<E> val, TypeTag<Flags<E>>)
|
int LuaImplReplyVal(const LuaInstance& instance, Flags<E> val, TypeTag<Flags<E>>)
|
||||||
{
|
{
|
||||||
UInt32 bitField(val);
|
instance.PushInteger(UInt32(val));
|
||||||
return LuaImplReplyVal(instance, bitField, TypeTag<decltype(bitField)>());
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|||||||
Reference in New Issue
Block a user