From 8f08a4e74ea8aa56284e6035017adf1c423c4f09 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 18 Sep 2018 10:09:31 -0700 Subject: Try to discourage the use of APIs via counting. Add the ability to specify maximum function counts for each group to checkAPIs. Add maximum counts for the "termoutput" and "abort" groups where needed. Show summaries in various checkAPI targets. Switch uses of ws_g_warning back to plain g_warning. Change-Id: I5cbddc8c671729e424eed8551f69116d16491976 Reviewed-on: https://code.wireshark.org/review/29721 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- plugins/epan/mate/CMakeLists.txt | 4 +++- plugins/epan/mate/mate_util.c | 5 ++--- plugins/epan/mate/packet-mate.c | 1 - plugins/epan/transum/packet-transum.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/epan') diff --git a/plugins/epan/mate/CMakeLists.txt b/plugins/epan/mate/CMakeLists.txt index dc54bc58d0..1b44176132 100644 --- a/plugins/epan/mate/CMakeLists.txt +++ b/plugins/epan/mate/CMakeLists.txt @@ -61,7 +61,9 @@ CHECKAPI( NAME mate SWITCHES - -g abort -g termoutput -build + --group abort + --group termoutput:1 --summary-group termoutput + --build SOURCES ${DISSECTOR_SRC} ${DISSECTOR_SUPPORT_SRC} diff --git a/plugins/epan/mate/mate_util.c b/plugins/epan/mate/mate_util.c index 2eaeb5aa45..4131831a0f 100644 --- a/plugins/epan/mate/mate_util.c +++ b/plugins/epan/mate/mate_util.c @@ -14,7 +14,6 @@ #include "mate.h" #include "mate_util.h" #include -#include /* ws_g_warning */ /*************************************************************************** @@ -125,7 +124,7 @@ gchar* scs_subscribe(SCS_collection* c, const gchar* s) { len = SCS_HUGE_SIZE; } else { len = SCS_HUGE_SIZE; - ws_g_warning("mate SCS: string truncated due to huge size"); + g_warning("mate SCS: string truncated due to huge size"); } orig = (gchar *)g_slice_alloc(len); @@ -175,7 +174,7 @@ void scs_unsubscribe(SCS_collection* c, gchar* s) { (*ip)--; } } else { - ws_g_warning("unsubscribe: not subscribed"); + g_warning("unsubscribe: not subscribed"); } } diff --git a/plugins/epan/mate/packet-mate.c b/plugins/epan/mate/packet-mate.c index 5fc90a07f4..10e5ba5647 100644 --- a/plugins/epan/mate/packet-mate.c +++ b/plugins/epan/mate/packet-mate.c @@ -18,7 +18,6 @@ #include "mate.h" #include -#include /* ws_g_warning */ void proto_register_mate(void); void proto_reg_handoff_mate(void); diff --git a/plugins/epan/transum/packet-transum.c b/plugins/epan/transum/packet-transum.c index c2a72cfc9e..b5c86e8330 100644 --- a/plugins/epan/transum/packet-transum.c +++ b/plugins/epan/transum/packet-transum.c @@ -772,7 +772,7 @@ static void init_globals(void) if (hf_of_interest[i].hf != -1) g_array_append_val(wanted_fields, hf_of_interest[i].hf); else - ws_g_warning("TRANSUM: unknown field %s", hf_of_interest[i].proto_name); + g_warning("TRANSUM: unknown field %s", hf_of_interest[i].proto_name); } set_postdissector_wanted_hfids(transum_handle, wanted_fields); -- cgit v1.2.3