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-ua3g.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-ua3g.c')
-rw-r--r-- | epan/dissectors/packet-ua3g.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index 2fb7cf2d62..a07f2a1dda 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -2445,7 +2445,7 @@ decode_beep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, } case 0x04: /* Start Beep */ { - static const int *destinations[] = { + static int * const destinations[] = { &hf_ua3g_beep_beep_destination_handset, &hf_ua3g_beep_beep_destination_headset, &hf_ua3g_beep_beep_destination_loudspeaker, @@ -3795,7 +3795,7 @@ decode_unsolicited_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, offset++; length--; } else { - static const int *hardware_config[] = { + static int * const hardware_config[] = { &hf_ua3g_unsolicited_msg_hardware_config_export_full, &hf_ua3g_unsolicited_msg_hardware_config_ethernet_hardware, &hf_ua3g_unsolicited_msg_hardware_config_extended_edition, @@ -3851,7 +3851,7 @@ decode_unsolicited_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, } if (length >= 1) { - const int *capability_info[] = { + int * const capability_info[] = { &hf_ua3g_unsolicited_msg_capability_info_vpn, &hf_ua3g_unsolicited_msg_capability_info_ipsec, &hf_ua3g_unsolicited_msg_capability_info_dtls, @@ -3972,7 +3972,7 @@ static void decode_special_key(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint offset, guint8 opcode) { - static const int * special_keys[] = { + static int * const special_keys[] = { &hf_ua3g_special_key_shift, &hf_ua3g_special_key_ctrl, &hf_ua3g_special_key_alt, |