aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address_to_str.c
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 /epan/address_to_str.c
parent479d27c69e46add652acbdd321fd3f88cfb50900 (diff)
downloadwireshark-4cc694839d45d767f4880988da3b88389774b5db.tar.gz
wireshark-4cc694839d45d767f4880988da3b88389774b5db.tar.bz2
wireshark-4cc694839d45d767f4880988da3b88389774b5db.zip
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>
Diffstat (limited to 'epan/address_to_str.c')
-rw-r--r--epan/address_to_str.c17
1 files changed, 17 insertions, 0 deletions
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 *