forked from osmocom/wireshark
Fix some warnings: cast discards `__attribute__((const))' qualifier from pointer target type
svn path=/trunk/; revision=53875
This commit is contained in:
parent
2b0797a361
commit
f91eba752b
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:------------------------------------------------------
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
14
epan/uat.h
14
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); \
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue