From e1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 18 Jun 2020 18:14:46 -0700 Subject: 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 --- epan/dissectors/packet-eigrp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'epan/dissectors/packet-eigrp.c') diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c index dfd9ab6a01..de4ab9a318 100644 --- a/epan/dissectors/packet-eigrp.c +++ b/epan/dissectors/packet-eigrp.c @@ -333,7 +333,7 @@ static gint hf_eigrp_flags_eot = -1; static gint hf_eigrp_flags_condrecv = -1; static gint ett_eigrp_flags = -1; -static const int *eigrp_flag_fields[] = { +static int * const eigrp_flag_fields[] = { &hf_eigrp_flags_init, &hf_eigrp_flags_condrecv, &hf_eigrp_flags_restart, @@ -387,7 +387,7 @@ static gint hf_eigrp_stub_flags_redist = -1; static gint hf_eigrp_stub_flags_leakmap = -1; static gint ett_eigrp_stub_flags = -1; -static const int *eigrp_stub_flag_fields[] = { +static int * const eigrp_stub_flag_fields[] = { &hf_eigrp_stub_flags_connected, &hf_eigrp_stub_flags_static, &hf_eigrp_stub_flags_summary, -- cgit v1.2.3