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-ses.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-ses.c')
-rw-r--r-- | epan/dissectors/packet-ses.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c index 4dd01ef044..d9adcb0609 100644 --- a/epan/dissectors/packet-ses.c +++ b/epan/dissectors/packet-ses.c @@ -377,14 +377,14 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree, gboolean has_user_information = TRUE; guint16 flags; asn1_ctx_t asn1_ctx; - static const int * item_option_flags[] = { + static int * const item_option_flags[] = { &hf_release_token, &hf_major_activity_token, &hf_synchronize_minor_token, &hf_data_token, NULL }; - static const int * transport_option_flags[] = { + static int * const transport_option_flags[] = { &hf_ses_transport_connection, &hf_ses_transport_user_abort, &hf_ses_transport_protocol_error, @@ -392,11 +392,11 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree, &hf_ses_transport_implementation_restriction, NULL }; - static const int * protocol_options_flags[] = { + static int * const protocol_options_flags[] = { &hf_able_to_receive_extended_concatenated_SPDU, NULL }; - static const int * req_options_flags[] = { + static int * const req_options_flags[] = { &hf_session_exception_report, &hf_data_separation_function_unit, &hf_symmetric_synchronize_function_unit, @@ -413,12 +413,12 @@ dissect_parameter(tvbuff_t *tvb, int offset, proto_tree *tree, &hf_half_duplex_function_unit, NULL }; - static const int * version_flags[] = { + static int * const version_flags[] = { &hf_protocol_version_2, &hf_protocol_version_1, NULL }; - static const int * enclosure_flags[] = { + static int * const enclosure_flags[] = { &hf_end_of_SSDU, &hf_beginning_of_SSDU, NULL |