summaryrefslogtreecommitdiffstats
path: root/epan/wslua/lua_bitop.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/wslua/lua_bitop.c
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/wslua/lua_bitop.c')
-rw-r--r--epan/wslua/lua_bitop.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/epan/wslua/lua_bitop.c b/epan/wslua/lua_bitop.c
index 52be189a..10bfb9bf 100644
--- a/epan/wslua/lua_bitop.c
+++ b/epan/wslua/lua_bitop.c
@@ -36,11 +36,7 @@ static UBits barg(lua_State *L, int idx)
{
BitNum bn;
UBits b;
-#if LUA_VERSION_NUM < 502
- bn.n = lua_tonumber(L, idx);
-#else
bn.n = luaL_checknumber(L, idx);
-#endif
#if defined(LUA_NUMBER_DOUBLE) || defined(LUA_FLOAT_DOUBLE)
bn.n += 6755399441055744.0; /* 2^52+2^51 */
#ifdef SWAPPED_DOUBLE
@@ -61,11 +57,6 @@ static UBits barg(lua_State *L, int idx)
#else
#error "Unknown number type, check LUA_NUMBER_*, LUA_FLOAT_*, LUA_INT_* in luaconf.h"
#endif
-#if LUA_VERSION_NUM < 502
- if (b == 0 && !lua_isnumber(L, idx)) {
- luaL_typerror(L, idx, "number");
- }
-#endif
return b;
}
@@ -168,13 +159,9 @@ DIAG_OFF(unreachable-code)
DIAG_ON(unreachable-code)
luaL_error(L, "bit library self-test failed (%s)", msg);
}
-#if LUA_VERSION_NUM < 502
- luaL_register(L, "bit", bit_funcs);
- return 1;
-#else
+
luaL_newlib(L, bit_funcs);
lua_setglobal(L, "bit"); /* added for wireshark */
return 0; /* changed from 1 to 0 for wireshark, since lua_setglobal now pops the table */
-#endif
}