summaryrefslogtreecommitdiffstats
path: root/epan/wslua/make-taps.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
commit1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f (patch)
tree9930fb4bb87cd6037f60efff9656f967121c8c2d /epan/wslua/make-taps.py
parentAdding debian version 4.2.2-1.1. (diff)
downloadwireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.tar.xz
wireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.zip
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xepan/wslua/make-taps.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/wslua/make-taps.py b/epan/wslua/make-taps.py
index 14c5a397..ed677ff5 100755
--- a/epan/wslua/make-taps.py
+++ b/epan/wslua/make-taps.py
@@ -34,18 +34,18 @@ def get_tap_info(tap_name, header_file, struct_name, enum_types):
types = {
'gchar[]': 'lua_pushstring(L,(const char*)v->STR);',
'gchar*': 'lua_pushstring(L,(const char*)v->STR);',
- 'guint': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'guint8': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'guint16': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'guint32': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'gint': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'gint8': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'gint16': 'lua_pushnumber(L,(lua_Number)v->STR);',
- 'gint32': 'lua_pushnumber(L,(lua_Number)v->STR);',
+ 'guint': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'guint8': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'guint16': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'guint32': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'gint': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'gint8': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'gint16': 'lua_pushinteger(L,(lua_Integer)v->STR);',
+ 'gint32': 'lua_pushinteger(L,(lua_Integer)v->STR);',
'gboolean': 'lua_pushboolean(L,(int)v->STR);',
'address': '{ Address a = (Address)g_malloc(sizeof(address)); copy_address(a, &(v->STR)); pushAddress(L,a); }',
'address*': '{ Address a = (Address)g_malloc(sizeof(address)); copy_address(a, v->STR); pushAddress(L,a); }',
- 'int': 'lua_pushnumber(L,(lua_Number)v->STR);',
+ 'int': 'lua_pushinteger(L,(lua_Integer)v->STR);',
'nstime_t': 'lua_pushnumber(L,(lua_Number)nstime_to_sec(&(v->STR)));',
'nstime_t*': 'lua_pushnumber(L,(lua_Number)nstime_to_sec(v->STR));',
}
@@ -79,7 +79,7 @@ def get_tap_info(tap_name, header_file, struct_name, enum_types):
for enum in enum_types:
m = re.search(fr'typedef\s+enum[^{{]*{{([^}}]*)}}[\s\n]*{enum}[\s\n]*;', buf, flags=re.DOTALL)
if m:
- types[enum] = f'lua_pushnumber(L,(lua_Number)v->STR); /* {enum} */'
+ types[enum] = f'lua_pushinteger(L,(lua_Integer)v->STR); /* {enum} */'
econsts = m.group(1).splitlines()
econsts = [re.sub(r'\s+', '', item) for item in econsts]
econsts = [re.sub(',', '', item) for item in econsts]
@@ -183,9 +183,9 @@ def main():
c_body += f'\n\t/*\n\t * {enum}\n\t */\n\tlua_newtable(L);\n'
for econst in enums[enum]:
c_body += f'''\
- lua_pushnumber(L,(lua_Number){econst});
+ lua_pushinteger(L,(lua_Integer){econst});
lua_setglobal(L,"{econst}");
- lua_pushnumber(L,(lua_Number){econst});
+ lua_pushinteger(L,(lua_Integer){econst});
lua_pushstring(L,"{econst}");
lua_settable(L,-3);
'''