diff options
author | Matthieu Patou <mat@matws.net> | 2014-10-05 18:25:27 -0700 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-10-23 23:12:05 +0200 |
commit | f0a6043fb201940f438f63c809df7186aa307f01 (patch) | |
tree | 7b7963d7951ed7ace6ab28bd87954d6dbfb63794 /pidl/lib/Parse | |
parent | 49e0dc7ad0f3c29df20badacc4294f1adc375aaf (diff) | |
download | samba-f0a6043fb201940f438f63c809df7186aa307f01.tar.gz |
pidl-wireshark: handle 8 bits enum and change the signature of enum function to pass the exact type
Instead of passing a uint32 in all cases we pass the exact type
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Change-Id: Ib79f1fa56d5aeb30c6e57eea8f0a48db60f6484d
Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'pidl/lib/Parse')
-rw-r--r-- | pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 6daf7d4d5c1..321104fdc3d 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -150,7 +150,7 @@ sub Enum($$$$) } $self->pidl_hdr("extern const value_string $valsstring\[];"); - $self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_);"); + $self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_);"); $self->pidl_def("const value_string ".$valsstring."[] = {"); foreach (@{$e->{ELEMENTS}}) { @@ -163,19 +163,19 @@ sub Enum($$$$) $self->pidl_fn_start($dissectorname); $self->pidl_code("int"); - $self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)"); + $self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_)"); $self->pidl_code("{"); $self->indent; $self->pidl_code("g$e->{BASE_TYPE} parameter=0;"); - $self->pidl_code("if(param){"); + $self->pidl_code("if (param) {"); $self->indent; - $self->pidl_code("parameter=(g$e->{BASE_TYPE})*param;"); + $self->pidl_code("parameter = *param;"); $self->deindent; $self->pidl_code("}"); $self->pidl_code("offset = dissect_ndr_$e->{BASE_TYPE}(tvb, offset, pinfo, tree, drep, hf_index, ¶meter);"); - $self->pidl_code("if(param){"); + $self->pidl_code("if (param) {"); $self->indent; - $self->pidl_code("*param=(guint32)parameter;"); + $self->pidl_code("*param = parameter;"); $self->deindent; $self->pidl_code("}"); $self->pidl_code("return offset;"); |