From: John Thacker Date: Tue, 25 Jun 2024 22:40:20 +0000 (-0400) Subject: pidl:Wireshark Fix the type of array of pointerse to hf_ values X-Git-Tag: tdb-1.4.11~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95420715881337187bda2311ced667a704fab737;p=thirdparty%2Fsamba.git pidl:Wireshark Fix the type of array of pointerse to hf_ values Picked from Wireshark's fork: commit e1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4 Author: Guy Harris Date: Thu Jun 18 18:14:46 2020 -0700 Fix the type of arrays of pointers to hf_ values for bitfield routines. The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman Signed-off-by: John Thacker Reviewed-by: Douglas Bagnall Reviewed-by: Stefan Metzmacher Autobuild-User(master): Douglas Bagnall Autobuild-Date(master): Wed Jul 3 02:35:43 UTC 2024 on atb-devel-224 --- diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index f5484ca734d..05ef8b78554 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -219,7 +219,7 @@ sub Bitmap($$$$) } if ($element_count > 0) { $self->pidl_code("proto_item *item;"); - $self->pidl_code("static const int * $ifname\_$name\_fields[] = {"); + $self->pidl_code("static int * const $ifname\_$name\_fields[] = {"); $self->indent; foreach (@{$e->{ELEMENTS}}) { next unless (/([^ ]*) (.*)/);