From 6d7b29592aa9cac3f10823ea8f33b18893707e83 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 4 Oct 2015 16:27:02 +0200 Subject: Allow use of variadic macros Remove variadic macros restriction (c99, c++11 feature) from README.developer. GCC, Clang, MSVC 2005 all support it. Enable -Wno-variadic-macros in configure.ac and CMakeLists.txt when -Wpedantic is enabled (which would enable -Wvariadic-macros). For all files matching 'define\s*\w+[0-9]\(', replace "FOO[0-9]" by "FOO" and adjust the macro definition accordingly. The nbap dissector was regenerated after adjusting its template and .cnf file. The generated code is the same since all files disabled the debug macros. Discussed at: https://www.wireshark.org/lists/wireshark-dev/201209/msg00142.html https://www.wireshark.org/lists/wireshark-dev/201510/msg00012.html Change-Id: I3b2e22487db817cbbaac774a592669a4f44314b2 Reviewed-on: https://code.wireshark.org/review/10781 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte Reviewed-by: Guy Harris --- epan/dissectors/packet-netflow.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'epan/dissectors/packet-netflow.c') diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index 89bb7d925e..1797951f04 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -141,15 +141,9 @@ void proto_register_netflow(void); void proto_reg_handoff_netflow(void); #if 0 -#define ipfix_debug0(str) g_warning(str) -#define ipfix_debug1(str,p1) g_warning(str,p1) -#define ipfix_debug2(str,p1,p2) g_warning(str,p1,p2) -#define ipfix_debug3(str,p1,p2,p3) g_warning(str,p1,p2,p3) +#define ipfix_debug(...) g_warning(__VA_ARGS__) #else -#define ipfix_debug0(str) -#define ipfix_debug1(str,p1) -#define ipfix_debug2(str,p1,p2) -#define ipfix_debug3(str,p1,p2,p3) +#define ipfix_debug(...) #endif @@ -2313,11 +2307,11 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data dissect_pdu_t *pduptr; guint32 flows_seen = 0; - ipfix_debug0("dissect_netflow: start"); + ipfix_debug("dissect_netflow: start"); ver = tvb_get_ntohs(tvb, offset); - ipfix_debug1("dissect_netflow: found version %d", ver); + ipfix_debug("dissect_netflow: found version %d", ver); switch (ver) { case 1: @@ -2351,13 +2345,13 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data col_set_str(pinfo->cinfo, COL_PROTOCOL, "CFLOW"); col_clear(pinfo->cinfo, COL_INFO); - ipfix_debug0("dissect_netflow: column cleared"); + ipfix_debug("dissect_netflow: column cleared"); if (tree) { ti = proto_tree_add_item(tree, proto_netflow, tvb, offset, -1, ENC_NA); netflow_tree = proto_item_add_subtree(ti, ett_netflow); } - ipfix_debug0("dissect_netflow: tree added"); + ipfix_debug("dissect_netflow: tree added"); hdrinfo.vspec = ver; hdrinfo.src_id = 0; -- cgit v1.2.3