summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-09-28 20:57:13 +0200
committerMichael Mann <mmann78@netscape.net>2014-09-28 19:16:17 +0000
commitf6b9e7a79ea572efa20af73b45cc24aa7f4b0c21 (patch)
treeffb1cbecf81b987fc0d7d935e74c5505c8344880
parentfdf3585c46fc24b3c6551ad658b765ff435955c8 (diff)
downloadwireshark-f6b9e7a79ea572efa20af73b45cc24aa7f4b0c21.tar.gz
PIDL: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ibae478771b30d6e9ae07315985f1e71bc6b65423 Reviewed-on: https://code.wireshark.org/review/4350 Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-dcerpc-dfs.c2
-rw-r--r--epan/dissectors/packet-dcerpc-mapi.c6
-rw-r--r--tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm8
3 files changed, 6 insertions, 10 deletions
diff --git a/epan/dissectors/packet-dcerpc-dfs.c b/epan/dissectors/packet-dcerpc-dfs.c
index a12f6bd266..0c5e7fb6a5 100644
--- a/epan/dissectors/packet-dcerpc-dfs.c
+++ b/epan/dissectors/packet-dcerpc-dfs.c
@@ -585,7 +585,6 @@ int
netdfs_dissect_struct_dfs_Info0(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
{
proto_item *item = NULL;
- proto_tree *tree = NULL;
int old_offset;
@@ -593,7 +592,6 @@ netdfs_dissect_struct_dfs_Info0(tvbuff_t *tvb _U_, int offset _U_, packet_info *
if (parent_tree) {
item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_netdfs_dfs_Info0);
}
diff --git a/epan/dissectors/packet-dcerpc-mapi.c b/epan/dissectors/packet-dcerpc-mapi.c
index f6dbc8a2e3..a4b220f91b 100644
--- a/epan/dissectors/packet-dcerpc-mapi.c
+++ b/epan/dissectors/packet-dcerpc-mapi.c
@@ -8254,7 +8254,6 @@ int
mapi_dissect_struct_Release_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
{
proto_item *item = NULL;
- proto_tree *tree = NULL;
int old_offset;
@@ -8262,7 +8261,6 @@ mapi_dissect_struct_Release_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *
if (parent_tree) {
item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_mapi_Release_req);
}
@@ -8280,7 +8278,6 @@ int
mapi_dissect_struct_Release_repl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
{
proto_item *item = NULL;
- proto_tree *tree = NULL;
int old_offset;
@@ -8288,7 +8285,6 @@ mapi_dissect_struct_Release_repl(tvbuff_t *tvb _U_, int offset _U_, packet_info
if (parent_tree) {
item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_mapi_Release_repl);
}
@@ -8609,7 +8605,6 @@ int
mapi_dissect_struct_RecipSMTP(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
{
proto_item *item = NULL;
- proto_tree *tree = NULL;
int old_offset;
@@ -8617,7 +8612,6 @@ mapi_dissect_struct_RecipSMTP(tvbuff_t *tvb _U_, int offset _U_, packet_info *pi
if (parent_tree) {
item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_mapi_RecipSMTP);
}
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index ca34af34e0..175671b9c8 100644
--- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -664,7 +664,9 @@ sub Struct($$$$)
$self->indent;
$self->pidl_code($_) foreach (@$vars);
$self->pidl_code("proto_item *item = NULL;");
- $self->pidl_code("proto_tree *tree = NULL;");
+ if($res) {
+ $self->pidl_code("proto_tree *tree = NULL;");
+ }
$self->pidl_code("int old_offset;");
$self->pidl_code("");
@@ -678,7 +680,9 @@ sub Struct($$$$)
$self->pidl_code("if (parent_tree) {");
$self->indent;
$self->pidl_code("item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);");
- $self->pidl_code("tree = proto_item_add_subtree(item, ett_$ifname\_$name);");
+ if($res) {
+ $self->pidl_code("tree = proto_item_add_subtree(item, ett_$ifname\_$name);");
+ }
$self->deindent;
$self->pidl_code("}");