diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-07 18:14:19 +0100 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-03-07 18:14:19 +0100 |
| commit | 6aca0e436306b176ab7e2e866927442280055b52 (patch) | |
| tree | 8ebb613d299a9816fae45d2b8c9134680fcaa769 /src | |
| parent | aaef96a2faeb761b2a8b893158899f48c39cbf4b (diff) | |
| download | lanes-6aca0e436306b176ab7e2e866927442280055b52.tar.gz lanes-6aca0e436306b176ab7e2e866927442280055b52.tar.bz2 lanes-6aca0e436306b176ab7e2e866927442280055b52.zip | |
Buildfix against Lua 5.1 (no lua_Unsigned)
Unit tests for lanes.nameof() fail with Lua 5.3 only (to be investigated later)
Diffstat (limited to 'src')
| -rw-r--r-- | src/nameof.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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. | |||
| 31 | 31 | ||
| 32 | // ################################################################################################# | 32 | // ################################################################################################# |
| 33 | 33 | ||
| 34 | DECLARE_UNIQUE_TYPE(FqnLength, lua_Unsigned); | 34 | DECLARE_UNIQUE_TYPE(FqnLength, decltype(lua_rawlen(nullptr, kIdxTop))); |
| 35 | 35 | ||
| 36 | // Return some name helping to identify an object | 36 | // Return some name helping to identify an object |
| 37 | [[nodiscard]] | 37 | [[nodiscard]] |
| @@ -76,7 +76,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_ | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 }; | 78 | FqnLength const _depth{ lua_rawlen(L_, kFQN) + 1 }; |
| 79 | lua_rawseti(L_, kFQN, _depth); // L_: o "r" {c} {fqn} ... k v | 79 | lua_rawseti(L_, kFQN, static_cast<int>(_depth)); // L_: o "r" {c} {fqn} ... k v |
| 80 | STACK_CHECK(L_, 0); | 80 | STACK_CHECK(L_, 0); |
| 81 | STACK_CHECK(L_, 0); | 81 | STACK_CHECK(L_, 0); |
| 82 | return _depth; | 82 | return _depth; |
| @@ -85,7 +85,7 @@ FqnLength DiscoverObjectNameRecur(lua_State* const L_, FqnLength const shortest_ | |||
| 85 | static constexpr auto _popNameFromFQN = [](lua_State* const L_) { | 85 | static constexpr auto _popNameFromFQN = [](lua_State* const L_) { |
| 86 | STACK_CHECK_START_REL(L_, 0); | 86 | STACK_CHECK_START_REL(L_, 0); |
| 87 | lua_pushnil(L_); // L_: o "r" {c} {fqn} ... nil | 87 | lua_pushnil(L_); // L_: o "r" {c} {fqn} ... nil |
| 88 | lua_rawseti(L_, kFQN, lua_rawlen(L_, kFQN)); // L_: o "r" {c} {fqn} ... | 88 | lua_rawseti(L_, kFQN, static_cast<int>(lua_rawlen(L_, kFQN))); // L_: o "r" {c} {fqn} ... |
| 89 | STACK_CHECK(L_, 0); | 89 | STACK_CHECK(L_, 0); |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
