diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-09-28 20:57:13 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-09-28 19:16:17 +0000 |
commit | f6b9e7a79ea572efa20af73b45cc24aa7f4b0c21 (patch) | |
tree | ffb1cbecf81b987fc0d7d935e74c5505c8344880 /tools/pidl | |
parent | fdf3585c46fc24b3c6551ad658b765ff435955c8 (diff) |
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>
Diffstat (limited to 'tools/pidl')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 8 |
1 files changed, 6 insertions, 2 deletions
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("}"); |