summaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_struct.c
diff options
context:
space:
mode:
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': {