Skip to content

Commit bcdac62

Browse files
committed
Fixes
1 parent b49f7da commit bcdac62

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎Tests/Lua/Lua.5.2.4/src/llimits.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
283283

284284
#define luai_hashnum(i,n) { int e; \
285285
n = l_mathop(frexp)(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
286-
lua_number2int(i, n); i += e; }
286+
lua_number2int(i, n); i = (int)((unsigned int)(i) + (unsigned int)(e)); }
287287

288288
#endif
289289

‎Tests/Source/MapTests.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ TEST_F(MapTests, LuaRef)
118118
EXPECT_EQ(expected, result<Map>());
119119
}
120120

121+
#if !defined(LUABRIDGE_TEST_LUA_VERSION) || LUABRIDGE_TEST_LUA_VERSION > 502
121122
{
122123
using Map = std::map<luabridge::LuaRef, luabridge::LuaRef>;
123124

@@ -138,6 +139,7 @@ TEST_F(MapTests, LuaRef)
138139

139140
EXPECT_EQ(expected, result<Map>());
140141
}
142+
#endif
141143
}
142144

143145
TEST_F(MapTests, CastToMap)

‎Tests/Source/OverloadTests.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ TEST_F(OverloadTests, IntegerTypeFallbackOverloads)
160160
ASSERT_TRUE(result().isNumber());
161161
EXPECT_EQ(3, result<int>());
162162

163-
#if LUA_VERSION_NUM > 502
163+
#if ! LUABRIDGE_ON_LUAU && LUA_VERSION_NUM > 502
164164
if constexpr (sizeof(lua_Integer) >= sizeof(int64_t))
165165
{
166166
runLua("result = test (2147483648)");

‎Tests/Source/UnorderedMapTests.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ TEST_F(UnorderedMapTests, StackOverflow)
133133

134134
TEST_F(UnorderedMapTests, LuaRef)
135135
{
136+
#if !defined(LUABRIDGE_TEST_LUA_VERSION) || LUABRIDGE_TEST_LUA_VERSION > 502
136137
{
137138
runLua("result = {[false] = true, a = 'abc', [1] = 5, [3.14] = -1.1}");
138139

@@ -150,6 +151,7 @@ TEST_F(UnorderedMapTests, LuaRef)
150151
ASSERT_EQ(expected, actual);
151152
ASSERT_EQ(expected, result<Map>());
152153
}
154+
#endif
153155

154156
{
155157
runLua("result = {'a', 'b', 'c'}");

0 commit comments

Comments
 (0)