aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_proto_field.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2023-01-04 09:54:52 -0800
committerGerald Combs <gerald@wireshark.org>2023-01-04 09:54:52 -0800
commit3120e64570f0141b59c1df9296f4e018c555a982 (patch)
treee0fab1617faa2f748bebe865b9dc1fbb62755e1f /epan/wslua/wslua_proto_field.c
parent90084d826959ee1e0bed97ad3fff5c929c66353c (diff)
wslua: Fix the build.
Fix wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: the following warning is treated as an error [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: mask = (guint64)wslua_optguint32(L, idx, default_value); [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): error C2220: ^ [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: 'function': conversion from 'guint64' to 'lua_Number', possible loss of data [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: mask = (guint64)wslua_optguint32(L, idx, default_value); [wireshark\build\epan\wslua\wslua.vcxproj] wireshark\epan\wslua\wslua_proto_field.c(423,29): warning C4244: ^ [wireshark\build\epan\wslua\wslua.vcxproj] on Windows and wireshark/epan/wslua/wslua_proto_field.c:1462:48: error: format specifies type 'unsigned long' but the argument has type 'guint64' (aka 'unsigned long long') [-Werror,-Wformat] f->vs,f->mask,f->blob); ^~~~~~~ wireshark/wsutil/wmem/wmem_strutl.h:51:56: note: expanded from macro 'ws_strdup_printf' #define ws_strdup_printf(...) wmem_strdup_printf(NULL, __VA_ARGS__) ^~~~~~~~~~~ on macOS.
Diffstat (limited to 'epan/wslua/wslua_proto_field.c')
-rw-r--r--epan/wslua/wslua_proto_field.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/wslua/wslua_proto_field.c b/epan/wslua/wslua_proto_field.c
index fa8206e0a0..86f3652e58 100644
--- a/epan/wslua/wslua_proto_field.c
+++ b/epan/wslua/wslua_proto_field.c
@@ -420,7 +420,7 @@ static guint64 get_mask(lua_State* L, int idx, guint64 default_value) {
switch(lua_type(L, idx)) {
case LUA_TNUMBER:
- mask = (guint64)wslua_optguint32(L, idx, default_value);
+ mask = (guint64)wslua_optguint32(L, idx, (lua_Number)default_value);
break;
case LUA_TSTRING:
case LUA_TUSERDATA:
@@ -1455,7 +1455,7 @@ PROTOFIELD_OTHER(eui64,FT_EUI64)
WSLUA_METAMETHOD ProtoField__tostring(lua_State* L) {
/* Returns a string with info about a protofield (for debugging purposes). */
ProtoField f = checkProtoField(L,1);
- gchar* s = ws_strdup_printf("ProtoField(%i): %s %s %s %s %p %.16lx %s",
+ gchar* s = ws_strdup_printf("ProtoField(%i): %s %s %s %s %p %.16" PRIu64 "x %s",
f->hfid,f->name,f->abbrev,
ftenum_to_string(f->type),
base_to_string(f->base),