From bf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 13 Jan 2016 02:16:04 +0100 Subject: Use result of register_dissector Assign result of `register_dissector(..., func, proto)` to FOO_handle and remove `FOO_handle = create_dissector_handle(func, proto)`. Found by looking for files named packet-FOO.c having the above create_dissector_handle pattern. Some files (with different dissect routines for the two functions) remain unchanged. Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90 Reviewed-on: https://code.wireshark.org/review/13247 Reviewed-by: Peter Wu Petri-Dish: Peter Wu Reviewed-by: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-nwp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-nwp.c') diff --git a/epan/dissectors/packet-nwp.c b/epan/dissectors/packet-nwp.c index 846b48d3cd..1971b2d51f 100644 --- a/epan/dissectors/packet-nwp.c +++ b/epan/dissectors/packet-nwp.c @@ -60,6 +60,8 @@ static gint ett_nwp_neigh_tree = -1; static expert_field ei_nwp_bad_type = EI_INIT; +static dissector_handle_t nwp_handle; + #define NWP_XID_CHUNK_LEN 4 #define NWP_XID_LEN 20 /* Two characters for every byte + 4 for "hid-" + 1 for "\0" */ @@ -345,7 +347,7 @@ proto_register_nwp(void) "NWP", "nwp"); - register_dissector("nwp", dissect_nwp, proto_nwp); + nwp_handle = register_dissector("nwp", dissect_nwp, proto_nwp); proto_register_field_array(proto_nwp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -356,8 +358,6 @@ proto_register_nwp(void) void proto_reg_handoff_nwp(void) { - dissector_handle_t nwp_handle; - nwp_handle = create_dissector_handle(dissect_nwp, proto_nwp); dissector_add_uint("ethertype", ETHERTYPE_NWP, nwp_handle); } -- cgit v1.2.3