Skip to content

Commit 1326efb

Browse files
committed
Fix compilation
1 parent b27e35d commit 1326efb

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

Distribution/LuaBridge/LuaBridge.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ inline int lua_rawgetp_x(lua_State* L, int idx, void* p)
253253

254254
inline void lua_rawsetp_x(lua_State* L, int idx, void* p)
255255
{
256-
return lua_rawsetp(L, idx, p);
256+
lua_rawsetp(L, idx, p);
257257
}
258258

259259
#else
@@ -298,7 +298,7 @@ inline int lua_getstack_info_x(lua_State* L, int level, const char* what, lua_De
298298

299299
inline int lua_rawgetp_x(lua_State* L, int idx, void* p)
300300
{
301-
#if LUA_VERSION_NUM < 502
301+
#if LUA_VERSION_NUM < 503
302302
idx = lua_absindex(L, idx);
303303
luaL_checkstack(L, 1, "not enough stack slots");
304304
lua_pushlightuserdata(L, p);
@@ -318,22 +318,12 @@ inline void lua_rawsetp_x(lua_State* L, int idx, void* p)
318318
lua_insert(L, -2);
319319
lua_rawset(L, idx);
320320
#else
321-
return lua_rawsetp(L, idx, p);
321+
lua_rawsetp(L, idx, p);
322322
#endif
323323
}
324324

325325
#endif
326326

327-
inline int lua_rawgetp_x(lua_State* L, int idx, const void* p)
328-
{
329-
return lua_rawgetp_x(L, idx, const_cast<void*>(p));
330-
}
331-
332-
inline void lua_rawsetp_x(lua_State* L, int idx, const void* p)
333-
{
334-
return lua_rawsetp_x(L, idx, const_cast<void*>(p));
335-
}
336-
337327
#if LUA_VERSION_NUM < 505
338328
inline lua_State* lua_newstate_x(lua_Alloc f, void* ud, [[maybe_unused]] unsigned seed)
339329
{
@@ -381,6 +371,16 @@ inline lua_Integer to_integerx(lua_State* L, int idx, int* isnum)
381371
}
382372
#endif
383373

374+
inline int lua_rawgetp_x(lua_State* L, int idx, const void* p)
375+
{
376+
return lua_rawgetp_x(L, idx, const_cast<void*>(p));
377+
}
378+
379+
inline void lua_rawsetp_x(lua_State* L, int idx, const void* p)
380+
{
381+
lua_rawsetp_x(L, idx, const_cast<void*>(p));
382+
}
383+
384384
#ifndef LUA_OK
385385
#define LUABRIDGE_LUA_OK 0
386386
#else

Source/LuaBridge/detail/LuaHelpers.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ inline int lua_rawgetp_x(lua_State* L, int idx, void* p)
157157

158158
inline void lua_rawsetp_x(lua_State* L, int idx, void* p)
159159
{
160-
return lua_rawsetp(L, idx, p);
160+
lua_rawsetp(L, idx, p);
161161
}
162162

163163
#else
@@ -202,7 +202,7 @@ inline int lua_getstack_info_x(lua_State* L, int level, const char* what, lua_De
202202

203203
inline int lua_rawgetp_x(lua_State* L, int idx, void* p)
204204
{
205-
#if LUA_VERSION_NUM < 502
205+
#if LUA_VERSION_NUM < 503
206206
idx = lua_absindex(L, idx);
207207
luaL_checkstack(L, 1, "not enough stack slots");
208208
lua_pushlightuserdata(L, p);
@@ -215,29 +215,19 @@ inline int lua_rawgetp_x(lua_State* L, int idx, void* p)
215215

216216
inline void lua_rawsetp_x(lua_State* L, int idx, void* p)
217217
{
218-
#if LUA_VERSION_NUM < 502
218+
#if LUA_VERSION_NUM < 503
219219
idx = lua_absindex(L, idx);
220220
luaL_checkstack(L, 1, "not enough stack slots");
221221
lua_pushlightuserdata(L, p);
222222
lua_insert(L, -2);
223223
lua_rawset(L, idx);
224224
#else
225-
return lua_rawsetp(L, idx, p);
225+
lua_rawsetp(L, idx, p);
226226
#endif
227227
}
228228

229229
#endif // LUABRIDGE_ON_LUAU
230230

231-
inline int lua_rawgetp_x(lua_State* L, int idx, const void* p)
232-
{
233-
return lua_rawgetp_x(L, idx, const_cast<void*>(p));
234-
}
235-
236-
inline void lua_rawsetp_x(lua_State* L, int idx, const void* p)
237-
{
238-
return lua_rawsetp_x(L, idx, const_cast<void*>(p));
239-
}
240-
241231
// These are for Lua versions prior to 5.5.0.
242232
#if LUA_VERSION_NUM < 505
243233
inline lua_State* lua_newstate_x(lua_Alloc f, void* ud, [[maybe_unused]] unsigned seed)
@@ -287,6 +277,16 @@ inline lua_Integer to_integerx(lua_State* L, int idx, int* isnum)
287277
}
288278
#endif // LUA_VERSION_NUM < 503
289279

280+
inline int lua_rawgetp_x(lua_State* L, int idx, const void* p)
281+
{
282+
return lua_rawgetp_x(L, idx, const_cast<void*>(p));
283+
}
284+
285+
inline void lua_rawsetp_x(lua_State* L, int idx, const void* p)
286+
{
287+
lua_rawsetp_x(L, idx, const_cast<void*>(p));
288+
}
289+
290290
#ifndef LUA_OK
291291
#define LUABRIDGE_LUA_OK 0
292292
#else

0 commit comments

Comments
 (0)