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-dcerpc-dfs.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-dcerpc-dfs.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-dfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-dcerpc-dfs.c b/epan/dissectors/packet-dcerpc-dfs.c index 13c0d6a9f1..59cd704c7b 100644 --- a/epan/dissectors/packet-dcerpc-dfs.c +++ b/epan/dissectors/packet-dcerpc-dfs.c @@ -660,7 +660,7 @@ int netdfs_dissect_bitmap_dfs_VolumeState(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_) { proto_item *item; - static const int * netdfs_dfs_VolumeState_fields[] = { + static int * const netdfs_dfs_VolumeState_fields[] = { &hf_netdfs_dfs_VolumeState_DFS_VOLUME_STATE_OK, &hf_netdfs_dfs_VolumeState_DFS_VOLUME_STATE_INCONSISTENT, &hf_netdfs_dfs_VolumeState_DFS_VOLUME_STATE_OFFLINE, @@ -796,7 +796,7 @@ int netdfs_dissect_bitmap_dfs_StorageState(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_) { proto_item *item; - static const int * netdfs_dfs_StorageState_fields[] = { + static int * const netdfs_dfs_StorageState_fields[] = { &hf_netdfs_dfs_StorageState_DFS_STORAGE_STATE_OFFLINE, &hf_netdfs_dfs_StorageState_DFS_STORAGE_STATE_ONLINE, &hf_netdfs_dfs_StorageState_DFS_STORAGE_STATE_ACTIVE, @@ -1190,7 +1190,7 @@ int netdfs_dissect_bitmap_dfs_PropertyFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_) { proto_item *item; - static const int * netdfs_dfs_PropertyFlags_fields[] = { + static int * const netdfs_dfs_PropertyFlags_fields[] = { &hf_netdfs_dfs_PropertyFlags_DFS_PROPERTY_FLAG_INSITE_REFERRALS, &hf_netdfs_dfs_PropertyFlags_DFS_PROPERTY_FLAG_ROOT_SCALABILITY, &hf_netdfs_dfs_PropertyFlags_DFS_PROPERTY_FLAG_SITE_COSTING, |