From: John Thacker Date: Wed, 3 Jul 2024 11:52:42 +0000 (-0400) Subject: pidl: Wireshark: Const-ify dcerpc_sub_dissector structures. X-Git-Tag: tdb-1.4.11~157 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f5a388dd105f43d69b730f05be1b1b109c87212;p=thirdparty%2Fsamba.git pidl: Wireshark: Const-ify dcerpc_sub_dissector structures. Pick up change from Wireshark: commit 8a2a42241fd148ce735e776a6a1e6b49b64d215e Author: Darius Davis Date: Sun May 19 17:39:38 2024 +1000 Const-ify dcerpc_sub_dissector structures. This moves about 56 kBytes of data from a read-write data section to read-only. The various dissectors were _not_ regenerated for this commit. Instead, this commit was produced using the following command: find * -type f -exec sed -i -e 's/\(["'\'']\|^\)static dcerpc_sub_dissector/\1static const dcerpc_sub_dissector/' \{\} \; This updates the generator script and its test, as well as making an identical change to all of the dissectors, regardless of whether or not those dissectors were produced by the generator script. Signed-off-by: John Thacker Reviewed-by: Jo Sutton Reviewed-by: Stefan Metzmacher --- diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 48c090497fe..fedc8542262 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -1340,7 +1340,7 @@ sub DumpFunctionTable($) { my $if = shift; - my $res = "static dcerpc_sub_dissector $if->{NAME}\_dissectors[] = {\n"; + my $res = "static const dcerpc_sub_dissector $if->{NAME}\_dissectors[] = {\n"; foreach (@{$if->{FUNCTIONS}}) { my $fn_name = $_->{NAME}; $fn_name =~ s/^$if->{NAME}_//; diff --git a/pidl/tests/wireshark-ndr.pl b/pidl/tests/wireshark-ndr.pl index fd2fa55357f..04fa820a9d8 100755 --- a/pidl/tests/wireshark-ndr.pl +++ b/pidl/tests/wireshark-ndr.pl @@ -241,7 +241,7 @@ static gint hf_bla; is(DumpFunctionTable({ NAME => "someif", FUNCTIONS => [ { NAME => "fn1", OPNUM => 3 }, { NAME => "someif_fn2", OPNUM => 2 } ] }), -'static dcerpc_sub_dissector someif_dissectors[] = { +'static const dcerpc_sub_dissector someif_dissectors[] = { { 3, "fn1", someif_dissect_fn1_request, someif_dissect_fn1_response}, { 2, "fn2",