summaryrefslogtreecommitdiff
path: root/epan/dfilter/dfilter-macro.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-24 08:53:39 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-25 04:26:50 +0000
commit1da1f945e2988080add4923dc2021753e3b2f7c1 (patch)
tree2839b66064e34ba99a6d031778330f20497b5e93 /epan/dfilter/dfilter-macro.c
parentee7f9c33f63532bc69899a0750177756be53c0c1 (diff)
downloadwireshark-1da1f945e2988080add4923dc2021753e3b2f7c1.tar.gz
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/dfilter/dfilter-macro.c')
-rw-r--r--epan/dfilter/dfilter-macro.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index 74c90e0f04..18f7b968f7 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -24,6 +24,7 @@
#ifdef DUMP_DFILTER_MACRO
#include <stdio.h>
+#include <wsutil/ws_printf.h> /* ws_debug_printf */
#endif
#include <string.h>
@@ -620,69 +621,69 @@ void dfilter_macro_get_uat(uat_t **dfmu_ptr_ptr) {
void dump_dfilter_macro_t(const dfilter_macro_t *m, const char *function, const char *file, int line)
{
- printf("\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
+ ws_debug_printf("\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
if(m == NULL) {
- printf(" dfilter_macro_t * == NULL! (via: %s(): %s:%d)\n", function, file, line);
- printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
+ ws_debug_printf(" dfilter_macro_t * == NULL! (via: %s(): %s:%d)\n", function, file, line);
+ ws_debug_printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
}
- printf("DUMP of dfilter_macro_t: %p (via: %s(): %s:%d)\n", m, function, file, line);
+ ws_debug_printf("DUMP of dfilter_macro_t: %p (via: %s(): %s:%d)\n", m, function, file, line);
- printf(" &dfilter_macro->name == %p\n", &m->name);
+ ws_debug_printf(" &dfilter_macro->name == %p\n", &m->name);
if(m->name == NULL) {
- printf(" ->name == NULL\n");
+ ws_debug_printf(" ->name == NULL\n");
} else {
- printf(" ->name == %p\n", m->name);
- printf(" ->name == <%s>\n", m->name);
+ ws_debug_printf(" ->name == %p\n", m->name);
+ ws_debug_printf(" ->name == <%s>\n", m->name);
}
- printf(" &dfilter_macro->text == %p\n", &m->text);
+ ws_debug_printf(" &dfilter_macro->text == %p\n", &m->text);
if(m->text == NULL) {
- printf(" ->text == NULL\n");
+ ws_debug_printf(" ->text == NULL\n");
} else {
- printf(" ->text == %p\n", m->text);
- printf(" ->text == <%s>\n", m->text);
+ ws_debug_printf(" ->text == %p\n", m->text);
+ ws_debug_printf(" ->text == <%s>\n", m->text);
}
- printf(" &dfilter_macro->usable == %p\n", &m->usable);
- printf(" ->usable == %u\n", m->usable);
+ ws_debug_printf(" &dfilter_macro->usable == %p\n", &m->usable);
+ ws_debug_printf(" ->usable == %u\n", m->usable);
- printf(" &dfilter_macro->parts == %p\n", &m->parts);
+ ws_debug_printf(" &dfilter_macro->parts == %p\n", &m->parts);
if(m->parts == NULL) {
- printf(" ->parts == NULL\n");
+ ws_debug_printf(" ->parts == NULL\n");
} else {
int i = 0;
while (m->parts[i]) {
- printf(" ->parts[%d] == %p\n", i, m->parts[i]);
- printf(" ->parts[%d] == <%s>\n", i, m->parts[i]);
+ ws_debug_printf(" ->parts[%d] == %p\n", i, m->parts[i]);
+ ws_debug_printf(" ->parts[%d] == <%s>\n", i, m->parts[i]);
i++;
}
- printf(" ->parts[%d] == NULL\n", i);
+ ws_debug_printf(" ->parts[%d] == NULL\n", i);
}
- printf(" &dfilter_macro->args_pos == %p\n", &m->args_pos);
+ ws_debug_printf(" &dfilter_macro->args_pos == %p\n", &m->args_pos);
if(m->args_pos == NULL) {
- printf(" ->args_pos == NULL\n");
+ ws_debug_printf(" ->args_pos == NULL\n");
} else {
- printf(" ->args_pos == %p\n", m->args_pos);
- /*printf(" ->args_pos == <%?>\n", m->args_pos);*/
+ ws_debug_printf(" ->args_pos == %p\n", m->args_pos);
+ /*ws_debug_printf(" ->args_pos == <%?>\n", m->args_pos);*/
}
- printf(" &dfilter_macro->argc == %p\n", &m->argc);
- printf(" ->argc == %d\n", m->argc);
+ ws_debug_printf(" &dfilter_macro->argc == %p\n", &m->argc);
+ ws_debug_printf(" ->argc == %d\n", m->argc);
- printf(" &dfilter_macro->priv == %p\n", &m->priv);
+ ws_debug_printf(" &dfilter_macro->priv == %p\n", &m->priv);
if(m->priv == NULL) {
- printf(" ->priv == NULL\n");
+ ws_debug_printf(" ->priv == NULL\n");
} else {
- printf(" ->priv == %p\n", m->priv);
- printf(" ->priv == <%s>\n", (char *)m->priv);
+ ws_debug_printf(" ->priv == %p\n", m->priv);
+ ws_debug_printf(" ->priv == <%s>\n", (char *)m->priv);
}
- printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
+ ws_debug_printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
}
#endif