From e450ff685b57849470aecdab5397a1a8ea5d19d2 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Wed, 3 Jul 2024 08:03:41 -0400 Subject: [PATCH] pidl: Wireshark: Another C99 type conversion Pick up change from Wireshark: commit bdb719f846f9d8f7800b9f50dadfde5e7f7a89e1 Author: John Thacker Date: Sun Jun 23 08:15:45 2024 -0400 pidl: Another C99 type conversion Change an automated sizeof() call in the pidl dissector generation from prefixing a "g" to getting the actual C type. Ping #19116 Signed-off-by: John Thacker Reviewed-by: Jo Sutton Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Jul 12 11:08:03 UTC 2024 on atb-devel-224 --- pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index ee28e8a7c36..3d8b74bab45 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -23,7 +23,7 @@ use Exporter; use strict; use warnings; use Parse::Pidl qw(error warning); -use Parse::Pidl::Typelist qw(getType); +use Parse::Pidl::Typelist qw(getType mapScalarType); use Parse::Pidl::Util qw(has_property property_matches make_str); use Parse::Pidl::NDR qw(ContainsString GetNextLevel); use Parse::Pidl::Dump qw(DumpType DumpFunction); @@ -336,9 +336,10 @@ sub ElementLevel($$$$$$$$) $self->pidl_code("offset = dissect_ndr_u" . $type . "array(tvb, offset, pinfo, tree, di, drep, $myname\_);"); } else { my $nl = GetNextLevel($e,$l); + my $nl_ctype = mapScalarType($nl->{DATA_TYPE}); $self->pidl_code("char *data;"); $self->pidl_code(""); - $self->pidl_code("offset = dissect_ndr_$type" . "string(tvb, offset, pinfo, tree, di, drep, sizeof(g$nl->{DATA_TYPE}), $hf, false, &data);"); + $self->pidl_code("offset = dissect_ndr_$type" . "string(tvb, offset, pinfo, tree, di, drep, sizeof($nl_ctype), $hf, false, &data);"); $self->pidl_code("proto_item_append_text(tree, \": %s\", data);"); } } -- 2.47.3