From 3c533580f721be42313a6e72c2324f00ef765f6d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 3 May 2020 15:05:22 +0200 Subject: [PATCH 1/2] tolua 5.3 support on macOS --- CMakeLists.txt | 4 +++- s/cmake-init | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d2635f05..9bd567d24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,9 @@ endif() find_package(EXPAT REQUIRED) find_package (ToLua REQUIRED) if (TOLUA_FOUND) -if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2") +if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3") +find_package (Lua 5.3 REQUIRED) +elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2") find_package (Lua 5.2 REQUIRED) else () find_package (Lua51 REQUIRED) diff --git a/s/cmake-init b/s/cmake-init index 22d98b42e..a8228c379 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -79,13 +79,16 @@ git submodule update --init LUA_VERSION="5.2" LUA_INCLUDE=/usr/include LUA_DIR=/usr -if [ -d /usr/include/lua5.1 ]; then - LUA_VERSION="5.1" - LUA_INCLUDE=/usr/include/lua5.1 +if [ -d /usr/local/include/lua5.3 ]; then + LUA_VERSION="5.3" + LUA_INCLUDE=/usr/local/include/lua5.3 elif [ -d /usr/include/lua5.2 ]; then export LUA_DIR=/usr LUA_VERSION="5.2" LUA_INCLUDE=/usr/include/lua5.2 +elif [ -d /usr/include/lua5.1 ]; then + LUA_VERSION="5.1" + LUA_INCLUDE=/usr/include/lua5.1 elif [ -d /usr/local/include/lua5.1 ]; then export LUA_DIR=/usr/local LUA_VERSION="5.1" From 97cb46933eccb9590a34cd0ccc7c37c2914257a4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 3 May 2020 15:16:25 +0200 Subject: [PATCH 2/2] typo, ccidental bit-shift operation --- src/laws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/laws.c b/src/laws.c index fc1c8dc88..01aa4be8d 100644 --- a/src/laws.c +++ b/src/laws.c @@ -684,7 +684,7 @@ growing_trees(region * r, const season_t current_season, const season_t last_wee a->data.sa[0] = (short)cap_int(rtrees(r, 0), 0, SHRT_MAX); a->data.sa[1] = (short)cap_int(rtrees(r, 1), 0, SHRT_MAX); } - else if (a->data.sa[0] < 0 || a->data.sa[1] << 0) { + else if (a->data.sa[0] < 0 || a->data.sa[1] < 0) { a->data.sa[0] = (short)cap_int(a->data.sa[0], 0, SHRT_MAX); a->data.sa[1] = (short)cap_int(a->data.sa[1], 0, SHRT_MAX); }