From 5cd7ea6af225e8ed968c7db8cebad0fc8c0293af Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 9 May 2017 10:11:27 -0400 Subject: [PATCH] Don't have epan_dissect_init() return anything. It manipulates the epan_dissect_t structure passed into it and then returns that. Callers can (and have been) just using the passed in epan_dissect_t structure anyway. Change-Id: Ia19d360a7347ff473654eeb553756f59a38f95bd Reviewed-on: https://code.wireshark.org/review/21570 Petri-Dish: Michael Mann Reviewed-by: Jaap Keuter Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/epan.c | 7 +++---- epan/epan.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/epan/epan.c b/epan/epan.c index e3a3ae85d1..9eb597164c 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -373,7 +373,7 @@ epan_set_always_visible(gboolean force) always_visible_refcount--; } -epan_dissect_t* +void epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible) { g_assert(edt); @@ -398,8 +398,6 @@ epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_pr } edt->tvb = NULL; - - return edt; } void @@ -439,7 +437,8 @@ epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboole edt = g_new0(epan_dissect_t, 1); - return epan_dissect_init(edt, session, create_proto_tree, proto_tree_visible); + epan_dissect_init(edt, session, create_proto_tree, proto_tree_visible); + return edt; } void diff --git a/epan/epan.h b/epan/epan.h index 91c7c1c24f..a667325ff2 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -172,7 +172,7 @@ void epan_set_always_visible(gboolean force); /** initialize an existing single packet dissection */ WS_DLL_PUBLIC -epan_dissect_t* +void epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible); /** get a new single packet dissection