diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-18 18:14:46 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-06-19 11:32:26 +0000 |
commit | e1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4 (patch) | |
tree | 75f56e3f0dde68ec92613cea3f482f7f426625de /epan/dissectors/packet-uftp4.c | |
parent | 51bb2c4d7f515a24659ba0c0048392a81becda4e (diff) |
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 <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-uftp4.c')
-rw-r--r-- | epan/dissectors/packet-uftp4.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-uftp4.c b/epan/dissectors/packet-uftp4.c index 4fa5a855d0..5ce7838443 100644 --- a/epan/dissectors/packet-uftp4.c +++ b/epan/dissectors/packet-uftp4.c @@ -676,7 +676,7 @@ static const value_string file_types[] = { { 0, NULL } }; -static const int *announce_flags[] = { +static int * const announce_flags[] = { &hf_uftp_announce_flags_sync, &hf_uftp_announce_flags_syncpreview, &hf_uftp_announce_flags_ipv6, @@ -684,25 +684,25 @@ static const int *announce_flags[] = { NULL }; -static const int *encinfo_flags[] = { +static int * const encinfo_flags[] = { &hf_uftp_encinfo_flags_client_auth, &hf_uftp_encinfo_flags_reserved, NULL }; -static const int *fileinfoack_flags[] = { +static int * const fileinfoack_flags[] = { &hf_uftp_fileinfoack_flags_partial, &hf_uftp_fileinfoack_flags_reserved, NULL }; -static const int *abort_flags[] = { +static int * const abort_flags[] = { &hf_uftp_abort_flags_curfile, &hf_uftp_abort_flags_reserved, NULL }; -static const int *cc_item_flags[] = { +static int * const cc_item_flags[] = { &hf_uftp_congctrl_item_flags_clr, &hf_uftp_congctrl_item_flags_rtt, &hf_uftp_congctrl_item_flags_start, @@ -711,7 +711,7 @@ static const int *cc_item_flags[] = { NULL }; -static const int *tfmcc_ack_flags[] = { +static int * const tfmcc_ack_flags[] = { &hf_uftp_tfmccack_flags_clr, &hf_uftp_tfmccack_flags_rtt, &hf_uftp_tfmccack_flags_start, |