aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-08 23:16:06 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-08 23:16:06 +0000
commitf91eba752b3e34489951e507c54df36fee1feee4 (patch)
treef877c8a4726be1654389b4408a048f7ddd3e5eb4
parent2b0797a3618218d2d08a04fcbdd9261657af153a (diff)
Fix some warnings: cast discards `__attribute__((const))' qualifier from pointer target type
svn path=/trunk/; revision=53875
-rw-r--r--epan/address.h2
-rw-r--r--epan/dissectors/packet-6lowpan.c8
-rw-r--r--epan/dissectors/packet-9p.c2
-rw-r--r--epan/dissectors/packet-ipsec.c2
-rw-r--r--epan/uat.h14
-rw-r--r--ui/gtk/export_pdu_dlg.c2
-rw-r--r--ui/gtk/fc_stat.c2
-rw-r--r--ui/gtk/gtp_stat.c2
-rw-r--r--ui/gtk/hostlist_tcpip.c2
-rw-r--r--ui/gtk/hostlist_tr.c2
-rw-r--r--ui/gtk/ldap_stat.c2
-rw-r--r--ui/gtk/mcast_stream.c4
-rw-r--r--ui/gtk/mtp3_stat.c2
13 files changed, 23 insertions, 23 deletions
diff --git a/epan/address.h b/epan/address.h
index 45b5ffc321..96561dd4d0 100644
--- a/epan/address.h
+++ b/epan/address.h
@@ -105,7 +105,7 @@ set_address(address *addr, address_type addr_type, int addr_len, const void * ad
*/
#define TVB_SET_ADDRESS(addr, addr_type, tvb, offset, addr_len) \
do { \
- const void *TVB_SET_ADDRESS_data = (void *)tvb_get_ptr(tvb, offset, addr_len); \
+ const void *TVB_SET_ADDRESS_data = (const void *)tvb_get_ptr(tvb, offset, addr_len); \
set_address((addr), (addr_type), (addr_len), TVB_SET_ADDRESS_data); \
} while (0)
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index ded3325155..03c2274072 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -517,7 +517,7 @@ lowpan_pfxcpy(void *dst, const void *src, size_t bits)
memcpy(dst, src, bits>>3);
if (bits & 0x7) {
guint8 mask = ((0xff00) >> (bits & 0x7));
- guint8 last = ((guint8 *)src)[bits>>3] & mask;
+ guint8 last = ((const guint8 *)src)[bits>>3] & mask;
((guint8 *)dst)[bits>>3] &= ~mask;
((guint8 *)dst)[bits>>3] |= last;
}
@@ -537,7 +537,7 @@ lowpan_pfxcpy(void *dst, const void *src, size_t bits)
static guint
lowpan_context_hash(gconstpointer key)
{
- return (((lowpan_context_key *)key)->cid) | (((lowpan_context_key *)key)->pan << 8);
+ return (((const lowpan_context_key *)key)->cid) | (((const lowpan_context_key *)key)->pan << 8);
} /* lowpan_context_hash */
/*FUNCTION:------------------------------------------------------
@@ -554,8 +554,8 @@ lowpan_context_hash(gconstpointer key)
static gboolean
lowpan_context_equal(gconstpointer a, gconstpointer b)
{
- return (((lowpan_context_key *)a)->pan == ((lowpan_context_key *)b)->pan) &&
- (((lowpan_context_key *)a)->cid == ((lowpan_context_key *)b)->cid);
+ return (((const lowpan_context_key *)a)->pan == ((const lowpan_context_key *)b)->pan) &&
+ (((const lowpan_context_key *)a)->cid == ((const lowpan_context_key *)b)->cid);
} /* lowpan_context_equal */
/*FUNCTION:------------------------------------------------------
diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c
index 09348810ab..a9debe7134 100644
--- a/epan/dissectors/packet-9p.c
+++ b/epan/dissectors/packet-9p.c
@@ -996,7 +996,7 @@ struct _9p_taginfo {
};
static gint _9p_hash_equal(gconstpointer k1, gconstpointer k2) {
- const struct _9p_hashkey *key1 = (struct _9p_hashkey *)k1, *key2 = (struct _9p_hashkey *)k2;
+ const struct _9p_hashkey *key1 = (const struct _9p_hashkey *)k1, *key2 = (const struct _9p_hashkey *)k2;
return ((key1->conv_index == key2->conv_index) && (key1->tag == key2->tag) && (key1->fid == key2->fid));
}
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 1a115aad10..c7af580567 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -230,7 +230,7 @@ static guint num_sa_uat = 0;
static void* uat_esp_sa_record_copy_cb(void* n, const void* o, size_t siz _U_) {
uat_esp_sa_record_t* new_rec = (uat_esp_sa_record_t *)n;
- const uat_esp_sa_record_t* old_rec = (uat_esp_sa_record_t *)o;
+ const uat_esp_sa_record_t* old_rec = (const uat_esp_sa_record_t *)o;
new_rec->srcIP = (old_rec->srcIP) ? g_strdup(old_rec->srcIP) : NULL;
new_rec->dstIP = (old_rec->dstIP) ? g_strdup(old_rec->dstIP) : NULL;
diff --git a/epan/uat.h b/epan/uat.h
index dc2f09e10c..682c4b1e2c 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -500,16 +500,16 @@ static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, g
guint i; \
char* str = ep_strndup(buf,len); \
const char* cstr; ((rec_t*)rec)->field_name = default_val; \
- for(i=0; ( cstr = ((value_string*)vs)[i].strptr ) ;i++) { \
+ for(i=0; ( cstr = ((const value_string*)vs)[i].strptr ) ;i++) { \
if (g_str_equal(cstr,str)) { \
- ((rec_t*)rec)->field_name = (default_t)((value_string*)vs)[i].value; return; } } } \
+ ((rec_t*)rec)->field_name = (default_t)((const value_string*)vs)[i].value; return; } } } \
static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, const void* vs, const void* u2 _U_) {\
guint i; \
*out_ptr = ep_strdup(default_str); \
*out_len = (unsigned)strlen(default_str);\
- for(i=0;((value_string*)vs)[i].strptr;i++) { \
- if ( ((value_string*)vs)[i].value == ((rec_t*)rec)->field_name ) { \
- *out_ptr = ep_strdup(((value_string*)vs)[i].strptr); \
+ for(i=0;((const value_string*)vs)[i].strptr;i++) { \
+ if ( ((const value_string*)vs)[i].value == ((rec_t*)rec)->field_name ) { \
+ *out_ptr = ep_strdup(((const value_string*)vs)[i].strptr); \
*out_len = (unsigned)strlen(*out_ptr); return; } } }
#define UAT_VS_CSTRING_DEF(basename,field_name,rec_t,default_val,default_str) \
@@ -517,9 +517,9 @@ static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, g
guint i; \
char* str = ep_strndup(buf,len); \
const char* cstr; ((rec_t*)rec)->field_name = default_val; \
- for(i=0; ( cstr = ((value_string*)vs)[i].strptr ) ;i++) { \
+ for(i=0; ( cstr = ((const value_string*)vs)[i].strptr ) ;i++) { \
if (g_str_equal(cstr,str)) { \
- ((rec_t*)rec)->field_name = g_strdup(((value_string*)vs)[i].strptr); return; } } } \
+ ((rec_t*)rec)->field_name = g_strdup(((const value_string*)vs)[i].strptr); return; } } } \
static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, const void* vs _U_, const void* u2 _U_) {\
if (((rec_t*)rec)->field_name ) { \
*out_ptr = (((rec_t*)rec)->field_name); \
diff --git a/ui/gtk/export_pdu_dlg.c b/ui/gtk/export_pdu_dlg.c
index 046bd5483e..18049bc79d 100644
--- a/ui/gtk/export_pdu_dlg.c
+++ b/ui/gtk/export_pdu_dlg.c
@@ -65,7 +65,7 @@ typedef struct _exp_pdu_t {
static int
export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data)
{
- const exp_pdu_data_t *exp_pdu_data = (exp_pdu_data_t *)data;
+ const exp_pdu_data_t *exp_pdu_data = (const exp_pdu_data_t *)data;
exp_pdu_t *exp_pdu_tap_data = (exp_pdu_t *)tapdata;
struct wtap_pkthdr pkthdr;
int err;
diff --git a/ui/gtk/fc_stat.c b/ui/gtk/fc_stat.c
index e84d7b3cb6..093667643e 100644
--- a/ui/gtk/fc_stat.c
+++ b/ui/gtk/fc_stat.c
@@ -73,7 +73,7 @@ fcstat_reset(void *pfc)
static int
fcstat_packet(void *pfc, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{
- const fc_hdr *fc=(fc_hdr *)psi;
+ const fc_hdr *fc=(const fc_hdr *)psi;
fcstat_t *fs=(fcstat_t *)pfc;
/* we are only interested in reply packets */
diff --git a/ui/gtk/gtp_stat.c b/ui/gtk/gtp_stat.c
index 17e6a15cc9..f230d5f206 100644
--- a/ui/gtk/gtp_stat.c
+++ b/ui/gtk/gtp_stat.c
@@ -72,7 +72,7 @@ gtpstat_reset(void *pgtp)
static int
gtpstat_packet(void *pgtp, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{
- const gtp_msg_hash_t *gtp=(gtp_msg_hash_t *)psi;
+ const gtp_msg_hash_t *gtp=(const gtp_msg_hash_t *)psi;
gtpstat_t *fs=(gtpstat_t *)pgtp;
int idx=0;
diff --git a/ui/gtk/hostlist_tcpip.c b/ui/gtk/hostlist_tcpip.c
index 3acb3b7344..1e78fb0e6c 100644
--- a/ui/gtk/hostlist_tcpip.c
+++ b/ui/gtk/hostlist_tcpip.c
@@ -42,7 +42,7 @@ static int
tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
{
hostlist_table *hosts=(hostlist_table *)pit;
- const struct tcpheader *tcphdr=(struct tcpheader *)vip;
+ const struct tcpheader *tcphdr=(const struct tcpheader *)vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
diff --git a/ui/gtk/hostlist_tr.c b/ui/gtk/hostlist_tr.c
index 12865da693..4aa72b409e 100644
--- a/ui/gtk/hostlist_tr.c
+++ b/ui/gtk/hostlist_tr.c
@@ -42,7 +42,7 @@ static int
tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
{
hostlist_table *hosts=(hostlist_table *)pit;
- const tr_hdr *trhdr=(tr_hdr *)vip;
+ const tr_hdr *trhdr=(const tr_hdr *)vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
diff --git a/ui/gtk/ldap_stat.c b/ui/gtk/ldap_stat.c
index c2f9a6f0ce..398bfc37e0 100644
--- a/ui/gtk/ldap_stat.c
+++ b/ui/gtk/ldap_stat.c
@@ -71,7 +71,7 @@ ldapstat_reset(void *pldap)
static int
ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{
- const ldap_call_response_t *ldap=(ldap_call_response_t *)psi;
+ const ldap_call_response_t *ldap=(const ldap_call_response_t *)psi;
ldapstat_t *fs=(ldapstat_t *)pldap;
/* we are only interested in reply packets */
diff --git a/ui/gtk/mcast_stream.c b/ui/gtk/mcast_stream.c
index be18eed9fe..77a76ebede 100644
--- a/ui/gtk/mcast_stream.c
+++ b/ui/gtk/mcast_stream.c
@@ -176,8 +176,8 @@ mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const
* address (for IPv6).
*/
if ((pinfo->dl_dst.type != AT_ETHER) ||
- ((g_ascii_strncasecmp("01005E", bytes_to_str((guint8 *)pinfo->dl_dst.data, pinfo->dl_dst.len), 6) != 0) &&
- (g_ascii_strncasecmp("3333", bytes_to_str((guint8 *)pinfo->dl_dst.data, pinfo->dl_dst.len), 4) != 0)) )
+ ((g_ascii_strncasecmp("01005E", bytes_to_str((const guint8 *)pinfo->dl_dst.data, pinfo->dl_dst.len), 6) != 0) &&
+ (g_ascii_strncasecmp("3333", bytes_to_str((const guint8 *)pinfo->dl_dst.data, pinfo->dl_dst.len), 4) != 0)) )
return 0;
/* check whether we already have a stream with these parameters in the list */
diff --git a/ui/gtk/mtp3_stat.c b/ui/gtk/mtp3_stat.c
index afa4228401..efbd03625b 100644
--- a/ui/gtk/mtp3_stat.c
+++ b/ui/gtk/mtp3_stat.c
@@ -235,7 +235,7 @@ mtp3_stat_packet(
const void *data)
{
mtp3_stat_t (*stat_p)[MTP3_MAX_NUM_OPC_DPC] = (mtp3_stat_t(*)[MTP3_MAX_NUM_OPC_DPC])tapdata;
- const mtp3_tap_rec_t *data_p = (mtp3_tap_rec_t *)data;
+ const mtp3_tap_rec_t *data_p = (const mtp3_tap_rec_t *)data;
int i;
if (data_p->si_code >= MTP3_NUM_SI_CODE)