diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-24 08:53:39 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-25 04:26:50 +0000 |
commit | 1da1f945e2988080add4923dc2021753e3b2f7c1 (patch) | |
tree | 2839b66064e34ba99a6d031778330f20497b5e93 /epan/wslua | |
parent | ee7f9c33f63532bc69899a0750177756be53c0c1 (diff) |
Fix checkAPI.pl warnings about printf
Many of the complaints from checkAPI.pl for use of printf are when its embedded
in an #ifdef and checkAPI isn't smart enough to figure that out.
The other (non-ifdef) use is dumping internal structures (which is a type of
debug functionality)
Add a "ws_debug_printf" macro for printf to pacify the warnings.
Change-Id: I63610e1adbbaf2feffb4ec9d4f817247d833f7fd
Reviewed-on: https://code.wireshark.org/review/16623
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/init_wslua.c | 3 | ||||
-rw-r--r-- | epan/wslua/wslua_internals.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index cd71e2a5d6..dd57474377 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -34,6 +34,7 @@ #include <epan/ex-opt.h> #include <wsutil/privileges.h> #include <wsutil/file_util.h> +#include <wsutil/ws_printf.h> /* ws_debug_printf */ /* linked list of Lua plugins */ typedef struct _wslua_plugin { @@ -689,7 +690,7 @@ print_wslua_plugin_description(const char *name, const char *version, const char *description, const char *filename, void *user_data _U_) { - printf("%s\t%s\t%s\t%s\n", name, version, description, filename); + ws_debug_printf("%s\t%s\t%s\t%s\n", name, version, description, filename); } void diff --git a/epan/wslua/wslua_internals.c b/epan/wslua/wslua_internals.c index 53c57f8ec8..782d5bae68 100644 --- a/epan/wslua/wslua_internals.c +++ b/epan/wslua/wslua_internals.c @@ -28,6 +28,7 @@ #include "config.h" #include "wslua.h" +#include <wsutil/ws_printf.h> /* ws_debug_printf */ WSLUA_API int wslua__concat(lua_State* L) { /* Concatenate two objects to a string */ @@ -180,9 +181,9 @@ WSLUA_API void wslua_print_stack(char* s, lua_State* L) { int i; for (i=1;i<=lua_gettop(L);i++) { - printf("%s-%i: %s\n",s,i,lua_typename (L,lua_type(L, i))); + ws_debug_printf("%s-%i: %s\n",s,i,lua_typename (L,lua_type(L, i))); } - printf("\n"); + ws_debug_printf("\n"); } /* C-code function equivalent of the typeof() function we created in Lua. |