From: Aurelien Aptel Date: Fri, 5 Feb 2016 13:43:04 +0000 (+0100) Subject: pidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang X-Git-Tag: tdb-1.3.10~778 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30e7be511e85919bc71f8e653b0b089c76c6f31f;p=thirdparty%2Fsamba.git pidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang Port Wireshark commit f6b9e7a Author: Alexis La Goutte Date: Sun Sep 28 20:57:13 2014 +0200 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 Signed-off-by: Aurelien Aptel Reviewed-by: Stefan Metzmacher Reviewed-by: David Disseldorp --- diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 698f8c61a5e..40c59c9a517 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -690,7 +690,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;"); + } if (defined($doalign)) { $self->pidl_code("dcerpc_info *di = (dcerpc_info *)pinfo->private_data;"); if ($doalign == 0) { @@ -715,7 +717,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("}");