1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-16 11:09:11 +00:00

Fix: no need to cast enums down to int32; they will be automatically promoted to int64

This commit is contained in:
Rubidium
2023-01-31 16:59:14 +01:00
committed by rubidium42
parent 1897e98c3d
commit 67e1d1ad89

View File

@@ -298,7 +298,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
string(APPEND SQUIRREL_EXPORT "\n /* Allow enums to be used as Squirrel parameters */")
foreach(ENUM IN LISTS ENUMS)
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${ENUM} GetParam(ForceType<${ENUM}>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${ENUM}>(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, (int32)res); return 1; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${ENUM}>(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, res); return 1; }")
endforeach()
endif()