aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nfapi.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-06-18 18:14:46 -0700
committerAnders Broman <a.broman58@gmail.com>2020-06-19 11:32:26 +0000
commite1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4 (patch)
tree75f56e3f0dde68ec92613cea3f482f7f426625de /epan/dissectors/packet-nfapi.c
parent51bb2c4d7f515a24659ba0c0048392a81becda4e (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-nfapi.c')
-rw-r--r--epan/dissectors/packet-nfapi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-nfapi.c b/epan/dissectors/packet-nfapi.c
index 5c96d4dd98..46ebf7d69e 100644
--- a/epan/dissectors/packet-nfapi.c
+++ b/epan/dissectors/packet-nfapi.c
@@ -1475,7 +1475,7 @@ static const value_string message_id_vals[] =
static dissector_handle_t nfapi_handle;
static dissector_table_t message_table;
-static const int * dl_bandwidth_support_fields[] = {
+static int * const dl_bandwidth_support_fields[] = {
&hf_nfapi_dl_bandwidth_support_6,
&hf_nfapi_dl_bandwidth_support_15,
&hf_nfapi_dl_bandwidth_support_25,
@@ -1485,7 +1485,7 @@ static const int * dl_bandwidth_support_fields[] = {
NULL
};
-static const int * ul_bandwidth_support_fields[] = {
+static int * const ul_bandwidth_support_fields[] = {
&hf_nfapi_ul_bandwidth_support_6,
&hf_nfapi_ul_bandwidth_support_15,
&hf_nfapi_ul_bandwidth_support_25,
@@ -1495,7 +1495,7 @@ static const int * ul_bandwidth_support_fields[] = {
NULL
};
-static const int * maximum_3gpp_release_supported_fields[] = {
+static int * const maximum_3gpp_release_supported_fields[] = {
&hf_nfapi_maximum_3gpp_release_supported_rel8,
&hf_nfapi_maximum_3gpp_release_supported_rel9,
&hf_nfapi_maximum_3gpp_release_supported_rel10,
@@ -2847,7 +2847,7 @@ static void dissect_ul_bandwidth_support_value(ptvcursor_t * ptvc, packet_info*
}
static void dissect_dl_modulation_value(ptvcursor_t * ptvc, packet_info* pinfo)
{
- static const int * dl_modulation_support_fields[] = {
+ static int * const dl_modulation_support_fields[] = {
&hf_nfapi_dl_modulation_support_qpsk,
&hf_nfapi_dl_modulation_support_16qam,
&hf_nfapi_dl_modulation_support_64qam,
@@ -2868,7 +2868,7 @@ static void dissect_dl_modulation_value(ptvcursor_t * ptvc, packet_info* pinfo)
}
static void dissect_ul_modulation_value(ptvcursor_t * ptvc, packet_info* pinfo)
{
- static const int * ul_modulation_support_fields[] = {
+ static int * const ul_modulation_support_fields[] = {
&hf_nfapi_ul_modulation_support_qpsk,
&hf_nfapi_ul_modulation_support_16qam,
&hf_nfapi_ul_modulation_support_64qam,
@@ -8272,7 +8272,7 @@ static int dissect_p7_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree *header_tree;
int offset = 0;
guint8 m_seg;
- static const int *fields[] = {
+ static int * const fields[] = {
&hf_nfapi_p7_message_header_m,
&hf_nfapi_p7_message_header_segment,
NULL