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-usb-com.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-usb-com.c')
-rw-r--r-- | epan/dissectors/packet-usb-com.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-usb-com.c b/epan/dissectors/packet-usb-com.c index 2785469e29..fc92454d8c 100644 --- a/epan/dissectors/packet-usb-com.c +++ b/epan/dissectors/packet-usb-com.c @@ -315,7 +315,7 @@ static const value_string usb_com_setup_request_vals[] = { }; static value_string_ext usb_com_setup_request_vals_ext = VALUE_STRING_EXT_INIT(usb_com_setup_request_vals); -static const int *usb_com_get_ntb_params_ntb_formats_supported_fields[] = { +static int * const usb_com_get_ntb_params_ntb_formats_supported_fields[] = { &hf_usb_com_get_ntb_params_ntb_formats_supported_16bit, &hf_usb_com_get_ntb_params_ntb_formats_supported_32bit, NULL @@ -333,7 +333,7 @@ static const value_string usb_com_crc_mode_vals[] = { {0, NULL} }; -static const int *ecm_eth_stats[] = { +static int * const ecm_eth_stats[] = { &hf_usb_com_descriptor_ecm_eth_stats_reserved, &hf_usb_com_descriptor_ecm_eth_stats_xmit_late_collisions, &hf_usb_com_descriptor_ecm_eth_stats_xmit_times_crs_lost, @@ -372,7 +372,7 @@ static const true_false_string usb_com_ecm_mc_address_filtering = { "Perfect" }; -static const int *ecm_nb_mc_filters[] = { +static int * const ecm_nb_mc_filters[] = { &hf_usb_com_descriptor_ecm_nb_mc_filters_mc_address_filtering, &hf_usb_com_descriptor_ecm_nb_mc_filters_nb_filters_supported, NULL |