From 1da1f945e2988080add4923dc2021753e3b2f7c1 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 24 Jul 2016 08:53:39 -0400 Subject: 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 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-tacacs.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'epan/dissectors/packet-tacacs.c') diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c index 5054f90126..bf40af19c3 100644 --- a/epan/dissectors/packet-tacacs.c +++ b/epan/dissectors/packet-tacacs.c @@ -39,6 +39,7 @@ #include #include #include +#include /* ws_debug_printf */ #include "packet-tacacs.h" @@ -749,9 +750,9 @@ tacplus_print_key_entry( gpointer data, gpointer user_data ) s_str = address_to_str( NULL, tacplus_data->s ); c_str = address_to_str( NULL, tacplus_data->c ); if( user_data ) { - printf("%s:%s=%s\n", s_str, c_str, tacplus_data->k ); + ws_debug_printf("%s:%s=%s\n", s_str, c_str, tacplus_data->k ); } else { - printf("%s:%s\n", s_str, c_str ); + ws_debug_printf("%s:%s\n", s_str, c_str ); } wmem_free(NULL, s_str); wmem_free(NULL, c_str); @@ -764,9 +765,9 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 ) const tacplus_key_entry *a2=(const tacplus_key_entry *)p2; gint32 ret; /* - printf("p1=>"); + ws_debug_printf("p1=>"); tacplus_print_key_entry( p1, NULL ); - printf("p2=>"); + ws_debug_printf("p2=>"); tacplus_print_key_entry( p2, NULL ); */ ret=cmp_address( a1->s, a2->s ); @@ -774,9 +775,9 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 ) ret=cmp_address( a1->c, a2->c ); /* if(ret) - printf("No Client found!"); */ + ws_debug_printf("No Client found!"); */ } else { - /* printf("No Server found!"); */ + /* ws_debug_printf("No Server found!"); */ } return ret; } @@ -789,10 +790,10 @@ find_key( address *srv, address *cln ) data.s=srv; data.c=cln; -/* printf("Looking for: "); +/* ws_debug_printf("Looking for: "); tacplus_print_key_entry( (gconstpointer)&data, NULL ); */ match=g_slist_find_custom( tacplus_keys, (gpointer)&data, cmp_conv_address ); -/* printf("Finished (%p)\n", match); */ +/* ws_debug_printf("Finished (%p)\n", match); */ if( match ) return ((tacplus_key_entry*)match->data)->k; @@ -819,7 +820,7 @@ parse_tuple( char *key_from_option ) char *client,*key; tacplus_key_entry *tacplus_data=(tacplus_key_entry *)g_malloc( sizeof(tacplus_key_entry) ); /* - printf("keys: %s\n", key_from_option ); + ws_debug_printf("keys: %s\n", key_from_option ); */ client=strchr(key_from_option,'/'); if(!client) { @@ -834,7 +835,7 @@ parse_tuple( char *key_from_option ) } *key++='\0'; /* - printf("%s %s => %s\n", key_from_option, client, key ); + ws_debug_printf("%s %s => %s\n", key_from_option, client, key ); */ mkipv4_address( &tacplus_data->s, key_from_option ); mkipv4_address( &tacplus_data->c, client ); -- cgit v1.2.3