summaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_struct.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:25 +0000
commitf59ea5f7690c9a01ef6f7f6508084a66c40b1dae (patch)
tree482ee255d71f113be6c62e9ff3543fd6ebb9f12a /epan/wslua/wslua_struct.c
parentReleasing progress-linux version 4.2.2-1.1~progress7.99u1. (diff)
downloadwireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.tar.xz
wireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.zip
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/wslua/wslua_struct.c')
-rw-r--r--epan/wslua/wslua_struct.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/wslua/wslua_struct.c b/epan/wslua/wslua_struct.c
index 7d62dc0..440a090 100644
--- a/epan/wslua/wslua_struct.c
+++ b/epan/wslua/wslua_struct.c
@@ -410,7 +410,7 @@ WSLUA_CONSTRUCTOR Struct_pack (lua_State *L) {
* given endianness and size. If the integer type is signed, this makes
* the Lua number be +/- correctly as well.
*/
-static lua_Number getinteger (const gchar *buff, int endian,
+static lua_Integer getinteger (const gchar *buff, int endian,
int issigned, int size) {
Uinttype l = 0;
int i;
@@ -427,12 +427,12 @@ static lua_Number getinteger (const gchar *buff, int endian,
}
}
if (!issigned)
- return (lua_Number)l;
+ return (lua_Integer)l;
else { /* signed format */
Uinttype mask = (Uinttype)(~((Uinttype)0)) << (size*8 - 1);
if (l & mask) /* negative value? */
l |= mask; /* signal extension */
- return (lua_Number)(Inttype)l;
+ return (lua_Integer)(Inttype)l;
}
}
@@ -470,8 +470,8 @@ WSLUA_CONSTRUCTOR Struct_unpack (lua_State *L) {
case 'b': case 'B': case 'h': case 'H':
case 'l': case 'L': case 'T': case 'i': case 'I': { /* integer types */
int issigned = g_ascii_islower(opt);
- lua_Number res = getinteger(data+pos, h.endian, issigned, (int)size);
- lua_pushnumber(L, res);
+ lua_Integer res = getinteger(data+pos, h.endian, issigned, (int)size);
+ lua_pushinteger(L, res);
break;
}
case 'e': {