From 6aca0e436306b176ab7e2e866927442280055b52 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Fri, 7 Mar 2025 18:14:19 +0100 Subject: Buildfix against Lua 5.1 (no lua_Unsigned) Unit tests for lanes.nameof() fail with Lua 5.3 only (to be investigated later) --- src/nameof.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nameof.cpp b/src/nameof.cpp index 1f338a5..938685c 100644 --- a/src/nameof.cpp +++ b/src/nameof.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. // ################################################################################################# -DECLARE_UNIQUE_TYPE(FqnLength, lua_Unsigned); +DECLARE_UNIQUE_TYPE(FqnLength, decltype(lua_rawlen(nullptr, kIdxTop))); // Return some name helping to identify an object [[nodiscard]] @@ -76,7 +76,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_ } FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 }; - lua_rawseti(L_, kFQN, _depth); // L_: o "r" {c} {fqn} ... k v + lua_rawseti(L_, kFQN, static_cast(_depth)); // L_: o "r" {c} {fqn} ... k v STACK_CHECK(L_, 0); STACK_CHECK(L_, 0); return _depth; @@ -85,7 +85,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_ static constexpr auto _popNameFromFQN = [](lua_State* const L_) { STACK_CHECK_START_REL(L_, 0); lua_pushnil(L_); // L_: o "r" {c} {fqn} ... nil - lua_rawseti(L_, kFQN, lua_rawlen(L_, kFQN)); // L_: o "r" {c} {fqn} ... + lua_rawseti(L_, kFQN, static_cast(lua_rawlen(L_, kFQN))); // L_: o "r" {c} {fqn} ... STACK_CHECK(L_, 0); }; -- cgit v1.2.3-55-g6feb