From f3c59a02b8b8f16ad6974f7044a028984a4028a4 Mon Sep 17 00:00:00 2001 From: sudlud Date: Sat, 8 Feb 2025 11:37:37 +0100 Subject: [PATCH] fix(CI): re-enable -Werror compile flag (#256) --- .github/workflows/core-build-base.yml | 2 ++ src/LuaEngine/lmarshal.cpp | 2 +- src/LuaEngine/methods/MapMethods.h | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/core-build-base.yml b/.github/workflows/core-build-base.yml index 846d959..5d1d0d1 100644 --- a/.github/workflows/core-build-base.yml +++ b/.github/workflows/core-build-base.yml @@ -58,6 +58,8 @@ jobs: -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_C_FLAGS="-Werror" \ + -DCMAKE_CXX_FLAGS="-Werror" \ -DLUA_VERSION=${{ inputs.lua_version }} make -j$(nproc) cd .. diff --git a/src/LuaEngine/lmarshal.cpp b/src/LuaEngine/lmarshal.cpp index 796c6bb..a0e962e 100644 --- a/src/LuaEngine/lmarshal.cpp +++ b/src/LuaEngine/lmarshal.cpp @@ -204,7 +204,7 @@ static void mar_encode_value(lua_State *L, mar_Buffer *buf, int val, size_t *idx } else { mar_Buffer rec_buf; - unsigned int i; + unsigned char i; lua_Debug ar; lua_pop(L, 1); /* pop nil */ diff --git a/src/LuaEngine/methods/MapMethods.h b/src/LuaEngine/methods/MapMethods.h index a2a269a..eed59bb 100644 --- a/src/LuaEngine/methods/MapMethods.h +++ b/src/LuaEngine/methods/MapMethods.h @@ -358,13 +358,13 @@ namespace LuaMap */ int GetCreaturesByAreaId(lua_State* L, Map* map) { - uint32 areaId = Eluna::CHECKVAL(L, 2, -1); + int32 areaId = Eluna::CHECKVAL(L, 2, -1); std::vector filteredCreatures; for (const auto& pair : map->GetCreatureBySpawnIdStore()) { Creature* creature = pair.second; - if (areaId == -1 || creature->GetAreaId() == areaId) + if (areaId == -1 || creature->GetAreaId() == (uint32)areaId) { filteredCreatures.push_back(creature); }