aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb-ccid.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-usb-ccid.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-usb-ccid.c')
-rw-r--r--epan/dissectors/packet-usb-ccid.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c
index f166d6f223..b977f49ffc 100644
--- a/epan/dissectors/packet-usb-ccid.c
+++ b/epan/dissectors/packet-usb-ccid.c
@@ -97,20 +97,20 @@ static int hf_ccid_bHardwareErrorCode = -1;
static dissector_handle_t usb_ccid_handle;
-static const int *bVoltageLevel_fields[] = {
+static int * const bVoltageLevel_fields[] = {
&hf_ccid_bVoltageSupport18,
&hf_ccid_bVoltageSupport30,
&hf_ccid_bVoltageSupport50,
NULL
};
-static const int *dwProtocols_fields[] = {
+static int * const dwProtocols_fields[] = {
&hf_ccid_dwProtocols_t0,
&hf_ccid_dwProtocols_t1,
NULL
};
-static const int *bFeatures_fields[] = {
+static int * const bFeatures_fields[] = {
/* XXX - add the missing components */
&hf_ccid_dwFeatures_autoParam,
&hf_ccid_dwFeatures_autoIccActivation,
@@ -129,13 +129,13 @@ static const int *bFeatures_fields[] = {
NULL
};
-static const int *bPINSupport_fields[] = {
+static int * const bPINSupport_fields[] = {
&hf_ccid_bPINSupport_modify,
&hf_ccid_bPINSupport_vrfy,
NULL
};
-static const int *bmSlotICCState_fields[] = {
+static int * const bmSlotICCState_fields[] = {
&hf_ccid_bmSlotICCState_slot0Current,
&hf_ccid_bmSlotICCState_slot0Changed,
&hf_ccid_bmSlotICCState_slot1Current,
@@ -147,7 +147,7 @@ static const int *bmSlotICCState_fields[] = {
NULL
};
-static const int *bStatus_fields[] = {
+static int * const bStatus_fields[] = {
&hf_ccid_bStatus_bmIccStatus,
&hf_ccid_bStatus_bmCommandStatus,
NULL