diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-26 09:54:46 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-07-26 17:15:26 +0000 |
commit | 9bfbffa1c8a54053ee73fc3c55330e70c0e79e81 (patch) | |
tree | a90d7ac71658a66cf21083f735d28a6841569755 /epan/wslua | |
parent | 4713ce4476cadb2d4a8869dd2e6f19547841aa9a (diff) |
Use ws_g_warning in wslua.
The g_warning calls seem legitimate, so "hide" them from checkAPIs.pl.
Change-Id: I6d25b08e22aeeb0244e07836385f2b67d6261546
Reviewed-on: https://code.wireshark.org/review/16703
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_file.c | 9 | ||||
-rw-r--r-- | epan/wslua/wslua_file_handler.c | 36 | ||||
-rw-r--r-- | epan/wslua/wslua_frame_info.c | 5 | ||||
-rw-r--r-- | epan/wslua/wslua_gui.c | 17 | ||||
-rw-r--r-- | epan/wslua/wslua_listener.c | 11 | ||||
-rw-r--r-- | epan/wslua/wslua_util.c | 5 |
6 files changed, 44 insertions, 39 deletions
diff --git a/epan/wslua/wslua_file.c b/epan/wslua/wslua_file.c index 508b8544df..51fd712b0e 100644 --- a/epan/wslua/wslua_file.c +++ b/epan/wslua/wslua_file.c @@ -29,6 +29,7 @@ #include <errno.h> #include <wiretap/file_wrappers.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #define MAX_LINE_LENGTH 65536 @@ -277,12 +278,12 @@ WSLUA_METHOD File_read(lua_State* L) { /* shiftFile() doesn't verify things like expired */ if (f->expired) { - g_warning("Error in File read: Lua File has expired"); + ws_g_warning("Error in File read: Lua File has expired"); return 0; } if (!file_is_reader(f)) { - g_warning("Error in File read: this File object instance is for writing only"); + ws_g_warning("Error in File read: this File object instance is for writing only"); return 0; } @@ -399,7 +400,7 @@ WSLUA_METHOD File_lines(lua_State* L) { return luaL_error(L, "Error getting File handle for lines"); if (!file_is_reader(f)) { - g_warning("Error in File read: this File object instance is for writing only"); + ws_g_warning("Error in File read: this File object instance is for writing only"); return 0; } @@ -421,7 +422,7 @@ WSLUA_METHOD File_write(lua_State* L) { int err = 0; if (!f->wdh) { - g_warning("Error in File read: this File object instance is for reading only"); + ws_g_warning("Error in File read: this File object instance is for reading only"); return 0; } diff --git a/epan/wslua/wslua_file_handler.c b/epan/wslua/wslua_file_handler.c index 35861036b0..6c0432c254 100644 --- a/epan/wslua/wslua_file_handler.c +++ b/epan/wslua/wslua_file_handler.c @@ -26,7 +26,7 @@ */ #include "wslua_file_common.h" - +#include <wsutil/ws_printf.h> /* ws_g_warning */ /* WSLUA_CONTINUE_MODULE File */ @@ -63,19 +63,19 @@ static gboolean in_routine = FALSE; /* This does the verification and setup common to all open/read/seek_read/close routines */ #define INIT_FILEHANDLER_ROUTINE(name,retval) \ if (!fh) { \ - g_warning("Error in file %s: no Lua FileHandler object", #name); \ + ws_g_warning("Error in file %s: no Lua FileHandler object", #name); \ return retval; \ } \ if (!fh->registered) { \ - g_warning("Error in file %s: Lua FileHandler is not registered", #name); \ + ws_g_warning("Error in file %s: Lua FileHandler is not registered", #name); \ return retval; \ } \ if (!fh->L) { \ - g_warning("Error in file %s: no FileHandler Lua state", #name); \ + ws_g_warning("Error in file %s: no FileHandler Lua state", #name); \ return retval; \ } \ if (fh->name##_ref == LUA_NOREF) { \ - g_warning("Error in file %s: no FileHandler %s routine reference", #name, #name); \ + ws_g_warning("Error in file %s: no FileHandler %s routine reference", #name, #name); \ return retval; \ } \ L = fh->L; \ @@ -83,7 +83,7 @@ static gboolean in_routine = FALSE; push_error_handler(L, #name " routine"); \ lua_rawgeti(L, LUA_REGISTRYINDEX, fh->name##_ref); \ if (!lua_isfunction(L, -1)) { \ - g_warning("Error in file %s: no FileHandler %s routine function in Lua", #name, #name); \ + ws_g_warning("Error in file %s: no FileHandler %s routine function in Lua", #name, #name); \ return retval; \ } \ /* now guard against de-registering during pcall() */ \ @@ -101,16 +101,16 @@ static gboolean in_routine = FALSE; #define CASE_ERROR(name) \ case LUA_ERRRUN: \ - g_warning("Run-time error while calling FileHandler %s routine", name); \ + ws_g_warning("Run-time error while calling FileHandler %s routine", name); \ break; \ case LUA_ERRMEM: \ - g_warning("Memory alloc error while calling FileHandler %s routine", name); \ + ws_g_warning("Memory alloc error while calling FileHandler %s routine", name); \ break; \ case LUA_ERRERR: \ - g_warning("Error in error handling while calling FileHandler %s routine", name); \ + ws_g_warning("Error in error handling while calling FileHandler %s routine", name); \ break; \ case LUA_ERRGCMM: \ - g_warning("Error in garbage collector while calling FileHandler %s routine", name); \ + ws_g_warning("Error in garbage collector while calling FileHandler %s routine", name); \ break; \ default: \ g_assert_not_reached(); \ @@ -118,19 +118,19 @@ static gboolean in_routine = FALSE; #define CASE_ERROR_ERRINFO(name) \ case LUA_ERRRUN: \ - g_warning("Run-time error while calling FileHandler %s routine", name); \ + ws_g_warning("Run-time error while calling FileHandler %s routine", name); \ *err_info = g_strdup_printf("Run-time error while calling FileHandler %s routine", name); \ break; \ case LUA_ERRMEM: \ - g_warning("Memory alloc error while calling FileHandler %s routine", name); \ + ws_g_warning("Memory alloc error while calling FileHandler %s routine", name); \ *err_info = g_strdup_printf("Memory alloc error while calling FileHandler %s routine", name); \ break; \ case LUA_ERRERR: \ - g_warning("Error in error handling while calling FileHandler %s routine", name); \ + ws_g_warning("Error in error handling while calling FileHandler %s routine", name); \ *err_info = g_strdup_printf("Error in error handling while calling FileHandler %s routine", name); \ break; \ case LUA_ERRGCMM: \ - g_warning("Error in garbage collector while calling FileHandler %s routine", name); \ + ws_g_warning("Error in garbage collector while calling FileHandler %s routine", name); \ *err_info = g_strdup_printf("Error in garbage collector while calling FileHandler %s routine", name); \ break; \ default: \ @@ -199,7 +199,7 @@ wslua_filehandler_open(wtap *wth, int *err, gchar **err_info) wth->subtype_read = wslua_filehandler_read; } else { - g_warning("Lua file format module lacks a read routine"); + ws_g_warning("Lua file format module lacks a read routine"); return WTAP_OPEN_NOT_MINE; } @@ -207,7 +207,7 @@ wslua_filehandler_open(wtap *wth, int *err, gchar **err_info) wth->subtype_seek_read = wslua_filehandler_seek_read; } else { - g_warning("Lua file format module lacks a seek-read routine"); + ws_g_warning("Lua file format module lacks a seek-read routine"); return WTAP_OPEN_NOT_MINE; } @@ -237,7 +237,7 @@ wslua_filehandler_open(wtap *wth, int *err, gchar **err_info) } else { /* not a valid return type */ - g_warning("FileHandler read_open routine returned %d", retval); + ws_g_warning("FileHandler read_open routine returned %d", retval); if (err) { *err = WTAP_ERR_INTERNAL; } @@ -510,7 +510,7 @@ wslua_filehandler_dump_open(wtap_dumper *wdh, int *err) wdh->subtype_write = wslua_filehandler_dump; } else { - g_warning("FileHandler was not set with a write function, even though write_open() returned true"); + ws_g_warning("FileHandler was not set with a write function, even though write_open() returned true"); return 0; } diff --git a/epan/wslua/wslua_frame_info.c b/epan/wslua/wslua_frame_info.c index 1cebd4d5b2..0918505933 100644 --- a/epan/wslua/wslua_frame_info.c +++ b/epan/wslua/wslua_frame_info.c @@ -26,6 +26,7 @@ */ #include "wslua_file_common.h" +#include <wsutil/ws_printf.h> /* ws_g_warning */ /* WSLUA_CONTINUE_MODULE File */ @@ -154,12 +155,12 @@ static int FrameInfo_set_data (lua_State* L) { FrameInfo fi = checkFrameInfo(L,1); if (!fi->phdr) { - g_warning("Error in FrameInfo set data: NULL pointer"); + ws_g_warning("Error in FrameInfo set data: NULL pointer"); return 0; } if (!fi->buf) { - g_warning("Error in FrameInfo set data: NULL frame_buffer pointer"); + ws_g_warning("Error in FrameInfo set data: NULL frame_buffer pointer"); return 0; } diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c index 7732e4e235..e1c8d019f6 100644 --- a/epan/wslua/wslua_gui.c +++ b/epan/wslua/wslua_gui.c @@ -25,6 +25,7 @@ #include "config.h" #include <epan/wmem/wmem.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #include "wslua.h" @@ -60,10 +61,10 @@ static void lua_menu_callback(gpointer data) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error while calling menu callback"); + ws_g_warning("Runtime error while calling menu callback"); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling menu callback"); + ws_g_warning("Memory alloc error while calling menu callback"); break; default: g_assert_not_reached(); @@ -157,10 +158,10 @@ static void lua_dialog_cb(gchar** user_input, void* data) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error while calling dialog callback"); + ws_g_warning("Runtime error while calling dialog callback"); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling dialog callback"); + ws_g_warning("Memory alloc error while calling dialog callback"); break; default: g_assert_not_reached(); @@ -196,10 +197,10 @@ static void text_win_close_cb(void* data) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error during execution of TextWindow close callback"); + ws_g_warning("Runtime error during execution of TextWindow close callback"); break; case LUA_ERRMEM: - g_warning("Memory alloc error during execution of TextWindow close callback"); + ws_g_warning("Memory alloc error during execution of TextWindow close callback"); break; default: break; @@ -623,10 +624,10 @@ static gboolean wslua_button_callback(funnel_text_window_t* ws_tw, void* data) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error while calling button callback"); + ws_g_warning("Runtime error while calling button callback"); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling button callback"); + ws_g_warning("Memory alloc error while calling button callback"); break; default: g_assert_not_reached(); diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c index 85caa7316c..606d8dddfa 100644 --- a/epan/wslua/wslua_listener.c +++ b/epan/wslua/wslua_listener.c @@ -31,6 +31,7 @@ /* WSLUA_MODULE Listener Post-dissection packet analysis */ #include "wslua.h" +#include <wsutil/ws_printf.h> /* ws_g_warning */ WSLUA_CLASS_DEFINE(Listener,FAIL_ON_NULL("Listener")); /* @@ -111,7 +112,7 @@ static gboolean lua_tap_packet(void *tapdata, packet_info *pinfo, epan_dissect_t case LUA_ERRRUN: break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling listener tap callback packet"); + ws_g_warning("Memory alloc error while calling listener tap callback packet"); break; default: g_assert_not_reached(); @@ -146,10 +147,10 @@ static void lua_tap_reset(void *tapdata) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error while calling a listener's init()"); + ws_g_warning("Runtime error while calling a listener's init()"); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling a listener's init()"); + ws_g_warning("Memory alloc error while calling a listener's init()"); break; default: g_assert_not_reached(); @@ -171,10 +172,10 @@ static void lua_tap_draw(void *tapdata) { break; case LUA_ERRRUN: error = lua_tostring(tap->L,-1); - g_warning("Runtime error while calling a listener's draw(): %s",error); + ws_g_warning("Runtime error while calling a listener's draw(): %s",error); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling a listener's draw()"); + ws_g_warning("Memory alloc error while calling a listener's draw()"); break; default: g_assert_not_reached(); diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c index f056960747..644106a89d 100644 --- a/epan/wslua/wslua_util.c +++ b/epan/wslua/wslua_util.c @@ -29,6 +29,7 @@ #include "wslua.h" #include <math.h> #include <epan/stat_tap_ui.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ WSLUA_FUNCTION wslua_get_version(lua_State* L) { /* Gets a string of the Wireshark version. */ @@ -316,10 +317,10 @@ static void statcmd_init(const char *opt_arg, void* userdata) { case 0: break; case LUA_ERRRUN: - g_warning("Runtime error while calling statcmd callback"); + ws_g_warning("Runtime error while calling statcmd callback"); break; case LUA_ERRMEM: - g_warning("Memory alloc error while calling statcmd callback"); + ws_g_warning("Memory alloc error while calling statcmd callback"); break; default: g_assert_not_reached(); |