diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2021-03-20 01:58:26 +0000 |
---|---|---|
committer | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2021-05-19 03:52:45 +0100 |
commit | e10f761362bacaabf89da298cd4f80d88e345ef9 (patch) | |
tree | 7604773b4aa2b53047e79e3e9868c6697db7cb80 | |
parent | 1fe4638648d55d02171d8155d701072f44d63300 (diff) |
wslua: Replace g_assert() with ws_assert()
-rw-r--r-- | epan/wslua/init_wslua.c | 4 | ||||
-rw-r--r-- | epan/wslua/wslua.h | 1 | ||||
-rw-r--r-- | epan/wslua/wslua_file_handler.c | 2 | ||||
-rw-r--r-- | epan/wslua/wslua_gui.c | 6 | ||||
-rw-r--r-- | epan/wslua/wslua_listener.c | 6 | ||||
-rw-r--r-- | epan/wslua/wslua_pref.c | 2 | ||||
-rw-r--r-- | epan/wslua/wslua_proto.c | 6 | ||||
-rw-r--r-- | epan/wslua/wslua_util.c | 2 |
8 files changed, 15 insertions, 14 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index d5ecc499a1..8474c74be1 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -224,7 +224,7 @@ gboolean heur_dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, v lua_tvb = tvb; lua_pinfo = pinfo; - g_assert(tvb && pinfo); + ws_assert(tvb && pinfo); if (!pinfo->heur_list_name || !pinfo->current_proto) { proto_tree_add_expert_format(tree, pinfo, &ei_lua_error, tvb, 0, 0, @@ -797,7 +797,7 @@ wslua_get_expert_field(const int group, const int severity) int i; const ei_register_info *ei = ws_lua_ei; - g_assert(ei); + ws_assert(ei); for (i=0; i < ws_lua_ei_len; i++, ei++) { if (ei->eiinfo.group == group && ei->eiinfo.severity == severity) diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index e7acbe2ec8..df6f666196 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -30,6 +30,7 @@ #include <wsutil/report_message.h> #include <wsutil/nstime.h> +#include <wsutil/ws_assert.h> #include <epan/packet.h> #include <epan/strutil.h> diff --git a/epan/wslua/wslua_file_handler.c b/epan/wslua/wslua_file_handler.c index 37b0955244..8b1fc4698a 100644 --- a/epan/wslua/wslua_file_handler.c +++ b/epan/wslua/wslua_file_handler.c @@ -121,7 +121,7 @@ report_error(int *err, gchar **err_info, const char *fmt, ...) report_error(err, err_info, "Error in garbage collector while calling FileHandler %s routine", name); \ break; \ default: \ - g_assert_not_reached(); \ + ws_assert_not_reached(); \ break; /* some declarations */ diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c index 32a2e54363..4898520fd0 100644 --- a/epan/wslua/wslua_gui.c +++ b/epan/wslua/wslua_gui.c @@ -57,7 +57,7 @@ static void lua_menu_callback(gpointer data) { g_warning("Error while running the error handler function for menu callback"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } @@ -160,7 +160,7 @@ static void lua_dialog_cb(gchar** user_input, void* data) { g_warning("Error while running the error handler function for dialog callback"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } @@ -774,7 +774,7 @@ static gboolean wslua_button_callback(funnel_text_window_t* ws_tw, void* data) { g_warning("Error while running the error handler function for button callback"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c index 236bd61201..f4e0ad2b1b 100644 --- a/epan/wslua/wslua_listener.c +++ b/epan/wslua/wslua_listener.c @@ -108,7 +108,7 @@ static tap_packet_status lua_tap_packet(void *tapdata, packet_info *pinfo, epan_ g_warning("Error while running the error handler function for listener tap callback"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } @@ -150,7 +150,7 @@ static void lua_tap_reset(void *tapdata) { g_warning("Error while running the error handler function for a listener's init()"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } } @@ -185,7 +185,7 @@ static void lua_tap_draw(void *tapdata) { g_warning("Error while running the error handler function for a listener's draw()"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } } diff --git a/epan/wslua/wslua_pref.c b/epan/wslua/wslua_pref.c index 550633fc0c..234170d3d6 100644 --- a/epan/wslua/wslua_pref.c +++ b/epan/wslua/wslua_pref.c @@ -152,7 +152,7 @@ static int new_pref(lua_State* L, pref_type_t type) { break; } default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index e857b2b4ca..52fc03b6c5 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -233,7 +233,7 @@ WSLUA_METHOD Proto_register_heuristic(lua_State* L) { Proto proto = checkProto(L,1); const gchar *listname = luaL_checkstring(L, WSLUA_ARG_Proto_register_heuristic_LISTNAME); const gchar *proto_name = proto->name; - const int top = lua_gettop(L); + const int top _U_ = lua_gettop(L); gchar *short_name; if (!proto_name || proto->hfid == -1) { @@ -278,7 +278,7 @@ WSLUA_METHOD Proto_register_heuristic(lua_State* L) { lua_replace(L, WSLUA_ARG_Proto_register_heuristic_FUNC); /* pop the lua_dissectors_table */ lua_pop(L, 1); - g_assert(top == lua_gettop(L)); + ws_assert(top == lua_gettop(L)); } /* heuristic functions are stored in a table in the registry; the registry has a @@ -314,7 +314,7 @@ WSLUA_METHOD Proto_register_heuristic(lua_State* L) { /* ok, we're done with lua stuff, pop what we added to the stack */ lua_pop(L,2); /* pop the lists table and the listname table */ - g_assert(top == lua_gettop(L)); + ws_assert(top == lua_gettop(L)); short_name = wmem_strconcat(NULL, proto->loname, "_", listname, NULL); diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c index d26b59cab3..8e4c2afb44 100644 --- a/epan/wslua/wslua_util.c +++ b/epan/wslua/wslua_util.c @@ -501,7 +501,7 @@ static void statcmd_init(const char *opt_arg, void* userdata) { g_warning("Error while running the error handler function for statcmd callback"); break; default: - g_assert_not_reached(); + ws_assert_not_reached(); break; } |