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-nstrace.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-nstrace.c')
-rw-r--r-- | epan/dissectors/packet-nstrace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nstrace.c b/epan/dissectors/packet-nstrace.c index 894a6d1133..26e1d345fa 100644 --- a/epan/dissectors/packet-nstrace.c +++ b/epan/dissectors/packet-nstrace.c @@ -468,7 +468,7 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data guint8 src_vmname_len = 0, dst_vmname_len = 0; guint8 variable_ns_len = 0; guint32 vlan; - static const int * activity_flags[] = { + static int * const activity_flags[] = { &hf_ns_activity_perf_collection, &hf_ns_activity_pcb_zombie, &hf_ns_activity_natpcb_zombie, @@ -522,7 +522,7 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data case NSPR_HEADER_VERSION204: { - static const int * clflags[] = { + static int * const clflags[] = { &hf_ns_clflags_res, &hf_ns_clflags_rssh, &hf_ns_clflags_rss, @@ -561,7 +561,7 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data case NSPR_HEADER_VERSION350: { - static const int * cap_flags[] = { + static int * const cap_flags[] = { &hf_ns_capflags_dbg, &hf_ns_capflags_int, &hf_ns_capflags_skipnwhdr, @@ -638,7 +638,7 @@ void add35records(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tre proto_tree* subtree; proto_item* subitem; unsigned int tcp_mode = 0; - static const int * cluster_flags[] = { + static int * const cluster_flags[] = { &hf_ns_clu_clflags_fp, &hf_ns_clu_clflags_fr, &hf_ns_clu_clflags_dfd, |