| 1 | diff --git epan/wslua/init_wslua.c epan/wslua/init_wslua.c |
| 2 | index d7f2e3a..4407eb4 100644 |
| 3 | --- epan/wslua/init_wslua.c |
| 4 | +++ epan/wslua/init_wslua.c |
| 5 | @@ -130,12 +130,11 @@ int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) { |
| 6 | |
| 7 | } |
| 8 | |
| 9 | -static void iter_table_and_call(lua_State* LS, int env, const gchar* table_name, lua_CFunction error_handler) { |
| 10 | +static void iter_table_and_call(lua_State* LS, const gchar* table_name, lua_CFunction error_handler) { |
| 11 | lua_settop(LS,0); |
| 12 | |
| 13 | lua_pushcfunction(LS,error_handler); |
| 14 | - lua_pushstring(LS, table_name); |
| 15 | - lua_gettable(LS, env); |
| 16 | + lua_getglobal(LS, table_name); |
| 17 | |
| 18 | if (!lua_istable(LS, 2)) { |
| 19 | report_failure("Lua: either `%s' does not exist or it is not a table!\n",table_name); |
| 20 | @@ -183,7 +182,7 @@ static void wslua_init_routine(void) { |
| 21 | } |
| 22 | |
| 23 | if (L) { |
| 24 | - iter_table_and_call(L, LUA_GLOBALSINDEX, WSLUA_INIT_ROUTINES,init_error_handler); |
| 25 | + iter_table_and_call(L, WSLUA_INIT_ROUTINES,init_error_handler); |
| 26 | } |
| 27 | |
| 28 | } |
| 29 | @@ -239,7 +238,11 @@ static gboolean lua_load_script(const gchar* filename) { |
| 30 | |
| 31 | lua_pushcfunction(L,lua_main_error_handler); |
| 32 | |
| 33 | +#if LUA_VERSION_NUM >= 502 |
| 34 | + error = lua_load(L,getF,file,filename,NULL); |
| 35 | +#else |
| 36 | error = lua_load(L,getF,file,filename); |
| 37 | +#endif |
| 38 | switch (error) { |
| 39 | case 0: |
| 40 | lua_pcall(L,0,0,1); |
| 41 | @@ -254,6 +257,10 @@ static gboolean lua_load_script(const gchar* filename) { |
| 42 | report_failure("Lua: memory allocation error during execution of %s",filename); |
| 43 | fclose(file); |
| 44 | return FALSE; |
| 45 | + default: |
| 46 | + report_failure("Lua: unspecified error during execution of %s", filename); |
| 47 | + fclose(file); |
| 48 | + return FALSE; |
| 49 | } |
| 50 | |
| 51 | report_failure("Lua: unknown error during execution of %s: %d",filename,error); |
| 52 | @@ -348,9 +355,8 @@ int wslua_init(register_cb cb, gpointer client_data) { |
| 53 | lua_atpanic(L,wslua_panic); |
| 54 | |
| 55 | /* the init_routines table (accessible by the user) */ |
| 56 | - lua_pushstring(L, WSLUA_INIT_ROUTINES); |
| 57 | lua_newtable (L); |
| 58 | - lua_settable(L, LUA_GLOBALSINDEX); |
| 59 | + lua_setglobal(L, WSLUA_INIT_ROUTINES); |
| 60 | |
| 61 | /* the dissectors table goes in the registry (not accessible) */ |
| 62 | lua_newtable (L); |
| 63 | @@ -374,8 +380,7 @@ int wslua_init(register_cb cb, gpointer client_data) { |
| 64 | filename = NULL; |
| 65 | |
| 66 | /* check if lua is to be disabled */ |
| 67 | - lua_pushstring(L,"disable_lua"); |
| 68 | - lua_gettable(L, LUA_GLOBALSINDEX); |
| 69 | + lua_getglobal(L,"disable_lua"); |
| 70 | |
| 71 | if (lua_isboolean(L,-1) && lua_toboolean(L,-1)) { |
| 72 | /* disable lua */ |
| 73 | @@ -388,8 +393,7 @@ int wslua_init(register_cb cb, gpointer client_data) { |
| 74 | lua_load_plugins(get_plugin_dir()); |
| 75 | |
| 76 | /* check whether we should run other scripts even if running superuser */ |
| 77 | - lua_pushstring(L,"run_user_scripts_when_superuser"); |
| 78 | - lua_gettable(L, LUA_GLOBALSINDEX); |
| 79 | + lua_getglobal(L,"run_user_scripts_when_superuser"); |
| 80 | |
| 81 | if (lua_isboolean(L,-1) && lua_toboolean(L,-1)) { |
| 82 | run_anyway = TRUE; |
| 83 | @@ -424,9 +428,8 @@ int wslua_init(register_cb cb, gpointer client_data) { |
| 84 | * after this point it is too late to register a menu |
| 85 | * disable the function to avoid weirdness |
| 86 | */ |
| 87 | - lua_pushstring(L, "register_menu"); |
| 88 | lua_pushcfunction(L, wslua_not_register_menu); |
| 89 | - lua_settable(L, LUA_GLOBALSINDEX); |
| 90 | + lua_setglobal(L, "register_menu"); |
| 91 | |
| 92 | /* set up some essential globals */ |
| 93 | lua_pinfo = NULL; |
| 94 | diff --git epan/wslua/lua_bitop.c epan/wslua/lua_bitop.c |
| 95 | index 5fb7789..e602615 100644 |
| 96 | --- epan/wslua/lua_bitop.c |
| 97 | +++ epan/wslua/lua_bitop.c |
| 98 | @@ -81,7 +81,7 @@ static UBits barg(lua_State *L, int idx) |
| 99 | #error "Unknown number type, check LUA_NUMBER_* in luaconf.h" |
| 100 | #endif |
| 101 | if (b == 0 && !lua_isnumber(L, idx)) |
| 102 | - luaL_typerror(L, idx, "number"); |
| 103 | + luaL_error(L, "bad argument %d (number expected, got %s)", idx, lua_typename(L, lua_type(L, idx))); |
| 104 | return b; |
| 105 | } |
| 106 | |
| 107 | @@ -174,7 +174,14 @@ LUALIB_API int luaopen_bit(lua_State *L) |
| 108 | msg = "arithmetic right-shift broken"; |
| 109 | luaL_error(L, "bit library self-test failed (%s)", msg); |
| 110 | } |
| 111 | + |
| 112 | +#if LUA_VERSION_NUM >= 502 |
| 113 | + luaL_newlib(L, bit_funcs); |
| 114 | + lua_setglobal(L, "bit"); |
| 115 | +#else |
| 116 | luaL_register(L, "bit", bit_funcs); |
| 117 | +#endif |
| 118 | + |
| 119 | return 1; |
| 120 | } |
| 121 | |
| 122 | diff --git epan/wslua/make-taps.pl epan/wslua/make-taps.pl |
| 123 | index c916d86..0ca8e46 100755 |
| 124 | --- epan/wslua/make-taps.pl |
| 125 | +++ epan/wslua/make-taps.pl |
| 126 | @@ -195,14 +195,14 @@ TBLFTR |
| 127 | |
| 128 | |
| 129 | for my $ename (sort keys %enums) { |
| 130 | - print CFILE "\n\t/*\n\t * $ename\n\t */\n\tlua_pushstring(L,\"$ename\"); lua_newtable(L);\n"; |
| 131 | + print CFILE "\n\t/*\n\t * $ename\n\t */\n\tlua_newtable(L);\n"; |
| 132 | for my $a (@{$enums{$ename}}) { |
| 133 | print CFILE <<"ENUMELEM"; |
| 134 | - lua_pushstring(L,"$a"); lua_pushnumber(L,(lua_Number)$a); lua_settable(L,LUA_GLOBALSINDEX); |
| 135 | + lua_pushnumber(L,(lua_Number)$a); lua_setglobal(L,"$a"); |
| 136 | lua_pushnumber(L,(lua_Number)$a); lua_pushstring(L,"$a"); lua_settable(L,-3); |
| 137 | ENUMELEM |
| 138 | } |
| 139 | - print CFILE "\tlua_settable(L,LUA_GLOBALSINDEX);\n"; |
| 140 | + print CFILE "\tlua_setglobal(L,\"$ename\");\n"; |
| 141 | } |
| 142 | |
| 143 | print CFILE <<"TAIL"; |
| 144 | diff --git epan/wslua/wslua.h epan/wslua/wslua.h |
| 145 | index b593b7e..a919543 100644 |
| 146 | --- epan/wslua/wslua.h |
| 147 | +++ epan/wslua/wslua.h |
| 148 | @@ -258,7 +258,7 @@ typedef struct _wslua_private_table* PrivateTable; |
| 149 | #define WSLUA_CLASS_DEFINE(C,check_code,push_code) \ |
| 150 | C to##C(lua_State* L, int idx) { \ |
| 151 | C* v = (C*)lua_touserdata (L, idx); \ |
| 152 | - if (!v) luaL_typerror(L,idx,#C); \ |
| 153 | + if (!v) luaL_error(L, "bad argument %d (%s expected, got %s)", idx, #C, lua_typename(L, lua_type(L, idx))); \ |
| 154 | return v ? *v : NULL; \ |
| 155 | } \ |
| 156 | C check##C(lua_State* L, int idx) { \ |
| 157 | @@ -299,6 +299,29 @@ typedef int dummy##C |
| 158 | |
| 159 | #ifdef HAVE_LUA_5_1 |
| 160 | |
| 161 | +#if LUA_VERSION_NUM >= 502 |
| 162 | +#define WSLUA_REGISTER_CLASS(C) { \ |
| 163 | + int lib_idx, meta_idx; \ |
| 164 | + lua_createtable(L, 0, 0); \ |
| 165 | + lib_idx = lua_gettop(L); \ |
| 166 | + luaL_newmetatable(L, #C); \ |
| 167 | + meta_idx = lua_gettop(L); \ |
| 168 | + luaL_setfuncs(L, C ## _meta, 0); \ |
| 169 | + luaL_newlib(L, C ## _methods); \ |
| 170 | + lua_setfield(L, meta_idx, "__index"); \ |
| 171 | + luaL_newlib(L, C ## _meta); \ |
| 172 | + lua_setfield(L, meta_idx, "__metatable"); \ |
| 173 | + lua_setmetatable(L, lib_idx); \ |
| 174 | + lua_setglobal(L, #C); \ |
| 175 | +} |
| 176 | + |
| 177 | +#define WSLUA_REGISTER_META(C) { \ |
| 178 | + luaL_newmetatable (L, #C); \ |
| 179 | + luaL_setfuncs (L, C ## _meta, 0); \ |
| 180 | + lua_pop(L,1); \ |
| 181 | +} |
| 182 | + |
| 183 | +#else |
| 184 | #define WSLUA_REGISTER_CLASS(C) { \ |
| 185 | luaL_register (L, #C, C ## _methods); \ |
| 186 | luaL_newmetatable (L, #C); \ |
| 187 | @@ -317,6 +340,7 @@ typedef int dummy##C |
| 188 | luaL_register (L, NULL, C ## _meta); \ |
| 189 | lua_pop(L,1); \ |
| 190 | } |
| 191 | +#endif |
| 192 | |
| 193 | #define WSLUA_INIT(L) \ |
| 194 | luaL_openlibs(L); \ |
| 195 | @@ -326,7 +350,9 @@ typedef int dummy##C |
| 196 | #endif |
| 197 | |
| 198 | #define WSLUA_FUNCTION extern int |
| 199 | -#define WSLUA_REGISTER_FUNCTION(name) { lua_pushstring(L, #name); lua_pushcfunction(L, wslua_## name); lua_settable(L, LUA_GLOBALSINDEX); } |
| 200 | + |
| 201 | +#define WSLUA_REGISTER_FUNCTION(name) { lua_pushcfunction(L, wslua_## name); lua_setglobal(L, #name); } |
| 202 | + |
| 203 | #define WSLUA_REGISTER extern int |
| 204 | |
| 205 | #define WSLUA_METHOD static int |
| 206 | @@ -335,17 +361,17 @@ typedef int dummy##C |
| 207 | #define WSLUA_ATTR_GET static int |
| 208 | #define WSLUA_METAMETHOD static int |
| 209 | |
| 210 | -#define WSLUA_METHODS static const luaL_reg |
| 211 | -#define WSLUA_META static const luaL_reg |
| 212 | +#define WSLUA_METHODS static const luaL_Reg |
| 213 | +#define WSLUA_META static const luaL_Reg |
| 214 | #define WSLUA_CLASS_FNREG(class,name) { #name, class##_##name } |
| 215 | |
| 216 | #define WSLUA_ERROR(name,error) { luaL_error(L, ep_strdup_printf("%s%s", #name ": " ,error) ); return 0; } |
| 217 | #define WSLUA_ARG_ERROR(name,attr,error) { luaL_argerror(L,WSLUA_ARG_ ## name ## _ ## attr, #name ": " error); return 0; } |
| 218 | #define WSLUA_OPTARG_ERROR(name,attr,error) { luaL_argerror(L,WSLUA_OPTARG_##name##_ ##attr, #name ": " error); return 0; } |
| 219 | |
| 220 | -#define WSLUA_REG_GLOBAL_BOOL(L,n,v) { lua_pushstring(L,n); lua_pushboolean(L,v); lua_settable(L, LUA_GLOBALSINDEX); } |
| 221 | -#define WSLUA_REG_GLOBAL_STRING(L,n,v) { lua_pushstring(L,n); lua_pushstring(L,v); lua_settable(L, LUA_GLOBALSINDEX); } |
| 222 | -#define WSLUA_REG_GLOBAL_NUMBER(L,n,v) { lua_pushstring(L,n); lua_pushnumber(L,v); lua_settable(L, LUA_GLOBALSINDEX); } |
| 223 | +#define WSLUA_REG_GLOBAL_BOOL(L,n,v) { lua_pushboolean(L,v); lua_setglobal(L,n); } |
| 224 | +#define WSLUA_REG_GLOBAL_STRING(L,n,v) { lua_pushstring(L,v); lua_setglobal(L,n); } |
| 225 | +#define WSLUA_REG_GLOBAL_NUMBER(L,n,v) { lua_pushnumber(L,v); lua_setglobal(L,n); } |
| 226 | |
| 227 | #define WSLUA_RETURN(i) return (i); |
| 228 | |
| 229 | diff --git epan/wslua/wslua_field.c epan/wslua/wslua_field.c |
| 230 | index b9505b7..7a380e0 100644 |
| 231 | --- epan/wslua/wslua_field.c |
| 232 | +++ epan/wslua/wslua_field.c |
| 233 | @@ -208,7 +208,7 @@ static int FieldInfo_get_name(lua_State* L) { |
| 234 | return 1; |
| 235 | } |
| 236 | |
| 237 | -static const luaL_reg FieldInfo_get[] = { |
| 238 | +static const luaL_Reg FieldInfo_get[] = { |
| 239 | /* {"data_source", FieldInfo_get_data_source }, */ |
| 240 | {"range", FieldInfo_get_range}, |
| 241 | /* {"hidden", FieldInfo_get_hidden}, */ |
| 242 | @@ -232,7 +232,7 @@ static int FieldInfo__index(lua_State* L) { |
| 243 | Other attributes: |
| 244 | */ |
| 245 | const gchar* idx = luaL_checkstring(L,2); |
| 246 | - const luaL_reg* r; |
| 247 | + const luaL_Reg* r; |
| 248 | |
| 249 | checkFieldInfo(L,1); |
| 250 | |
| 251 | @@ -294,7 +294,7 @@ WSLUA_METAMETHOD FieldInfo__lt(lua_State* L) { |
| 252 | } |
| 253 | |
| 254 | |
| 255 | -static const luaL_reg FieldInfo_meta[] = { |
| 256 | +static const luaL_Reg FieldInfo_meta[] = { |
| 257 | {"__tostring", FieldInfo__tostring}, |
| 258 | {"__call", FieldInfo__call}, |
| 259 | {"__index", FieldInfo__index}, |
| 260 | @@ -469,12 +469,12 @@ WSLUA_METAMETHOD Field_tostring(lua_State* L) { |
| 261 | return 1; |
| 262 | } |
| 263 | |
| 264 | -static const luaL_reg Field_methods[] = { |
| 265 | +static const luaL_Reg Field_methods[] = { |
| 266 | {"new", Field_new}, |
| 267 | { NULL, NULL } |
| 268 | }; |
| 269 | |
| 270 | -static const luaL_reg Field_meta[] = { |
| 271 | +static const luaL_Reg Field_meta[] = { |
| 272 | {"__tostring", Field_tostring}, |
| 273 | {"__call", Field__call}, |
| 274 | { NULL, NULL } |
| 275 | diff --git epan/wslua/wslua_listener.c epan/wslua/wslua_listener.c |
| 276 | index 6e43f6b..fb04a4c 100644 |
| 277 | --- epan/wslua/wslua_listener.c |
| 278 | +++ epan/wslua/wslua_listener.c |
| 279 | @@ -297,13 +297,13 @@ static int Listener_newindex(lua_State* L) { |
| 280 | } |
| 281 | |
| 282 | |
| 283 | -static const luaL_reg Listener_methods[] = { |
| 284 | +static const luaL_Reg Listener_methods[] = { |
| 285 | {"new", Listener_new}, |
| 286 | {"remove", Listener_remove}, |
| 287 | { NULL, NULL } |
| 288 | }; |
| 289 | |
| 290 | -static const luaL_reg Listener_meta[] = { |
| 291 | +static const luaL_Reg Listener_meta[] = { |
| 292 | {"__tostring", Listener_tostring}, |
| 293 | {"__newindex", Listener_newindex}, |
| 294 | { NULL, NULL } |
| 295 | diff --git epan/wslua/wslua_pinfo.c epan/wslua/wslua_pinfo.c |
| 296 | index 435b890..f61b14c 100644 |
| 297 | --- epan/wslua/wslua_pinfo.c |
| 298 | +++ epan/wslua/wslua_pinfo.c |
| 299 | @@ -301,9 +301,9 @@ WSLUA_META NSTime_meta[] = { |
| 300 | int NSTime_register(lua_State* L) { |
| 301 | WSLUA_REGISTER_META(NSTime); |
| 302 | |
| 303 | - lua_pushstring(L, "NSTime"); |
| 304 | lua_pushcfunction(L, NSTime_new); |
| 305 | - lua_settable(L, LUA_GLOBALSINDEX); |
| 306 | + lua_setglobal(L, "NSTime"); |
| 307 | + |
| 308 | return 1; |
| 309 | } |
| 310 | |
| 311 | @@ -809,7 +809,7 @@ static int Columns_gc(lua_State* L) { |
| 312 | } |
| 313 | |
| 314 | |
| 315 | -static const luaL_reg Columns_meta[] = { |
| 316 | +static const luaL_Reg Columns_meta[] = { |
| 317 | {"__tostring", Columns__tostring }, |
| 318 | {"__newindex", Columns__newindex }, |
| 319 | {"__index", Columns_index}, |
| 320 | @@ -1444,7 +1444,7 @@ static int Pinfo_gc(lua_State* L) { |
| 321 | |
| 322 | } |
| 323 | |
| 324 | -static const luaL_reg Pinfo_meta[] = { |
| 325 | +static const luaL_Reg Pinfo_meta[] = { |
| 326 | {"__index", Pinfo_index}, |
| 327 | {"__newindex",Pinfo_setindex}, |
| 328 | {"__tostring", Pinfo_tostring}, |
| 329 | diff --git epan/wslua/wslua_proto.c epan/wslua/wslua_proto.c |
| 330 | index 439a91c..384f83f 100644 |
| 331 | --- epan/wslua/wslua_proto.c |
| 332 | +++ epan/wslua/wslua_proto.c |
| 333 | @@ -1095,7 +1095,7 @@ static int ProtoField_gc(lua_State* L) { |
| 334 | return 0; |
| 335 | } |
| 336 | |
| 337 | -static const luaL_reg ProtoField_methods[] = { |
| 338 | +static const luaL_Reg ProtoField_methods[] = { |
| 339 | {"new", ProtoField_new}, |
| 340 | {"uint8",ProtoField_uint8}, |
| 341 | {"uint16",ProtoField_uint16}, |
| 342 | @@ -1126,7 +1126,7 @@ static const luaL_reg ProtoField_methods[] = { |
| 343 | { NULL, NULL } |
| 344 | }; |
| 345 | |
| 346 | -static const luaL_reg ProtoField_meta[] = { |
| 347 | +static const luaL_Reg ProtoField_meta[] = { |
| 348 | {"__tostring", ProtoField__tostring }, |
| 349 | {"__gc", ProtoField_gc }, |
| 350 | { NULL, NULL } |
| 351 | @@ -1281,12 +1281,21 @@ static int Proto_set_init(lua_State* L) { |
| 352 | if (lua_isfunction(L,3)) { |
| 353 | /* insert the dissector into the dissectors table */ |
| 354 | lua_pushstring(L, WSLUA_INIT_ROUTINES); |
| 355 | +#if LUA_VERSION_NUM >= 502 |
| 356 | + lua_pushglobaltable(L); |
| 357 | +#else |
| 358 | lua_gettable(L, LUA_GLOBALSINDEX); |
| 359 | +#endif |
| 360 | lua_replace(L, 1); |
| 361 | lua_pushstring(L,proto->name); |
| 362 | lua_replace(L, 2); |
| 363 | lua_settable(L,1); |
| 364 | |
| 365 | +#if LUA_VERSION_NUM >= 502 |
| 366 | + /* remove the global environment table from the stack */ |
| 367 | + lua_pop(L,1); |
| 368 | +#endif |
| 369 | + |
| 370 | return 0; |
| 371 | } else { |
| 372 | luaL_argerror(L,3,"The initializer of a protocol must be a function"); |
| 373 | @@ -1423,7 +1432,7 @@ static int Proto_newindex(lua_State* L) { |
| 374 | return 0; |
| 375 | } |
| 376 | |
| 377 | -static const luaL_reg Proto_meta[] = { |
| 378 | +static const luaL_Reg Proto_meta[] = { |
| 379 | {"__tostring", Proto_tostring}, |
| 380 | {"__index", Proto_index}, |
| 381 | {"__newindex", Proto_newindex}, |
| 382 | @@ -1437,10 +1446,9 @@ int Proto_register(lua_State* L) { |
| 383 | lua_newtable(L); |
| 384 | protocols_table_ref = luaL_ref(L, LUA_REGISTRYINDEX); |
| 385 | |
| 386 | - lua_pushstring(L, "Proto"); |
| 387 | - lua_pushcfunction(L, Proto_new); |
| 388 | - lua_settable(L, LUA_GLOBALSINDEX); |
| 389 | - |
| 390 | + lua_pushcfunction(L, Proto_new); |
| 391 | + lua_setglobal(L, "Proto"); |
| 392 | + |
| 393 | Pref_register(L); |
| 394 | Prefs_register(L); |
| 395 | |
| 396 | @@ -1539,13 +1547,13 @@ WSLUA_METAMETHOD Dissector_tostring(lua_State* L) { |
| 397 | return 1; |
| 398 | } |
| 399 | |
| 400 | -static const luaL_reg Dissector_methods[] = { |
| 401 | +static const luaL_Reg Dissector_methods[] = { |
| 402 | {"get", Dissector_get }, |
| 403 | {"call", Dissector_call }, |
| 404 | { NULL, NULL } |
| 405 | }; |
| 406 | |
| 407 | -static const luaL_reg Dissector_meta[] = { |
| 408 | +static const luaL_Reg Dissector_meta[] = { |
| 409 | {"__tostring", Dissector_tostring}, |
| 410 | { NULL, NULL } |
| 411 | }; |
| 412 | @@ -1825,7 +1833,7 @@ WSLUA_METAMETHOD DissectorTable_tostring(lua_State* L) { |
| 413 | return 1; |
| 414 | } |
| 415 | |
| 416 | -static const luaL_reg DissectorTable_methods[] = { |
| 417 | +static const luaL_Reg DissectorTable_methods[] = { |
| 418 | {"new", DissectorTable_new }, |
| 419 | {"get", DissectorTable_get }, |
| 420 | {"add", DissectorTable_add }, |
| 421 | @@ -1835,7 +1843,7 @@ static const luaL_reg DissectorTable_methods[] = { |
| 422 | { NULL, NULL } |
| 423 | }; |
| 424 | |
| 425 | -static const luaL_reg DissectorTable_meta[] = { |
| 426 | +static const luaL_Reg DissectorTable_meta[] = { |
| 427 | {"__tostring", DissectorTable_tostring}, |
| 428 | { NULL, NULL } |
| 429 | }; |
| 430 | diff --git epan/wslua/wslua_tree.c epan/wslua/wslua_tree.c |
| 431 | index 88270d3..18592b2 100644 |
| 432 | --- epan/wslua/wslua_tree.c |
| 433 | +++ epan/wslua/wslua_tree.c |
| 434 | @@ -419,7 +419,7 @@ static int TreeItem_gc(lua_State* L) { |
| 435 | return 0; |
| 436 | } |
| 437 | |
| 438 | -static const luaL_reg TreeItem_methods[] = { |
| 439 | +static const luaL_Reg TreeItem_methods[] = { |
| 440 | {"add_packet_field", TreeItem_add_packet_field}, |
| 441 | {"add", TreeItem_add}, |
| 442 | {"add_le", TreeItem_add_le}, |
| 443 | @@ -433,7 +433,7 @@ static const luaL_reg TreeItem_methods[] = { |
| 444 | { NULL, NULL } |
| 445 | }; |
| 446 | |
| 447 | -static const luaL_reg TreeItem_meta[] = { |
| 448 | +static const luaL_Reg TreeItem_meta[] = { |
| 449 | {"__gc", TreeItem_gc}, |
| 450 | { NULL, NULL } |
| 451 | }; |
| 452 | diff --git epan/wslua/wslua_tvb.c epan/wslua/wslua_tvb.c |
| 453 | index 6ba756e..db5f757 100644 |
| 454 | --- epan/wslua/wslua_tvb.c |
| 455 | +++ epan/wslua/wslua_tvb.c |
| 456 | @@ -287,7 +287,7 @@ static int ByteArray_tostring(lua_State* L) { |
| 457 | |
| 458 | static int ByteArray_tvb (lua_State *L); |
| 459 | |
| 460 | -static const luaL_reg ByteArray_methods[] = { |
| 461 | +static const luaL_Reg ByteArray_methods[] = { |
| 462 | {"new", ByteArray_new}, |
| 463 | {"len", ByteArray_len}, |
| 464 | {"prepend", ByteArray_prepend}, |
| 465 | @@ -300,7 +300,7 @@ static const luaL_reg ByteArray_methods[] = { |
| 466 | { NULL, NULL } |
| 467 | }; |
| 468 | |
| 469 | -static const luaL_reg ByteArray_meta[] = { |
| 470 | +static const luaL_Reg ByteArray_meta[] = { |
| 471 | {"__tostring", ByteArray_tostring}, |
| 472 | {"__gc", ByteArray_gc}, |
| 473 | {"__concat", ByteArray__concat}, |
| 474 | @@ -623,7 +623,7 @@ WSLUA_METHOD Tvb_range(lua_State* L) { |
| 475 | return 0; |
| 476 | } |
| 477 | |
| 478 | -static const luaL_reg Tvb_methods[] = { |
| 479 | +static const luaL_Reg Tvb_methods[] = { |
| 480 | {"range", Tvb_range}, |
| 481 | {"len", Tvb_len}, |
| 482 | {"offset", Tvb_offset}, |
| 483 | @@ -632,7 +632,7 @@ static const luaL_reg Tvb_methods[] = { |
| 484 | { NULL, NULL } |
| 485 | }; |
| 486 | |
| 487 | -static const luaL_reg Tvb_meta[] = { |
| 488 | +static const luaL_Reg Tvb_meta[] = { |
| 489 | {"__call", Tvb_range}, |
| 490 | {"__tostring", Tvb__tostring}, |
| 491 | {"__gc", Tvb__gc}, |
| 492 | @@ -1314,7 +1314,7 @@ WSLUA_METAMETHOD TvbRange__tostring(lua_State* L) { |
| 493 | return 1; |
| 494 | } |
| 495 | |
| 496 | -static const luaL_reg TvbRange_methods[] = { |
| 497 | +static const luaL_Reg TvbRange_methods[] = { |
| 498 | {"uint", TvbRange_uint}, |
| 499 | {"le_uint", TvbRange_le_uint}, |
| 500 | {"int", TvbRange_int}, |
| 501 | @@ -1345,7 +1345,7 @@ static const luaL_reg TvbRange_methods[] = { |
| 502 | { NULL, NULL } |
| 503 | }; |
| 504 | |
| 505 | -static const luaL_reg TvbRange_meta[] = { |
| 506 | +static const luaL_Reg TvbRange_meta[] = { |
| 507 | {"__tostring", TvbRange__tostring}, |
| 508 | {"__concat", wslua__concat}, |
| 509 | {"__call", TvbRange_range}, |
| 510 | @@ -1386,11 +1386,11 @@ static int Int64__gc(lua_State* L) { |
| 511 | return 0; |
| 512 | } |
| 513 | |
| 514 | -static const luaL_reg Int64_methods[] = { |
| 515 | +static const luaL_Reg Int64_methods[] = { |
| 516 | { NULL, NULL } |
| 517 | }; |
| 518 | |
| 519 | -static const luaL_reg Int64_meta[] = { |
| 520 | +static const luaL_Reg Int64_meta[] = { |
| 521 | {"__tostring", Int64__tostring}, |
| 522 | {"__concat", wslua__concat}, |
| 523 | {"__gc", Int64__gc}, |
| 524 | @@ -1422,11 +1422,11 @@ static int UInt64__gc(lua_State* L) { |
| 525 | return 0; |
| 526 | } |
| 527 | |
| 528 | -static const luaL_reg UInt64_methods[] = { |
| 529 | +static const luaL_Reg UInt64_methods[] = { |
| 530 | { NULL, NULL } |
| 531 | }; |
| 532 | |
| 533 | -static const luaL_reg UInt64_meta[] = { |
| 534 | +static const luaL_Reg UInt64_meta[] = { |
| 535 | {"__tostring", UInt64__tostring}, |
| 536 | {"__concat", wslua__concat}, |
| 537 | {"__gc", UInt64__gc}, |
| 538 | diff --git epan/wslua/wslua_util.c epan/wslua/wslua_util.c |
| 539 | index 8dd2002..a6f1bf5 100644 |
| 540 | --- epan/wslua/wslua_util.c |
| 541 | +++ epan/wslua/wslua_util.c |
| 542 | @@ -373,13 +373,13 @@ static int wslua_Dir__gc(lua_State* L) { |
| 543 | return 0; |
| 544 | } |
| 545 | |
| 546 | -static const luaL_reg Dir_methods[] = { |
| 547 | +static const luaL_Reg Dir_methods[] = { |
| 548 | {"open", Dir_open}, |
| 549 | {"close", Dir_close}, |
| 550 | { NULL, NULL } |
| 551 | }; |
| 552 | |
| 553 | -static const luaL_reg Dir_meta[] = { |
| 554 | +static const luaL_Reg Dir_meta[] = { |
| 555 | {"__call", Dir__call}, |
| 556 | {"__gc", wslua_Dir__gc}, |
| 557 | { NULL, NULL } |