aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2014-01-30 09:43:52 -0800
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-02-03 09:26:10 +0000
commit4cc694839d45d767f4880988da3b88389774b5db (patch)
tree40905d9cf9345c56314cdfdfd04a65c6e25764df
parent479d27c69e46add652acbdd321fd3f88cfb50900 (diff)
Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--doc/README.dissector8
-rw-r--r--epan/address_to_str.c17
-rw-r--r--epan/dfilter/dfilter-macro.c2
-rw-r--r--epan/dissectors/packet-ber.c2
-rw-r--r--epan/dissectors/packet-bgp.c2
-rw-r--r--epan/dissectors/packet-bootp.c2
-rw-r--r--epan/dissectors/packet-btrfcomm.c2
-rw-r--r--epan/dissectors/packet-c1222.c2
-rw-r--r--epan/dissectors/packet-collectd.c2
-rw-r--r--epan/dissectors/packet-devicenet.c2
-rw-r--r--epan/dissectors/packet-dmp.c2
-rw-r--r--epan/dissectors/packet-dtls.c2
-rw-r--r--epan/dissectors/packet-ess.c2
-rw-r--r--epan/dissectors/packet-etsi_card_app_toolkit.c2
-rw-r--r--epan/dissectors/packet-http.c2
-rw-r--r--epan/dissectors/packet-ieee80211.c2
-rw-r--r--epan/dissectors/packet-ieee802154.c2
-rw-r--r--epan/dissectors/packet-imf.c2
-rw-r--r--epan/dissectors/packet-ipsec.c2
-rw-r--r--epan/dissectors/packet-isakmp.c4
-rw-r--r--epan/dissectors/packet-k12.c2
-rw-r--r--epan/dissectors/packet-ldap.c2
-rw-r--r--epan/dissectors/packet-mac-lte.c2
-rw-r--r--epan/dissectors/packet-mq.c4
-rw-r--r--epan/dissectors/packet-pdcp-lte.c2
-rw-r--r--epan/dissectors/packet-pres.c2
-rw-r--r--epan/dissectors/packet-reload.c2
-rw-r--r--epan/dissectors/packet-sccp.c2
-rw-r--r--epan/dissectors/packet-sctp.c2
-rw-r--r--epan/dissectors/packet-snmp.c2
-rw-r--r--epan/dissectors/packet-ssl.c2
-rw-r--r--epan/dissectors/packet-time.c8
-rw-r--r--epan/dissectors/packet-ua3g.c6
-rw-r--r--epan/dissectors/packet-user_encap.c2
-rw-r--r--epan/dissectors/packet-vcdu.c2
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c2
-rw-r--r--epan/dissectors/packet-zbee-security.c2
-rw-r--r--epan/proto.h5
-rw-r--r--epan/to_str.h2
-rw-r--r--epan/uat.c11
-rw-r--r--epan/uat.h4
-rw-r--r--plugins/stats_tree/pinfo_stats_tree.c2
-rw-r--r--ui/iface_lists.c2
43 files changed, 87 insertions, 48 deletions
diff --git a/doc/README.dissector b/doc/README.dissector
index e2e9ae2b68..65a6ec145d 100644
--- a/doc/README.dissector
+++ b/doc/README.dissector
@@ -140,7 +140,7 @@ FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64):
--For all other types:
BASE_NONE
-FIELDCONVERT VALS(x), RVALS(x), TFS(x), NULL
+FIELDCONVERT VALS(x), VALS64(x), RVALS(x), TFS(x), NULL
BITMASK Used to mask a field not 8-bit aligned or with a size other
than a multiple of 8 bits
FIELDDESCR A brief description of the field, or NULL. [Please do not use ""].
@@ -873,6 +873,12 @@ For hf[] array FT_(U)INT* fields that need a 'valstringname_ext' struct, the
'strings' field would be set to '&valstringname_ext'. Furthermore, the 'display'
field must be ORed with 'BASE_EXT_STRING' (e.g. BASE_DEC|BASE_EXT_STRING).
+-- val64_string
+
+val64_strings are like value_strings, except that the integer type
+used is a guint64 (instead of guint32). Instead of using the VALS()
+macro for the 'strings' field in the header_field_info struct array,
+'VALS64()' is used.
-- Ranges
If the field has a numeric type that might logically fit in ranges of values
diff --git a/epan/address_to_str.c b/epan/address_to_str.c
index 167f5084e5..43d7c3953b 100644
--- a/epan/address_to_str.c
+++ b/epan/address_to_str.c
@@ -64,6 +64,9 @@
#include "emem.h"
#include "wmem/wmem.h"
+static void
+ip6_to_str_buf_len(const guchar* src, char *buf, size_t buf_len);
+
/*
* If a user _does_ pass in a too-small buffer, this is probably
* going to be too long to fit. However, even a partial string
@@ -125,6 +128,20 @@ ip6_to_str(const struct e_in6_addr *ad) {
ip6_to_str_buf(ad, str);
return str;
}
+/* XXX FIXME
+This exists solely for a single call from ui/iface_lists.c,
+scan_local_interfaces(), and gcc's -fstrict-aliasing. The iface_lists.c
+code should be change to used a different type for its ip6 address,
+so that this function is no longer needed.
+*/
+const gchar *
+ip6_guint8_to_str(const guint8 *ad) {
+ gchar *str;
+
+ str=(gchar *)ep_alloc(MAX_IP6_STR_LEN);
+ ip6_to_str_buf_len((const guchar*)ad, str, MAX_IP6_STR_LEN);
+ return str;
+}
#define IPV6_LENGTH 16
const gchar *
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index 086756235d..d2ad98ca40 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -614,7 +614,7 @@ void dfilter_macro_init(void) {
sizeof(dfilter_macro_t),
DFILTER_MACRO_FILENAME,
TRUE,
- (void**) &macros,
+ &macros,
&num_macros,
0, /* doesn't affect anything that requires a GUI update */
"ChDisplayFilterMacrosSection",
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 6293bf9105..d7375f0418 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -5411,7 +5411,7 @@ proto_register_ber(void)
sizeof(oid_user_t),
"oid",
FALSE,
- (void**) &oid_users,
+ &oid_users,
&num_oid_users,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChObjectIdentifiers",
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c
index 64d4c4d631..f9a8ea54e9 100644
--- a/epan/dissectors/packet-bgp.c
+++ b/epan/dissectors/packet-bgp.c
@@ -6620,7 +6620,7 @@ proto_register_bgp(void)
BASE_DEC, VALS(link_state_nlri_protocol_id_values), 0x0, NULL, HFILL }},
{ &hf_bgp_ls_nlri_node_identifier,
{ "Identifier", "bgp.ls.nlri_node.identifier", FT_UINT64,
- BASE_DEC | BASE_VAL64_STRING, VALS(link_state_nlri_routing_universe_values), 0x0, NULL, HFILL }},
+ BASE_DEC | BASE_VAL64_STRING, VALS64(link_state_nlri_routing_universe_values), 0x0, NULL, HFILL }},
{ &hf_bgp_ls_ipv4_topology_prefix_nlri_type,
{ "Link-State NLRI IPv4 Topology Prefix", "bgp.ls.ipv4_topology_prefix", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 8648b877d9..078264d8ee 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -6984,7 +6984,7 @@ proto_register_bootp(void)
sizeof(uat_bootp_record_t), /* record size */
"custom_bootp", /* filename */
TRUE, /* from_profile */
- (void**) &uat_bootp_records,/* data_ptr */
+ &uat_bootp_records, /* data_ptr */
&num_bootp_records_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 894b6aa83c..4689080794 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -1084,7 +1084,7 @@ proto_register_btrfcomm(void)
sizeof(uat_rfcomm_channels_t),
"rfcomm_channels",
TRUE,
- (void**) &rfcomm_channels,
+ &rfcomm_channels,
&num_rfcomm_channels,
UAT_AFFECTS_DISSECTION,
NULL,
diff --git a/epan/dissectors/packet-c1222.c b/epan/dissectors/packet-c1222.c
index 606cef559e..d3c503666f 100644
--- a/epan/dissectors/packet-c1222.c
+++ b/epan/dissectors/packet-c1222.c
@@ -2037,7 +2037,7 @@ void proto_register_c1222(void) {
sizeof(c1222_uat_data_t), /* record size */
"c1222_decryption_table", /* filename */
TRUE, /* from_profile */
- (void**)&c1222_uat_data, /* data_ptr */
+ &c1222_uat_data, /* data_ptr */
&num_c1222_uat_data, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c
index 42711aa07e..5deb11359d 100644
--- a/epan/dissectors/packet-collectd.c
+++ b/epan/dissectors/packet-collectd.c
@@ -1460,7 +1460,7 @@ void proto_register_collectd(void)
},
{ &hf_collectd_data_severity,
{ "Severity", "collectd.data.severity", FT_UINT64, BASE_HEX | BASE_VAL64_STRING,
- VALS(severity_names),
+ VALS64(severity_names),
0x0, NULL, HFILL }
},
{ &hf_collectd_data_message,
diff --git a/epan/dissectors/packet-devicenet.c b/epan/dissectors/packet-devicenet.c
index ed659fec64..250ad24c42 100644
--- a/epan/dissectors/packet-devicenet.c
+++ b/epan/dissectors/packet-devicenet.c
@@ -1021,7 +1021,7 @@ void proto_register_devicenet(void)
sizeof(uat_devicenet_record_t), /* record size */
"devicenet_bodytypes", /* filename */
TRUE, /* from_profile */
- (void**) &uat_devicenet_records,/* data_ptr */
+ &uat_devicenet_records, /* data_ptr */
&num_devicenet_records_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index ea716f8378..2dd6e33f4a 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -4916,7 +4916,7 @@ void proto_register_dmp (void)
sizeof(dmp_security_class_t),
"dmp_security_classifications",
TRUE,
- (void**) &dmp_security_classes,
+ &dmp_security_classes,
&num_dmp_security_classes,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChDMPSecurityClassifications",
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 9d4acb6140..8d89f4cfe2 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -3329,7 +3329,7 @@ proto_register_dtls(void)
sizeof(ssldecrypt_assoc_t),
"dtlsdecrypttablefile", /* filename */
TRUE, /* from_profile */
- (void**) &dtlskeylist_uats, /* data_ptr */
+ &dtlskeylist_uats, /* data_ptr */
&ndtlsdecrypt, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChK12ProtocolsSection", /* TODO, need revision - help */
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index 26ac25e812..931fb728d6 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -1482,7 +1482,7 @@ void proto_register_ess(void) {
sizeof(ess_category_attributes_t),
"ess_category_attributes",
TRUE,
- (void**) &ess_category_attributes,
+ &ess_category_attributes,
&num_ess_category_attributes,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChEssCategoryAttributes",
diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c
index 1e4969dcdf..57a9cb9924 100644
--- a/epan/dissectors/packet-etsi_card_app_toolkit.c
+++ b/epan/dissectors/packet-etsi_card_app_toolkit.c
@@ -1522,7 +1522,7 @@ proto_register_card_app_toolkit(void)
},
{ &hf_ctlv_aid_rid,
{ "RID", "etsi_cat.comp_tlv.aid.rid",
- FT_UINT64, BASE_HEX|BASE_VAL64_STRING, VALS(aid_rid_vals), 0,
+ FT_UINT64, BASE_HEX|BASE_VAL64_STRING, VALS64(aid_rid_vals), 0,
NULL, HFILL },
},
{ &hf_ctlv_aid_pix_app_code_etsi,
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index f24d810278..eea72aa04a 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -3087,7 +3087,7 @@ proto_register_http(void)
sizeof(header_field_t),
"custom_http_header_fields",
TRUE,
- (void**) &header_fields,
+ &header_fields,
&num_header_fields,
/* specifies named fields, so affects dissection
and the set of named fields */
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 3b2ce7c9a4..d414ba8167 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -22012,7 +22012,7 @@ proto_register_ieee80211 (void)
sizeof(uat_wep_key_record_t), /* record size */
"80211_keys", /* filename */
TRUE, /* from_profile */
- (void**) &uat_wep_key_records,/* data_ptr */
+ &uat_wep_key_records, /* data_ptr */
&num_wepkeys_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index 385861ebb2..955e9167f4 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -2732,7 +2732,7 @@ void proto_register_ieee802154(void)
sizeof(static_addr_t), /* record size */
"802154_addresses", /* filename */
TRUE, /* from_profile */
- (void**)&static_addrs, /* data_ptr */
+ &static_addrs, /* data_ptr */
&num_static_addrs, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index fb6fe4c63e..772086bca2 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -1230,7 +1230,7 @@ proto_register_imf(void)
sizeof(header_field_t),
"imf_header_fields",
TRUE,
- (void**) &header_fields,
+ &header_fields,
&num_header_fields,
/* specifies named fields, so affects dissection
and the set of named fields */
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 40be4247f0..ef72c46c27 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -2216,7 +2216,7 @@ proto_register_ipsec(void)
sizeof(uat_esp_sa_record_t), /* record size */
"esp_sa", /* filename */
TRUE, /* from_profile */
- (void**) &uat_esp_sa_records, /* data_ptr */
+ &uat_esp_sa_records, /* data_ptr */
&num_sa_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index b668f6da10..7366b75831 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -6178,7 +6178,7 @@ proto_register_isakmp(void)
sizeof(ikev1_uat_data_key_t),
"ikev1_decryption_table",
TRUE,
- (void**)&ikev1_uat_data,
+ &ikev1_uat_data,
&num_ikev1_uat_data,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChIKEv1DecryptionSection",
@@ -6198,7 +6198,7 @@ proto_register_isakmp(void)
sizeof(ikev2_uat_data_t),
"ikev2_decryption_table",
TRUE,
- (void**)&ikev2_uat_data,
+ &ikev2_uat_data,
&num_ikev2_uat_data,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChIKEv2DecryptionSection",
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 85fb437412..4e76c18bde 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -466,7 +466,7 @@ proto_register_k12(void)
sizeof(k12_handles_t),
"k12_protos", /* filename */
TRUE, /* from_profile */
- (void**) &k12_handles, /* data_ptr */
+ &k12_handles, /* data_ptr */
&nk12_handles, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChK12ProtocolsSection", /* help */
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 99bdfb9020..caa323ecb0 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -5863,7 +5863,7 @@ void proto_register_ldap(void) {
sizeof(attribute_type_t),
"custom_ldap_attribute_types",
TRUE,
- (void**) &attribute_types,
+ &attribute_types,
&num_attribute_types,
/* specifies named fields, so affects dissection
and the set of named fields */
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 09308f8f61..e18ed94447 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -6896,7 +6896,7 @@ void proto_register_mac_lte(void)
sizeof(lcid_drb_mapping_t),
"drb_logchans",
TRUE,
- (void**) &lcid_drb_mappings,
+ &lcid_drb_mappings,
&num_lcid_drb_mappings,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"", /* TODO: is this ref to help manual? */
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index c06d1cfb63..0b4861ec65 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -2271,7 +2271,7 @@ static gint dissect_mq_sid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
{
guint8 iSIDL;
guint8 iSID;
- guint8 *sid_str;
+ char *sid_str;
gint bOffset = offset;
iSIDL = tvb_get_guint8(tvb, offset);
@@ -2284,7 +2284,7 @@ static gint dissect_mq_sid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
offset++;
if (iSID == MQ_MQSIDT_NT_SECURITY_ID)
{
- offset = dissect_nt_sid(tvb, offset, tree, "SID", (char **)&sid_str, -1);
+ offset = dissect_nt_sid(tvb, offset, tree, "SID", &sid_str, -1);
}
else
{
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index e8317566ec..2f6f42a34c 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -2562,7 +2562,7 @@ void proto_register_pdcp(void)
sizeof(uat_ue_keys_record_t), /* record size */
"pdcp_lte_ue_keys", /* filename */
TRUE, /* from_profile */
- (void**) &uat_ue_keys_records, /* data_ptr */
+ &uat_ue_keys_records, /* data_ptr */
&num_ue_keys_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index eb057ad636..7fd97942fa 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -1910,7 +1910,7 @@ void proto_register_pres(void) {
sizeof(pres_user_t),
"pres_context_list",
TRUE,
- (void**) &pres_users,
+ &pres_users,
&num_pres_users,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChPresContextList",
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index 026953f88a..af74237bb6 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -5907,7 +5907,7 @@ proto_register_reload(void)
sizeof(kind_t),
"reload_kindids", /* filename */
TRUE, /* from_profile */
- (void**) &kindidlist_uats, /* data_ptr */
+ &kindidlist_uats, /* data_ptr */
&nreloadkinds, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* Help section (currently a wiki page) */
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 9aa87d96d8..37b186ba1f 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -4069,7 +4069,7 @@ proto_register_sccp(void)
uat_t *users_uat = uat_new("SCCP Users Table", sizeof(sccp_user_t),
- "sccp_users", TRUE, (void**) &sccp_users,
+ "sccp_users", TRUE, &sccp_users,
&num_sccp_users, UAT_AFFECTS_DISSECTION,
"ChSccpUsers", sccp_users_copy_cb,
sccp_users_update_cb, sccp_users_free_cb,
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 50cdebf96d..1d8253cb31 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -4692,7 +4692,7 @@ proto_register_sctp(void)
sizeof(type_field_t),
"statistics_chunk_types",
TRUE,
- (void**) &type_fields,
+ &type_fields,
&num_type_fields,
0,
NULL,
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 72a799258a..10a1e57d89 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -3999,7 +3999,7 @@ void proto_register_snmp(void) {
sizeof(snmp_ue_assoc_t),
"snmp_users",
TRUE,
- (void**)&ueas,
+ &ueas,
&num_ueas,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChSNMPUsersSection",
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 64bfb5fba1..07cbd6e2ab 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -5501,7 +5501,7 @@ proto_register_ssl(void)
sizeof(ssldecrypt_assoc_t),
"ssl_keys", /* filename */
TRUE, /* from_profile */
- (void**) &sslkeylist_uats, /* data_ptr */
+ &sslkeylist_uats, /* data_ptr */
&nssldecrypt, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* Help section (currently a wiki page) */
diff --git a/epan/dissectors/packet-time.c b/epan/dissectors/packet-time.c
index 68cd241622..373ed50cd7 100644
--- a/epan/dissectors/packet-time.c
+++ b/epan/dissectors/packet-time.c
@@ -45,7 +45,13 @@ static int proto_time = -1;
static int hf_time_time = -1;
static gint ett_time = -1;
-static absolute_time_display_e time_display_type = ABSOLUTE_TIME_LOCAL;
+/* Instead of using absolute_time_display_e as the type for
+ * time_display_type, we use gint to avoid a type-punning problem
+ * with prefs_register_enum_preference(). This variable is also
+ * used with abs_time_secs_to_ep_str(), which _does_ take
+ * an absolute_time_display_e, but gcc doesn't complain about
+ * casting the gint to absolute_time_display_e */
+static gint time_display_type = ABSOLUTE_TIME_LOCAL;
/* This dissector works for TCP and UDP time packets */
#define TIME_PORT 37
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c
index 9ebd5b5718..2e77d37a5a 100644
--- a/epan/dissectors/packet-ua3g.c
+++ b/epan/dissectors/packet-ua3g.c
@@ -4405,7 +4405,7 @@ proto_register_ua3g(void)
{ &hf_ua3g_ip_device_routing_reset_parameter_l10n_name, { "L10N_Name", "ua3g.ip.reset.parameter.l10n_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_value, { "Value", "ua3g.ip.start_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_ip, { "IP", "ua3g.ip.start_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
- { &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_start_rtp_compressor), 0x0, NULL, HFILL }},
+ { &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_start_rtp_compressor), 0x0, NULL, HFILL }},
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, { "Enabler", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, { "Must Send QOS Tickets", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_uint, { "Value", "ua3g.ip.start_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@@ -4508,10 +4508,10 @@ proto_register_ua3g(void)
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, { "IP", "ua3g.ip.cs.cmd03.parameter.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip1, { "Type Of Equipment (first byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip1", FT_UINT8, BASE_DEC, VALS(cs_ip_device_routing_cmd03_first_byte_vals), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip2, { "Type Of Equipment (second byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip2", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_cmd03_second_byte_vals), 0x0, NULL, HFILL }},
- { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, { "Default Codec", "ua3g.ip.cs.cmd03.parameter.default_codec", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }},
+ { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, { "Default Codec", "ua3g.ip.cs.cmd03.parameter.default_codec", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, { "VAD", "ua3g.ip.cs.cmd03.parameter.vad", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, { "ECE", "ua3g.ip.cs.cmd03.parameter.ece", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
- { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }},
+ { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, { "Delay Distribution", "ua3g.ip.cs.cmd03.parameter.delay_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_delay_distribution_range_vals), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, { "Consecutive BFI", "ua3g.ip.cs.cmd03.parameter.consecutive_bfi", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_consecutive_bfi_range_vals), 0x0, NULL, HFILL }},
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, { "BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_bfi_distribution_range_vals), 0x0, NULL, HFILL }},
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index 1fa9b0cf57..42df092907 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -234,7 +234,7 @@ void proto_register_user_encap(void)
sizeof(user_encap_t),
"user_dlts",
TRUE,
- (void**) &encaps,
+ &encaps,
&num_encaps,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChUserDLTsSection",
diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c
index f57fa70747..17f69890ba 100644
--- a/epan/dissectors/packet-vcdu.c
+++ b/epan/dissectors/packet-vcdu.c
@@ -621,7 +621,7 @@ proto_register_vcdu(void)
sizeof(uat_channel_t),
"vcdu_bitstream_channels",
TRUE,
- (void**)&uat_bitchannels,
+ &uat_bitchannels,
&num_channels_uat,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL,
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index 8881b9c029..7724e9313b 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -1784,7 +1784,7 @@ proto_register_zbee_nwk_gp(void)
}
zbee_gp_sec_key_table_uat = uat_new("ZigBee GP Security Keys", sizeof(uat_key_record_t), "zigbee_gp_keys", TRUE,
- (void **)&gp_uat_key_records, &num_uat_key_records, UAT_AFFECTS_DISSECTION, NULL, uat_key_record_copy_cb,
+ &gp_uat_key_records, &num_uat_key_records, UAT_AFFECTS_DISSECTION, NULL, uat_key_record_copy_cb,
uat_key_record_update_cb, uat_key_record_free_cb, NULL, key_uat_fields);
prefs_register_uat_preference(gp_zbee_prefs, "gp_key_table", "Pre-configured GP Security Keys",
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index 2e90f9c6e1..72e848fdac 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -278,7 +278,7 @@ void zbee_security_register(module_t *zbee_prefs, int proto)
sizeof(uat_key_record_t),
"zigbee_pc_keys",
TRUE,
- (void**) &uat_key_records,
+ &uat_key_records,
&num_uat_key_records,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* TODO: ptr to help manual? */
diff --git a/epan/proto.h b/epan/proto.h
index 7a294f0c3b..b774b25d80 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -82,6 +82,9 @@ struct expert_field;
/** Make a const value_string[] look like a _value_string pointer, used to set header_field_info.strings */
#define VALS(x) (const struct _value_string*)(x)
+/** Make a const val64_string[] look like a _val64_string pointer, used to set header_field_info.strings */
+#define VALS64(x) (const struct _val64_string*)(x)
+
/** Make a const true_false_string[] look like a _true_false_string pointer, used to set header_field_info.strings */
#define TFS(x) (const struct true_false_string*)(x)
@@ -375,7 +378,7 @@ struct _header_field_info {
const char *abbrev; /**< [FIELDABBREV] abbreviated name of this field */
enum ftenum type; /**< [FIELDTYPE] field type, one of FT_ (from ftypes.h) */
int display; /**< [FIELDDISPLAY] one of BASE_, or field bit-width if FT_BOOLEAN and non-zero bitmask */
- const void *strings; /**< [FIELDCONVERT] value_string, range_string or true_false_string,
+ const void *strings; /**< [FIELDCONVERT] value_string, val64_string, range_string or true_false_string,
typically converted by VALS(), RVALS() or TFS().
If this is an FT_PROTOCOL then it points to the
associated protocol_t structure */
diff --git a/epan/to_str.h b/epan/to_str.h
index 19e3a552a2..ebc6f8d654 100644
--- a/epan/to_str.h
+++ b/epan/to_str.h
@@ -67,6 +67,8 @@ extern gchar* fcwwn_to_str (const guint8 *);
WS_DLL_PUBLIC const gchar* tvb_fc_to_str(tvbuff_t *tvb, const gint offset);
WS_DLL_PUBLIC gchar* tvb_fcwwn_to_str (tvbuff_t *tvb, const gint offset);
WS_DLL_PUBLIC const gchar* ip6_to_str(const struct e_in6_addr *);
+WS_DLL_PUBLIC const gchar* ip6_guint8_to_str(const guint8 *ad);
+
WS_DLL_PUBLIC const gchar* tvb_ip6_to_str(tvbuff_t *tvb, const gint offset);
void ip6_to_str_buf(const struct e_in6_addr *, gchar *);
extern gchar* ipx_addr_to_str(const guint32, const guint8 *);
diff --git a/epan/uat.c b/epan/uat.c
index a2db7e1874..f9b4ce81f5 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -58,7 +58,7 @@ uat_t* uat_new(const char* name,
size_t size,
const char* filename,
gboolean from_profile,
- void** data_ptr,
+ void* data_ptr,
guint* numitems_ptr,
guint flags,
const char* help,
@@ -85,7 +85,12 @@ uat_t* uat_new(const char* name,
uat->record_size = size;
uat->filename = g_strdup(filename);
uat->from_profile = from_profile;
- uat->user_ptr = data_ptr;
+ /* Callers of uat_new() pass in (void*) for data_ptr, because
+ * that is the "universal" pointer type that can be cast to
+ * anything. However, for our purposes, we want a (void**).
+ * So, we cast (void*) data_ptr to (void**) here. That keeps
+ * gcc -fstrict-aliasing from complaining. */
+ uat->user_ptr = (void**) data_ptr;
uat->nrows_p = numitems_ptr;
uat->copy_cb = copy_cb;
uat->update_cb = update_cb;
@@ -115,7 +120,7 @@ uat_t* uat_new(const char* name,
uat->ncols = i;
- *data_ptr = NULL;
+ *((void**)data_ptr) = NULL;
*numitems_ptr = 0;
return uat;
diff --git a/epan/uat.h b/epan/uat.h
index f127d27420..de0525b728 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -245,7 +245,7 @@ typedef struct _uat_field_t {
* @param size The size of the structure
* @param filename The filename to be used (either in userdir or datadir)
* @param from_profile TRUE if profile directory to be used
- * @param data_ptr A pointer to a null terminated array of pointers to the data
+ * @param data_ptr Although a void*, this is really a pointer to a null terminated array of pointers to the data
* @param num_items_ptr A pointer with number of items
* @param flags flags indicating what this UAT affects
* @param help A pointer to help text
@@ -262,7 +262,7 @@ uat_t* uat_new(const char* name,
size_t size,
const char* filename,
gboolean from_profile,
- void** data_ptr,
+ void* data_ptr,
guint* num_items_ptr,
guint flags,
const char* help,
diff --git a/plugins/stats_tree/pinfo_stats_tree.c b/plugins/stats_tree/pinfo_stats_tree.c
index 1ee31eb0ad..5ebc9367f5 100644
--- a/plugins/stats_tree/pinfo_stats_tree.c
+++ b/plugins/stats_tree/pinfo_stats_tree.c
@@ -248,7 +248,7 @@ void register_pinfo_stat_trees(void) {
sizeof(uat_plen_record_t), /* record size */
"packet_lengths", /* filename */
TRUE, /* from_profile */
- (void**) &uat_plen_records, /* data_ptr */
+ &uat_plen_records, /* data_ptr */
&num_plen_uat, /* numitems_ptr */
0, /* not a dissector, so affects neither dissection nor fields */
NULL, /* help */
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index 378297edcb..caccbfb419 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -176,7 +176,7 @@ scan_local_interfaces(void (*update_cb)(void))
break;
case IF_AT_IPv6:
memcpy(temp_addr->addr.ip6_addr, addr->addr.ip6_addr, sizeof(addr->addr));
- g_string_append(ip_str, ip6_to_str((struct e_in6_addr *)&addr->addr.ip6_addr));
+ g_string_append(ip_str, ip6_guint8_to_str(addr->addr.ip6_addr));
break;
default:
/* In case we add non-IP addresses */