diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-25 22:58:09 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-26 04:08:50 +0000 |
commit | 907d49483d24698013fcdaec15b78a149751eecb (patch) | |
tree | 001c978c947dd64932fd2d9749cfc46756ac30dc | |
parent | 6fbaf9be34e8745b2781294afdcf2822528a6349 (diff) | |
download | wireshark-907d49483d24698013fcdaec15b78a149751eecb.tar.gz |
Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning
2. Use proto_tree_add_debug_text
3. Comment some out
Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5
Reviewed-on: https://code.wireshark.org/review/16678
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>
-rw-r--r-- | epan/color_filters.c | 3 | ||||
-rw-r--r-- | epan/disabled_protos.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-rlc.c | 6 | ||||
-rw-r--r-- | epan/epan.c | 3 | ||||
-rw-r--r-- | epan/prefs.c | 21 | ||||
-rw-r--r-- | epan/proto.c | 6 | ||||
-rw-r--r-- | epan/show_exception.c | 3 | ||||
-rw-r--r-- | epan/tap.c | 3 | ||||
-rw-r--r-- | epan/tvbparse.c | 91 | ||||
-rw-r--r-- | epan/value_string.c | 5 | ||||
-rw-r--r-- | plugins/mate/mate_util.c | 5 | ||||
-rw-r--r-- | plugins/mate/packet-mate.c | 3 | ||||
-rw-r--r-- | plugins/profinet/packet-dcom-cba-acco.c | 13 | ||||
-rw-r--r-- | wiretap/nettrace_3gpp_32_423.c | 20 | ||||
-rw-r--r-- | wsutil/ws_printf.h | 5 |
15 files changed, 106 insertions, 90 deletions
diff --git a/epan/color_filters.c b/epan/color_filters.c index 5dc1fd4cd7..d3e329b94c 100644 --- a/epan/color_filters.c +++ b/epan/color_filters.c @@ -33,6 +33,7 @@ #include <wsutil/filesystem.h> #include <wsutil/file_util.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #include <epan/packet.h> #include "color_filters.h" @@ -621,7 +622,7 @@ read_filters_file(FILE *f, gpointer user_data, color_filter_add_cb_func add_cb) gchar *local_err_msg = NULL; if (!dfilter_compile(filter_exp, &temp_dfilter, &local_err_msg)) { - g_warning("Could not compile \"%s\" in colorfilters file.\n%s", + ws_g_warning("Could not compile \"%s\" in colorfilters file.\n%s", name, local_err_msg); g_free(local_err_msg); prefs.unknown_colorfilters = TRUE; diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c index c0492602a9..38aef4c1c7 100644 --- a/epan/disabled_protos.c +++ b/epan/disabled_protos.c @@ -34,6 +34,7 @@ #include "disabled_protos.h" #include <wsutil/file_util.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #define PROTOCOLS_FILE_NAME "disabled_protos" #define HEURISTICS_FILE_NAME "heuristic_protos" @@ -256,7 +257,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff, if (c != EOF && c != '\n' && c != '#') { /* Non-white-space after the protocol name; warn about it, in case we come up with a reason to use it. */ - g_warning("'%s' line %d has extra stuff after the protocol name.", + ws_g_warning("'%s' line %d has extra stuff after the protocol name.", ff_path, line); } } @@ -271,7 +272,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff, goto error; /* I/O error */ else { /* EOF, not error; no newline seen before EOF */ - g_warning("'%s' line %d doesn't have a newline.", ff_path, + ws_g_warning("'%s' line %d doesn't have a newline.", ff_path, line); } break; /* nothing more to read */ @@ -581,7 +582,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff, if (c != EOF && c != '\n' && c != '#') { /* Non-white-space after the protocol name; warn about it, in case we come up with a reason to use it. */ - g_warning("'%s' line %d has extra stuff after the protocol name.", + ws_g_warning("'%s' line %d has extra stuff after the protocol name.", ff_path, line); } } @@ -596,7 +597,7 @@ read_disabled_heur_dissector_list_file(const char *ff_path, FILE *ff, goto error; /* I/O error */ else { /* EOF, not error; no newline seen before EOF */ - g_warning("'%s' line %d doesn't have a newline.", ff_path, + ws_g_warning("'%s' line %d doesn't have a newline.", ff_path, line); } break; /* nothing more to read */ diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c index 6d43b0cfd8..037ca6010c 100644 --- a/epan/dissectors/packet-rlc.c +++ b/epan/dissectors/packet-rlc.c @@ -1120,7 +1120,7 @@ add_fragment(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, gint16 end = GPOINTER_TO_INT(endlist->list->next->data); if (frags[end] == NULL) { #if RLC_ADD_FRAGMENT_FAIL_PRINT - g_warning("frag[end] is null, this is probably because end was a startpoint but because of some error ended up being treated as an endpoint, setting fail flag, start %d, end %d, packet %u\n", start, end, pinfo->num); + proto_tree_add_debug_text(tree, "frag[end] is null, this is probably because end was a startpoint but because of some error ended up being treated as an endpoint, setting fail flag, start %d, end %d, packet %u\n", start, end, pinfo->num); #endif endlist->fail_packet = pinfo->num; return NULL; @@ -1154,7 +1154,7 @@ add_fragment(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, if (frags[start] == NULL) { if (MIN((start-seq+snmod)%snmod, (seq-start+snmod)%snmod) >= snmod/4) { #if RLC_ADD_FRAGMENT_FAIL_PRINT - g_warning( + proto_tree_add_debug_text(tree, "Packet %u. Setting fail flag because RLC fragment with sequence number %u was \ too far away from an unfinished sequence (%u->%u). The missing sequence number \ is %u. The most recently complete sequence ended in packet %u.", pinfo->num, seq, 0, end, start, 0); @@ -1173,7 +1173,7 @@ is %u. The most recently complete sequence ended in packet %u.", pinfo->num, seq * this endpoint is too large, set fail flag. */ if (MIN((first-seq+snmod)%snmod, (seq-first+snmod)%snmod) >= snmod/4) { #if RLC_ADD_FRAGMENT_FAIL_PRINT - g_warning( + proto_tree_add_debug_text(tree, "Packet %u. Setting fail flag because RLC fragment with sequence number %u was \ too far away from an unfinished sequence with start %u and without end.", pinfo->num, seq, first); #endif diff --git a/epan/epan.c b/epan/epan.c index 0927172570..c40ee9a08d 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -24,6 +24,7 @@ #include <stdarg.h> #include <wsutil/wsgcrypt.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #ifdef HAVE_LIBGNUTLS #include <gnutls/gnutls.h> @@ -222,7 +223,7 @@ epan_get_frame_ts(const epan_t *session, guint32 frame_num) abs_ts = session->get_frame_ts(session->data, frame_num); if (!abs_ts) - g_warning("!!! couldn't get frame ts for %u !!!\n", frame_num); + ws_g_warning("!!! couldn't get frame ts for %u !!!\n", frame_num); return abs_ts; } diff --git a/epan/prefs.c b/epan/prefs.c index 21496ae10b..69b649e36e 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -43,6 +43,7 @@ #include <epan/column.h> #include "print.h" #include <wsutil/file_util.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #include <epan/prefs-int.h> #include <epan/uat-int.h> @@ -3494,7 +3495,7 @@ read_prefs_file(const char *pf_path, FILE *pf, * If the pref has a trailing comma, eliminate it. */ cur_val->str[cur_val->len-1] = '\0'; - g_warning ("%s line %d: trailing comma in \"%s\" %s", pf_path, pline, cur_var->str, hint); + ws_g_warning ("%s line %d: trailing comma in \"%s\" %s", pf_path, pline, cur_var->str, hint); } } /* Call the routine to set the preference; it will parse @@ -3510,7 +3511,7 @@ read_prefs_file(const char *pf_path, FILE *pf, break; case PREFS_SET_SYNTAX_ERR: - g_warning ("Syntax error in preference \"%s\" at line %d of\n%s %s", + ws_g_warning ("Syntax error in preference \"%s\" at line %d of\n%s %s", cur_var->str, pline, pf_path, hint); break; @@ -3520,7 +3521,7 @@ read_prefs_file(const char *pf_path, FILE *pf, * on non-Win32 platforms. */ if (strcmp(cur_var->str, "print.command") != 0) - g_warning ("No such preference \"%s\" at line %d of\n%s %s", + ws_g_warning ("No such preference \"%s\" at line %d of\n%s %s", cur_var->str, pline, pf_path, hint); prefs.unknown_prefs = TRUE; break; @@ -3533,13 +3534,13 @@ read_prefs_file(const char *pf_path, FILE *pf, The prefs in question need to be listed in the console window so that the user can make an informed choice. */ - g_warning ("Obsolete preference \"%s\" at line %d of\n%s %s", + ws_g_warning ("Obsolete preference \"%s\" at line %d of\n%s %s", cur_var->str, pline, pf_path, hint); prefs.unknown_prefs = TRUE; break; } } else { - g_warning ("Incomplete preference at line %d: of\n%s %s", pline, pf_path, hint); + ws_g_warning ("Incomplete preference at line %d: of\n%s %s", pline, pf_path, hint); } } state = IN_VAR; @@ -3552,7 +3553,7 @@ read_prefs_file(const char *pf_path, FILE *pf, } else if (got_c == '#') { state = IN_SKIP; } else { - g_warning ("Malformed preference at line %d of\n%s %s", fline, pf_path, hint); + ws_g_warning ("Malformed preference at line %d of\n%s %s", fline, pf_path, hint); } break; case IN_VAR: @@ -3597,12 +3598,12 @@ read_prefs_file(const char *pf_path, FILE *pf, break; case PREFS_SET_SYNTAX_ERR: - g_warning ("Syntax error in preference %s at line %d of\n%s %s", + ws_g_warning ("Syntax error in preference %s at line %d of\n%s %s", cur_var->str, pline, pf_path, hint); break; case PREFS_SET_NO_SUCH_PREF: - g_warning ("No such preference \"%s\" at line %d of\n%s %s", + ws_g_warning ("No such preference \"%s\" at line %d of\n%s %s", cur_var->str, pline, pf_path, hint); prefs.unknown_prefs = TRUE; break; @@ -3612,7 +3613,7 @@ read_prefs_file(const char *pf_path, FILE *pf, break; } } else { - g_warning ("Incomplete preference at line %d of\n%s %s", + ws_g_warning("Incomplete preference at line %d of\n%s %s", pline, pf_path, hint); } } @@ -4148,7 +4149,7 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_, return PREFS_SET_OBSOLETE; } if (module) { - g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n" + ws_g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n" "Save your preferences to make this change permanent.", pref_name, dotp+1, module->parent->name, pref_name, dotp+1); prefs.unknown_prefs = TRUE; diff --git a/epan/proto.c b/epan/proto.c index 963da1e653..86c15bcd39 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -56,7 +56,7 @@ #include "in_cksum.h" #include <wsutil/plugins.h> -#include <wsutil/ws_printf.h> /* ws_debug_printf */ +#include <wsutil/ws_printf.h> /* ws_debug_printf/ws_g_warning */ /* Ptvcursor limits */ #define SUBTREE_ONCE_ALLOCATION_NUMBER 8 @@ -6478,7 +6478,7 @@ tmp_fld_check_assert(header_field_info *hfinfo) so only report if different... */ if ((start_values[m].value == current->value) && (strcmp(start_values[m].strptr, current->strptr) != 0)) { - g_warning("Field '%s' (%s) has a conflicting entry in its" + ws_g_warning("Field '%s' (%s) has a conflicting entry in its" " value_string: %u is at indices %u (%s) and %u (%s))\n", hfinfo->name, hfinfo->abbrev, current->value, m, start_values[m].strptr, n, current->strptr); @@ -8338,7 +8338,7 @@ proto_registrar_dump_values(void) if (hfinfo->display & BASE_EXT_STRING) { value_string_ext *vse_p = (value_string_ext *)hfinfo->strings; if (!value_string_ext_validate(vse_p)) { - g_warning("Invalid value_string_ext ptr for: %s", hfinfo->abbrev); + ws_g_warning("Invalid value_string_ext ptr for: %s", hfinfo->abbrev); continue; } try_val_to_str_ext(0, vse_p); /* "prime" the extended value_string */ diff --git a/epan/show_exception.c b/epan/show_exception.c index f65bba2877..aa037fc275 100644 --- a/epan/show_exception.c +++ b/epan/show_exception.c @@ -30,6 +30,7 @@ #include <epan/prefs.h> #include <epan/prefs-int.h> #include <epan/show_exception.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ static int proto_short = -1; static int proto_malformed = -1; @@ -140,7 +141,7 @@ show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pinfo->current_proto, exception_message == NULL ? dissector_error_nomsg : exception_message); - g_warning("Dissector bug, protocol %s, in packet %u: %s", + ws_g_warning("Dissector bug, protocol %s, in packet %u: %s", pinfo->current_proto, pinfo->num, exception_message == NULL ? dissector_error_nomsg : exception_message); diff --git a/epan/tap.c b/epan/tap.c index eb973410ab..07d49ee489 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -39,6 +39,7 @@ #include <epan/packet_info.h> #include <epan/dfilter/dfilter.h> #include <epan/tap.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ static gboolean tapping_is_active=FALSE; @@ -271,7 +272,7 @@ tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data) * rather than having a fixed maximum number of entries? */ if(tap_packet_index >= TAP_PACKET_QUEUE_LEN){ - g_warning("Too many taps queued"); + ws_g_warning("Too many taps queued"); return; } diff --git a/epan/tvbparse.c b/epan/tvbparse.c index b5ce3c87e4..934ac9792d 100644 --- a/epan/tvbparse.c +++ b/epan/tvbparse.c @@ -31,6 +31,7 @@ #include <epan/proto.h> #include <epan/packet_info.h> #include <epan/tvbparse.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ #define TVBPARSE_DEBUG_ALL 0xffffffff @@ -87,7 +88,7 @@ static tvbparse_elem_t* new_tok(tvbparse_t* tt, tvbparse_elem_t* tok; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NEWTOK) g_warning("new_tok: id=%i offset=%u len=%u",id,offset,len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NEWTOK) ws_g_warning("new_tok: id=%i offset=%u len=%u",id,offset,len); #endif tok = (tvbparse_elem_t *)wmem_new(wmem_packet_scope(), tvbparse_elem_t); @@ -113,20 +114,20 @@ static int ignore_fcn(tvbparse_t* tt, int offset) { if (!tt->ignore) return 0; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) g_warning("ignore: enter"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) ws_g_warning("ignore: enter"); #endif while ((consumed = tt->ignore->condition(tt,offset,tt->ignore,&ignored)) > 0) { len += consumed; offset += consumed; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) g_warning("ignore: consumed=%i",consumed); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) ws_g_warning("ignore: consumed=%i",consumed); #endif } #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) g_warning("ignore: len=%i",len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_IGNORE) ws_g_warning("ignore: len=%i",len); #endif return len; @@ -138,7 +139,7 @@ static int cond_char (tvbparse_t* tt, const int offset, const tvbparse_wanted_t guint i; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHAR) g_warning("cond_char: control='%s'",wanted->control.str); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHAR) ws_g_warning("cond_char: control='%s'",wanted->control.str); #endif if ( offset + 1 > tt->end_offset ) @@ -150,7 +151,7 @@ static int cond_char (tvbparse_t* tt, const int offset, const tvbparse_wanted_t if ( c == t ) { *tok = new_tok(tt,wanted->id,offset,1,wanted); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHAR) g_warning("cond_char: GOT: '%c'",c); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHAR) ws_g_warning("cond_char: GOT: '%c'",c); #endif return 1; } @@ -183,7 +184,7 @@ static int cond_chars_common(tvbparse_t* tt, int offset, const tvbparse_wanted_t int left = tt->end_offset - offset; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHARS) g_warning("cond_chars_common: control='%s'",wanted->control.str); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHARS) ws_g_warning("cond_chars_common: control='%s'",wanted->control.str); #endif if ( offset + (int)wanted->min > tt->end_offset ) @@ -206,7 +207,7 @@ static int cond_chars_common(tvbparse_t* tt, int offset, const tvbparse_wanted_t } else { *tok = new_tok(tt,wanted->id,start,length,wanted); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHARS) g_warning("cond_chars_common: GOT len=%i",length); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CHARS) ws_g_warning("cond_chars_common: GOT len=%i",length); #endif return length; } @@ -248,7 +249,7 @@ static int cond_not_char(tvbparse_t* tt, const int offset, const tvbparse_wanted gboolean not_matched = FALSE; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NOT_CHAR) g_warning("cond_not_char: control='%s'",wanted->control.str); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NOT_CHAR) ws_g_warning("cond_not_char: control='%s'",wanted->control.str); #endif if ( offset >= tt->end_offset ) { @@ -268,7 +269,7 @@ static int cond_not_char(tvbparse_t* tt, const int offset, const tvbparse_wanted } else { *tok = new_tok(tt,wanted->id,offset,1,wanted); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NOT_CHAR) g_warning("cond_not_char: GOT='%c'",t); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_NOT_CHAR) ws_g_warning("cond_not_char: GOT='%c'",t); #endif return 1; } @@ -326,7 +327,7 @@ tvbparse_wanted_t* tvbparse_not_chars(const int id, static int cond_string(tvbparse_t* tt, const int offset, const tvbparse_wanted_t * wanted, tvbparse_elem_t** tok) { int len = wanted->len; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_STRING) g_warning("cond_string: control='%s'",wanted->control.str); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_STRING) ws_g_warning("cond_string: control='%s'",wanted->control.str); #endif if ( offset + wanted->len > tt->end_offset ) @@ -335,7 +336,7 @@ static int cond_string(tvbparse_t* tt, const int offset, const tvbparse_wanted_t if ( tvb_strneql(tt->tvb, offset, wanted->control.str, len) == 0 ) { *tok = new_tok(tt,wanted->id,offset,len,wanted); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_STRING) g_warning("cond_string: GOT len=%i",len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_STRING) ws_g_warning("cond_string: GOT len=%i",len); #endif return len; } else { @@ -364,7 +365,7 @@ tvbparse_wanted_t* tvbparse_string(const int id, static int cond_casestring(tvbparse_t* tt, const int offset, const tvbparse_wanted_t * wanted, tvbparse_elem_t** tok) { int len = wanted->len; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CASESTRING) g_warning("cond_casestring: control='%s'",wanted->control.str); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CASESTRING) ws_g_warning("cond_casestring: control='%s'",wanted->control.str); #endif if ( offset + len > tt->end_offset ) @@ -373,7 +374,7 @@ static int cond_casestring(tvbparse_t* tt, const int offset, const tvbparse_want if ( tvb_strncaseeql(tt->tvb, offset, wanted->control.str, len) == 0 ) { *tok = new_tok(tt,wanted->id,offset,len,wanted); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CASESTRING) g_warning("cond_casestring: GOT len=%i",len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CASESTRING) ws_g_warning("cond_casestring: GOT len=%i",len); #endif return len; } else { @@ -403,7 +404,7 @@ tvbparse_wanted_t* tvbparse_casestring(const int id, static int cond_one_of(tvbparse_t* tt, const int offset, const tvbparse_wanted_t * wanted, tvbparse_elem_t** tok) { guint i; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_ONEOF) g_warning("cond_one_of: START"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_ONEOF) ws_g_warning("cond_one_of: START"); #endif if ( offset > tt->end_offset ) @@ -423,7 +424,7 @@ static int cond_one_of(tvbparse_t* tt, const int offset, const tvbparse_wanted_t *tok = new_tok(tt, wanted->id, new_elem->offset, new_elem->len, wanted); (*tok)->sub = new_elem; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_ONEOF) g_warning("cond_one_of: GOT len=%i",curr_len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_ONEOF) ws_g_warning("cond_one_of: GOT len=%i",curr_len); #endif return curr_len; } @@ -470,7 +471,7 @@ static int cond_hash(tvbparse_t* tt, const int offset, const tvbparse_wanted_t* tvbparse_elem_t* ret_tok; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: START"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) ws_g_warning("cond_hash: START"); #endif if ( offset > tt->end_offset ) @@ -483,7 +484,7 @@ static int cond_hash(tvbparse_t* tt, const int offset, const tvbparse_wanted_t* key = tvb_get_string_enc(wmem_packet_scope(),key_elem->tvb,key_elem->offset,key_elem->len, ENC_ASCII); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: got key='%s'",key); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) ws_g_warning("cond_hash: got key='%s'",key); #endif if ((value_wanted = (tvbparse_wanted_t *)wmem_map_lookup(wanted->control.hash.table,key))) { @@ -504,7 +505,7 @@ static int cond_hash(tvbparse_t* tt, const int offset, const tvbparse_wanted_t* *tok = ret_tok; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: GOT len=%i",tot_len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) ws_g_warning("cond_hash: GOT len=%i",tot_len); #endif return tot_len; @@ -567,7 +568,7 @@ static int cond_seq(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wanted if ( offset > tt->end_offset ) return -1; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SEQ) g_warning("cond_seq: START"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SEQ) ws_g_warning("cond_seq: START"); #endif for(i=0; i < wanted->control.elems->len; i++) { @@ -602,7 +603,7 @@ static int cond_seq(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wanted *tok = ret_tok; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SEQ) g_warning("cond_seq: GOT len=%i",offset - start); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SEQ) ws_g_warning("cond_seq: GOT len=%i",offset - start); #endif return offset - start; @@ -640,7 +641,7 @@ static int cond_some(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wante int start = offset; tvbparse_elem_t* ret_tok = NULL; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) g_warning("cond_some: START"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) ws_g_warning("cond_some: START"); #endif if ( offset > tt->end_offset ) @@ -683,7 +684,7 @@ static int cond_some(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wante } #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) g_warning("cond_some: got num=%u",got_so_far); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) ws_g_warning("cond_some: got num=%u",got_so_far); #endif if(got_so_far < wanted->min) { @@ -692,7 +693,7 @@ static int cond_some(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wante *tok = ret_tok; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) g_warning("cond_some: GOT len=%i",offset - start); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_SOME) ws_g_warning("cond_some: GOT len=%i",offset - start); #endif return offset - start; } @@ -727,7 +728,7 @@ static int cond_until(tvbparse_t* tt, const int offset, const tvbparse_wanted_t int len = 0; int target_offset = offset; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: START"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) ws_g_warning("cond_until: START"); #endif if ( offset + wanted->control.until.subelem->len > tt->end_offset ) @@ -751,19 +752,19 @@ static int cond_until(tvbparse_t* tt, const int offset, const tvbparse_wanted_t case TP_UNTIL_INCLUDE: new_elem->len = target_offset - offset - 1 + len; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) ws_g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); #endif return target_offset - offset -1 + len; case TP_UNTIL_SPEND: new_elem->len = target_offset - offset - 1; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) ws_g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len); #endif return target_offset - offset - 1 + len; case TP_UNTIL_LEAVE: new_elem->len = target_offset - offset - 1; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) ws_g_warning("cond_until: GOT len=%i",target_offset - offset -1); #endif return target_offset - offset -1; default: @@ -1181,7 +1182,7 @@ tvbparse_t* tvbparse_init(tvbuff_t* tvb, tvbparse_t* tt = (tvbparse_t *)wmem_new(wmem_packet_scope(), tvbparse_t); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_TT) g_warning("tvbparse_init: offset=%i len=%i",offset,len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_TT) ws_g_warning("tvbparse_init: offset=%i len=%i",offset,len); #endif @@ -1199,7 +1200,7 @@ gboolean tvbparse_reset(tvbparse_t* tt, int len) { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_TT) g_warning("tvbparse_init: offset=%i len=%i",offset,len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_TT) ws_g_warning("tvbparse_init: offset=%i len=%i",offset,len); #endif len = (len == -1) ? (int) tvb_captured_length(tt->tvb) : len; @@ -1223,7 +1224,7 @@ static void execute_callbacks(tvbparse_t* tt, tvbparse_elem_t* curr) { while (curr) { if(curr->wanted->before) { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) g_warning("execute_callbacks: BEFORE: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) ws_g_warning("execute_callbacks: BEFORE: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); #endif curr->wanted->before(tt->data, curr->wanted->data, curr); } @@ -1234,7 +1235,7 @@ static void execute_callbacks(tvbparse_t* tt, tvbparse_elem_t* curr) { continue; } else { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) g_warning("execute_callbacks: AFTER: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) ws_g_warning("execute_callbacks: AFTER: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); #endif if(curr->wanted->after) curr->wanted->after(tt->data, curr->wanted->data, curr); } @@ -1244,7 +1245,7 @@ static void execute_callbacks(tvbparse_t* tt, tvbparse_elem_t* curr) { while( !curr && wmem_stack_count(stack) > 0 ) { curr = (tvbparse_elem_t *)wmem_stack_pop(stack); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) g_warning("execute_callbacks: AFTER: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_CB) ws_g_warning("execute_callbacks: AFTER: id=%i offset=%i len=%i",curr->id,curr->offset,curr->len); #endif if( curr->wanted->after ) curr->wanted->after(tt->data, curr->wanted->data, curr); curr = curr->next; @@ -1260,25 +1261,25 @@ gboolean tvbparse_peek(tvbparse_t* tt, int offset = tt->offset; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: ENTER offset=%i",offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) ws_g_warning("tvbparse_peek: ENTER offset=%i",offset); #endif offset += ignore_fcn(tt,offset); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: after ignore offset=%i",offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) ws_g_warning("tvbparse_peek: after ignore offset=%i",offset); #endif consumed = wanted->condition(tt,offset,wanted,&tok); if (consumed >= 0) { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: GOT len=%i",consumed); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) ws_g_warning("tvbparse_peek: GOT len=%i",consumed); #endif return TRUE; } else { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: NOT GOT"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) ws_g_warning("tvbparse_peek: NOT GOT"); #endif return FALSE; } @@ -1292,25 +1293,25 @@ tvbparse_elem_t* tvbparse_get(tvbparse_t* tt, int offset = tt->offset; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: ENTER offset=%i",offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) ws_g_warning("tvbparse_get: ENTER offset=%i",offset); #endif offset += ignore_fcn(tt,offset); #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: after ignore offset=%i",offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) ws_g_warning("tvbparse_get: after ignore offset=%i",offset); #endif consumed = wanted->condition(tt,offset,wanted,&tok); if (consumed >= 0) { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: GOT len=%i",consumed); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) ws_g_warning("tvbparse_get: GOT len=%i",consumed); #endif execute_callbacks(tt,tok); tt->offset = offset + consumed; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: DONE offset=%i", tt->offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) ws_g_warning("tvbparse_get: DONE offset=%i", tt->offset); #endif return tok; } else { @@ -1327,7 +1328,7 @@ tvbparse_elem_t* tvbparse_find(tvbparse_t* tt, const tvbparse_wanted_t* wanted) int target_offset = offset -1; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) g_warning("tvbparse_get: ENTER offset=%i", tt->offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) ws_g_warning("tvbparse_get: ENTER offset=%i", tt->offset); #endif do { @@ -1336,18 +1337,18 @@ tvbparse_elem_t* tvbparse_find(tvbparse_t* tt, const tvbparse_wanted_t* wanted) if (len >= 0) { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) g_warning("tvbparse_get: FOUND offset=%i len=%i", target_offset,len); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) ws_g_warning("tvbparse_get: FOUND offset=%i len=%i", target_offset,len); #endif execute_callbacks(tt,tok); tt->offset = target_offset + len; #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) g_warning("tvbparse_get: DONE offset=%i", tt->offset); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) ws_g_warning("tvbparse_get: DONE offset=%i", tt->offset); #endif return tok; } else { #ifdef TVBPARSE_DEBUG - if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) g_warning("tvbparse_get: NOT FOUND"); + if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_FIND) ws_g_warning("tvbparse_get: NOT FOUND"); #endif return NULL; } diff --git a/epan/value_string.c b/epan/value_string.c index 5832541743..4a93cf6c43 100644 --- a/epan/value_string.c +++ b/epan/value_string.c @@ -29,6 +29,7 @@ #include "proto.h" #include "to_str.h" #include "value_string.h" +#include <wsutil/ws_printf.h> /* ws_g_warning */ /* REGULAR VALUE STRING */ @@ -464,14 +465,14 @@ _try_val_to_str_ext_init(const guint32 val, value_string_ext *vse) /* XXX: Should check for dups ?? */ if (type == VS_BIN_TREE) { if (prev_value > vs_p[i].value) { - g_warning("Extended value string '%s' forced to fall back to linear search:\n" + ws_g_warning("Extended value string '%s' forced to fall back to linear search:\n" " entry %u, value %u [%#x] < previous entry, value %u [%#x]", vse->_vs_name, i, vs_p[i].value, vs_p[i].value, prev_value, prev_value); type = VS_SEARCH; break; } if (first_value > vs_p[i].value) { - g_warning("Extended value string '%s' forced to fall back to linear search:\n" + ws_g_warning("Extended value string '%s' forced to fall back to linear search:\n" " entry %u, value %u [%#x] < first entry, value %u [%#x]", vse->_vs_name, i, vs_p[i].value, vs_p[i].value, first_value, first_value); type = VS_SEARCH; diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c index 828e1ac118..70f2d80a6b 100644 --- a/plugins/mate/mate_util.c +++ b/plugins/mate/mate_util.c @@ -26,6 +26,7 @@ #include "mate.h" #include "mate_util.h" #include <wsutil/file_util.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ /*************************************************************************** * ADDRDIFF @@ -145,7 +146,7 @@ gchar* scs_subscribe(SCS_collection* c, const gchar* s) { len = SCS_HUGE_SIZE; } else { len = SCS_HUGE_SIZE; - g_warning("mate SCS: string truncated due to huge size"); + ws_g_warning("mate SCS: string truncated due to huge size"); } orig = (gchar *)g_slice_alloc(len); @@ -195,7 +196,7 @@ void scs_unsubscribe(SCS_collection* c, gchar* s) { (*ip)--; } } else { - g_warning("unsubscribe: not subscribed"); + ws_g_warning("unsubscribe: not subscribed"); } } diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index 5ece48b188..81efe83e62 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -30,6 +30,7 @@ #include "mate.h" #include <epan/expert.h> +#include <wsutil/ws_printf.h> /* ws_g_warning */ void proto_register_mate(void); void proto_reg_handoff_mate(void); @@ -354,7 +355,7 @@ proto_reg_handoff_mate(void) (tap_draw_cb) NULL); if ( tap_error ) { - g_warning("mate: couldn't (re)register tap: %s",tap_error->str); + ws_g_warning("mate: couldn't (re)register tap: %s",tap_error->str); g_string_free(tap_error, TRUE); mate_tap_data = 0; return; diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 6c49c03a01..b18189dabd 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -32,6 +32,7 @@ #include <epan/dissectors/packet-dcerpc.h> #include <epan/dissectors/packet-dcom.h> #include "packet-dcom-cba-acco.h" +#include <wsutil/ws_printf.h> /* ws_debug_printf */ void proto_register_dcom_cba_acco(void); void proto_reg_handoff_dcom_cba_acco(void); @@ -390,7 +391,7 @@ static void cba_connection_dump(cba_connection_t *conn, const char *role) { if (conn->qostype != 0x30) { - g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Data#%5u-#%5u", + ws_debug_printf(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Data#%5u-#%5u", role, conn->packet_connect, conn->consid, conn->provid, conn->provitem, @@ -399,7 +400,7 @@ cba_connection_dump(cba_connection_t *conn, const char *role) conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"), conn->packet_first, conn->packet_last); } else { - g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Off:%u", + ws_debug_printf(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Off:%u", role, conn->packet_connect, conn->consid, conn->provid, conn->provitem, @@ -427,17 +428,17 @@ cba_object_dump(void) for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) { pdev = pdevs->data; set_address(&addr, AT_IPv4, 4, pdev->ip); - g_warning("PDev #%5u: %s IFs:%u", pdev->first_packet, address_to_str(wmem_packet_scope(), &addr), + ws_debug_printf("PDev #%5u: %s IFs:%u", pdev->first_packet, address_to_str(wmem_packet_scope(), &addr), pdev->object ? g_list_length(pdev->object->interfaces) : 0); for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) { ldev = ldevs->data; - g_warning(" LDev#%5u: \"%s\" LDevIFs:%u AccoIFs:%u", ldev->first_packet, ldev->name, + ws_debug_printf(" LDev#%5u: \"%s\" LDevIFs:%u AccoIFs:%u", ldev->first_packet, ldev->name, ldev->ldev_object ? g_list_length(ldev->ldev_object->interfaces) : 0, ldev->acco_object ? g_list_length(ldev->acco_object->interfaces) : 0); for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) { frame = frames->data; - g_warning(" ConsFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u", + ws_debug_printf(" ConsFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u", frame->packet_connect, frame->conscrid, frame->provcrid, frame->length, frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"), frame->packet_first, frame->packet_last); @@ -447,7 +448,7 @@ cba_object_dump(void) } for(frames = ldev->provframes; frames != NULL; frames = g_list_next(frames)) { frame = frames->data; - g_warning(" ProvFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u", + ws_debug_printf(" ProvFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u", frame->packet_connect, frame->conscrid, frame->provcrid, frame->length, frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"), frame->packet_first, frame->packet_last); diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c index 6b29e30ffd..fa3d513603 100644 --- a/wiretap/nettrace_3gpp_32_423.c +++ b/wiretap/nettrace_3gpp_32_423.c @@ -269,7 +269,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse second time format, scan_found %u", scan_found); + /* g_warning("Failed to parse second time format, scan_found %u", scan_found); */ return curr_pos; } } @@ -282,7 +282,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse time, month is %u", month); + /* g_warning("Failed to parse time, month is %u", month); */ return curr_pos; } tm.tm_mon = month - 1; /* Zero count*/ @@ -290,8 +290,8 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse time, %u-%02u-%2u is not a valid day", - year, month, day); + /* g_warning("Failed to parse time, %u-%02u-%2u is not a valid day", + year, month, day); */ return curr_pos; } tm.tm_mday = day; @@ -299,7 +299,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse time, hour is %u", hour); + /* g_warning("Failed to parse time, hour is %u", hour); */ return curr_pos; } tm.tm_hour = hour; @@ -307,7 +307,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse time, minute is %u", minute); + /* g_warning("Failed to parse time, minute is %u", minute); */ return curr_pos; } tm.tm_min = minute; @@ -319,7 +319,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; - g_warning("Failed to parse time, second is %u", second); + /* g_warning("Failed to parse time, second is %u", second); */ return curr_pos; } tm.tm_sec = second; @@ -337,7 +337,7 @@ nettrace_parse_begin_time(guint8 *curr_pos, struct wtap_pkthdr *phdr) phdr->ts.secs = phdr->ts.secs + UTCdiffsec; } } else { - g_warning("Failed to parse time, only %u fields", scan_found); + /* g_warning("Failed to parse time, only %u fields", scan_found); */ phdr->presence_flags = 0; /* yes, we have no bananas^Wtime stamp */ phdr->ts.secs = 0; phdr->ts.nsecs = 0; @@ -973,7 +973,7 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ } exported_pdu_info.src_port = port; } else { - g_warning("scan_found:%u, %u.%u.%u.%u Port %u transport %s", scan_found, d1, d2, d3, d4, port, transp_str); + /* g_warning("scan_found:%u, %u.%u.%u.%u Port %u transport %s", scan_found, d1, d2, d3, d4, port, transp_str); */ } } else { /* address not found*/ @@ -1019,7 +1019,7 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ } exported_pdu_info.dst_port = port; } else { - g_warning("scan_found:%u, %u.%u.%u.%u Port %u transport %s", scan_found, d1, d2, d3, d4, port, transp_str); + /* g_warning("scan_found:%u, %u.%u.%u.%u Port %u transport %s", scan_found, d1, d2, d3, d4, port, transp_str); */ } } else { diff --git a/wsutil/ws_printf.h b/wsutil/ws_printf.h index d996d01c5e..3e0468e53b 100644 --- a/wsutil/ws_printf.h +++ b/wsutil/ws_printf.h @@ -101,6 +101,11 @@ debugging context has a protocol tree. */ #define ws_debug_printf printf +/* This is intended to fool checkAPIs.pl for few places that have legitimate +use for g_warning. This should be used sparingly. +*/ +#define ws_g_warning g_warning + #ifdef __cplusplus } #endif /* __cplusplus */ |