aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-11-30 07:14:44 +0000
committerGuy Harris <guy@alum.mit.edu>2016-01-03 01:27:47 +0000
commit4473c676464805faf474a50fc076457ccf826234 (patch)
treeedbce62fbfb67e42e495fd4e54c48c2bd5ea4310 /epan
parentf9df9ffb3fd479e3d0bd1bde7ca299ce5bd1872b (diff)
Fix some constness issues [-Wcast-qual]
Change-Id: I111558df3d36436ddf5e2728f113b022cc48a713 Reviewed-on: https://code.wireshark.org/review/13013 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/addr_resolv.c4
-rw-r--r--epan/addr_resolv.h4
-rw-r--r--epan/dissectors/packet-ismp.c13
-rw-r--r--epan/proto.c2
4 files changed, 13 insertions, 10 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 4de34637db..9a4a275248 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -2990,7 +2990,7 @@ tvb_get_ether_name(tvbuff_t *tvb, gint offset)
/* Look for a (non-dummy) ether name in the hash, and return it if found.
* If it's not found, simply return NULL.
*/
-gchar *
+const gchar *
get_ether_name_if_known(const guint8 *addr)
{
hashether_t *tp;
@@ -3050,7 +3050,7 @@ ipxnet_to_str_punct(wmem_allocator_t *scope, const guint32 ad, const char punct)
return buf;
}
-const gchar *
+gchar *
get_ipxnet_name(wmem_allocator_t *allocator, const guint32 addr)
{
diff --git a/epan/addr_resolv.h b/epan/addr_resolv.h
index adce91168b..28a03f873f 100644
--- a/epan/addr_resolv.h
+++ b/epan/addr_resolv.h
@@ -192,7 +192,7 @@ WS_DLL_PUBLIC gchar *get_ether_name(const guint8 *addr);
WS_DLL_PUBLIC gchar *tvb_get_ether_name(tvbuff_t *tvb, gint offset);
/* get_ether_name returns the logical name if found in ethers files else NULL */
-gchar *get_ether_name_if_known(const guint8 *addr);
+const gchar *get_ether_name_if_known(const guint8 *addr);
/*
* Given a sequence of 3 octets containing an OID, get_manuf_name()
@@ -238,7 +238,7 @@ extern const gchar *eui64_to_display(wmem_allocator_t *allocator, const guint64
/* get_ipxnet_name returns the logical name if found in an ipxnets file,
* or a string formatted with "%X" if not */
-extern const gchar *get_ipxnet_name(wmem_allocator_t *allocator, const guint32 addr);
+extern gchar *get_ipxnet_name(wmem_allocator_t *allocator, const guint32 addr);
WS_DLL_PUBLIC guint get_hash_ether_status(hashether_t* ether);
WS_DLL_PUBLIC char* get_hash_ether_hexaddr(hashether_t* ether);
diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c
index 4e1527c7ee..f1da6d73f6 100644
--- a/epan/dissectors/packet-ismp.c
+++ b/epan/dissectors/packet-ismp.c
@@ -219,17 +219,20 @@ static const value_string edp_tuple_types[] =
static gchar*
ipx_addr_to_str(const guint32 net, const guint8 *ad)
{
- gchar *buf;
- char *name;
+ gchar *buf;
+ const gchar *name;
name = get_ether_name_if_known(ad);
if (name) {
- buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(wmem_packet_scope(), net), name);
+ buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s",
+ get_ipxnet_name(wmem_packet_scope(), net),
+ name);
}
else {
- buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(wmem_packet_scope(), net),
- bytestring_to_str(wmem_packet_scope(), ad, 6, '\0'));
+ buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s",
+ get_ipxnet_name(wmem_packet_scope(), net),
+ bytestring_to_str(wmem_packet_scope(), ad, 6, '\0'));
}
return buf;
}
diff --git a/epan/proto.c b/epan/proto.c
index f9fab2d91c..bdb02be6d8 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -6769,7 +6769,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_IPXNET:
integer = fvalue_get_uinteger(&fi->value);
- tmp = (char*)get_ipxnet_name(NULL, integer);
+ tmp = get_ipxnet_name(NULL, integer);
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %s (0x%08X)", hfinfo->name,
tmp, integer);