diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-14 14:33:46 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-14 14:33:46 +0000 |
commit | e0e86bab5a246069f6b51bf552b6bc2564136b4b (patch) | |
tree | f0ba66660da68048d7baaa14aa1e1f2ab4981a8d | |
parent | 2754c08d932d20fff1aca664dd925d63e1e46ff3 (diff) |
Fix const warnings.
svn path=/trunk/; revision=54092
29 files changed, 49 insertions, 46 deletions
diff --git a/epan/address.h b/epan/address.h index 96561dd4d0..cfecfb2e9c 100644 --- a/epan/address.h +++ b/epan/address.h @@ -146,7 +146,7 @@ set_address_hf(address *addr, address_type addr_type, int addr_len, const void * */ #define TVB_SET_ADDRESS_HF(addr, addr_type, tvb, offset, addr_len, addr_hf) \ 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_hf((addr), (addr_type), (addr_len), TVB_SET_ADDRESS_data, (addr_hf)); \ } while (0) diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index 3e223013d8..2a28c82dd2 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -914,14 +914,14 @@ enip_open_cip_connection( packet_info *pinfo, cip_conn_info_t* connInfo) if ((connInfo->O2T.port == 0) || (connInfo->O2T.type == CONN_TYPE_MULTICAST)) connInfo->O2T.port = ENIP_IO_PORT; if ((connInfo->O2T.ipaddress.type == AT_NONE) || - ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->O2T.ipaddress.data)) == 0) || + ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->O2T.ipaddress.data)) == 0) || ((connInfo->O2T.ipaddress.type == AT_IPv6) && (memcmp(connInfo->O2T.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) || (connInfo->O2T.type != CONN_TYPE_MULTICAST)) connInfo->O2T.ipaddress = pinfo->src; if ((connInfo->T2O.port == 0) || (connInfo->T2O.type == CONN_TYPE_MULTICAST)) connInfo->T2O.port = ENIP_IO_PORT; if ((connInfo->T2O.ipaddress.type == AT_NONE) || - ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->T2O.ipaddress.data)) == 0) || + ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->T2O.ipaddress.data)) == 0) || ((connInfo->T2O.ipaddress.type == AT_IPv6) && (memcmp(connInfo->T2O.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) || (connInfo->T2O.type != CONN_TYPE_MULTICAST)) connInfo->T2O.ipaddress = pinfo->dst; diff --git a/epan/dissectors/packet-hartip.c b/epan/dissectors/packet-hartip.c index 61543522b8..14f650bf77 100644 --- a/epan/dissectors/packet-hartip.c +++ b/epan/dissectors/packet-hartip.c @@ -297,9 +297,9 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, hartip_message_id_values, "Unknown message %d"); - tick_stat_node(st, (guint8*)st_str_packets, 0, FALSE); - tick_stat_node(st, (guint8*)message_type_node_str, st_node_packets, FALSE); - tick_stat_node(st, (guint8*)message_id_node_str, message_type_node, FALSE); + tick_stat_node(st, st_str_packets, 0, FALSE); + tick_stat_node(st, message_type_node_str, st_node_packets, FALSE); + tick_stat_node(st, message_id_node_str, message_type_node, FALSE); return 1; } diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c index f9e17705f8..d8caf61e5a 100644 --- a/epan/dissectors/packet-iec104.c +++ b/epan/dissectors/packet-iec104.c @@ -713,9 +713,9 @@ static proto_item* get_InfoObjectAddress(guint32 *asdu_info_obj_addr, tvbuff_t * static guint8 get_TypeIdLength(guint8 TypeId) { guint8 ret = 0; - td_asdu_length *item; + const td_asdu_length *item; - item = (td_asdu_length *)asdu_length; + item = asdu_length; while (item->value) { if (item->value == TypeId) diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index db50f25348..7cae8f111c 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -872,14 +872,14 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld) guint16 it_len; guint32 present, xpresent; guint8 rflags; - struct ieee80211_radiotap_header *hdr; + const struct ieee80211_radiotap_header *hdr; if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(struct ieee80211_radiotap_header))) { ld->other++; return; } - hdr = (struct ieee80211_radiotap_header *)pd; + hdr = (const struct ieee80211_radiotap_header *)pd; it_len = pletoh16(&hdr->it_len); if (!BYTES_ARE_IN_FRAME(offset, len, it_len)) { ld->other++; diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index 4704408c93..85478e2127 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -1243,15 +1243,18 @@ static GHashTable *mac_lte_drx_frame_result = NULL; static gint mac_lte_framenum_instance_hash_equal(gconstpointer v, gconstpointer v2) { - drx_state_key_t *p1 = (drx_state_key_t*)v; - drx_state_key_t *p2 = (drx_state_key_t*)v2; + const drx_state_key_t *p1 = (const drx_state_key_t*)v; + const drx_state_key_t *p2 = (const drx_state_key_t*)v2; + return ((p1->frameNumber == p2->frameNumber) && (p1->pdu_instance == p2->pdu_instance)); } static guint mac_lte_framenum_instance_hash_func(gconstpointer v) { - drx_state_key_t *p1 = (drx_state_key_t*)v; + const drx_state_key_t *p1 = (const drx_state_key_t*)v; + + /* XXX which one return ? */ return p1->frameNumber + (p1->pdu_instance >> 8); return GPOINTER_TO_UINT(v); } diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index 9abfbb6c5f..0d64a345c5 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -5562,8 +5562,8 @@ static v9_v10_tmplt_t *v9_v10_tmplt_build_key(v9_v10_tmplt_t *tmplt_p, packet_in static gboolean v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2) { - const v9_v10_tmplt_t *ta = (v9_v10_tmplt_t *)k1; - const v9_v10_tmplt_t *tb = (v9_v10_tmplt_t *)k2; + const v9_v10_tmplt_t *ta = (const v9_v10_tmplt_t *)k1; + const v9_v10_tmplt_t *tb = (const v9_v10_tmplt_t *)k2; return ( (CMP_ADDRESS(&ta->src_addr, &tb->src_addr) == 0) && @@ -5578,7 +5578,7 @@ v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2) static guint v9_v10_tmplt_table_hash(gconstpointer k) { - const v9_v10_tmplt_t *tmplt_p = (v9_v10_tmplt_t *)k; + const v9_v10_tmplt_t *tmplt_p = (const v9_v10_tmplt_t *)k; guint32 val; val = tmplt_p->src_id + (tmplt_p->tmplt_id << 9) + tmplt_p->src_port + tmplt_p->dst_port; diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c index ae843d31d2..03178158f3 100644 --- a/epan/dissectors/packet-smpp.c +++ b/epan/dissectors/packet-smpp.c @@ -1124,7 +1124,7 @@ smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ epan_dissect_t *edt _U_, const void *p) /* Used for getting SMPP command_id values */ { - smpp_tap_rec_t* tap_rec = (smpp_tap_rec_t*)p; + const smpp_tap_rec_t* tap_rec = (const smpp_tap_rec_t*)p; tick_stat_node(st, "SMPP Operations", 0, TRUE); diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c index b0256ede87..416a5f885d 100644 --- a/epan/dissectors/packet-socks.c +++ b/epan/dissectors/packet-socks.c @@ -1120,7 +1120,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { if (hash_info->dst_addr.type == AT_IPv4) { ti = proto_tree_add_ipv4( socks_tree, hf_socks_ip_dst, tvb, - offset, 0, *((guint32*)hash_info->dst_addr.data)); + offset, 0, *((const guint32*)hash_info->dst_addr.data)); PROTO_ITEM_SET_GENERATED(ti); } else if (hash_info->dst_addr.type == AT_IPv6) { ti = proto_tree_add_ipv6( socks_tree, hf_socks_ip6_dst, tvb, diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 214fa430ee..58bac2df2b 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -4460,9 +4460,9 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* We haven't turned checksum checking off; checksum it. */ /* Set up the fields of the pseudo-header. */ - cksum_vec[0].ptr = (guint8 *)pinfo->src.data; + cksum_vec[0].ptr = (const guint8 *)pinfo->src.data; cksum_vec[0].len = pinfo->src.len; - cksum_vec[1].ptr = (guint8 *)pinfo->dst.data; + cksum_vec[1].ptr = (const guint8 *)pinfo->dst.data; cksum_vec[1].len = pinfo->dst.len; cksum_vec[2].ptr = (const guint8 *)phdr; switch (pinfo->src.type) { diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c index 483ea73ade..6b7538260d 100644 --- a/epan/dissectors/packet-tr.c +++ b/epan/dissectors/packet-tr.c @@ -516,11 +516,11 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(bf_tree, hf_tr_fc_type, tr_tvb, 1, 1, trh->fc); proto_tree_add_uint(bf_tree, hf_tr_fc_pcf, tr_tvb, 1, 1, trh->fc); - proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (guint8 *)trh->dst.data); - proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (guint8 *)trh->src.data); - hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (guint8 *)trh->dst.data); + proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (const guint8 *)trh->dst.data); + proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (const guint8 *)trh->src.data); + hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (const guint8 *)trh->dst.data); PROTO_ITEM_SET_HIDDEN(hidden_item); - hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (guint8 *)trh->src.data); + hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (const guint8 *)trh->src.data); PROTO_ITEM_SET_HIDDEN(hidden_item); proto_tree_add_boolean(tr_tree, hf_tr_sr, tr_tvb, 8, 1, source_routed); diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c index 25eea68e9c..06d60e2c77 100644 --- a/epan/dissectors/packet-ucp.c +++ b/epan/dissectors/packet-ucp.c @@ -670,7 +670,7 @@ ucp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ epan_dissect_t *edt _U_, const void *p) /* Used for getting UCP stats */ { - ucp_tap_rec_t *tap_rec = (ucp_tap_rec_t*)p; + const ucp_tap_rec_t *tap_rec = (const ucp_tap_rec_t*)p; tick_stat_node(st, st_str_ucp, 0, TRUE); diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c index a6682565b6..abab51268b 100644 --- a/epan/dissectors/packet-wbxml.c +++ b/epan/dissectors/packet-wbxml.c @@ -7522,7 +7522,7 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset, DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off)); idx = tvb_get_guintvar (tvb, off+1, &tag_len); str_len = tvb_strsize (tvb, str_tbl+idx); - tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len); + tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len); tag_new_known = 0; /* invalidate known tag_new */ } else { /* Known tag */ tag_new_known = peek & 0x3F; @@ -7908,7 +7908,7 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset, " - TableRef follows!\n", peek, off)); idx = tvb_get_guintvar (tvb, off+1, &tag_len); str_len = tvb_strsize (tvb, str_tbl+idx); - tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len); + tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len); tag_new_known = 0; /* invalidate known tag_new */ } else { /* Known tag */ tag_new_known = peek & 0x3F; diff --git a/ui/gtk/compare_stat.c b/ui/gtk/compare_stat.c index 4b2f15fe1b..3687e66917 100644 --- a/ui/gtk/compare_stat.c +++ b/ui/gtk/compare_stat.c @@ -186,7 +186,7 @@ static int comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2) { compstat_t *cs=(compstat_t *)arg; - const ws_ip *ci=(ws_ip *)arg2; + const ws_ip *ci=(const ws_ip *)arg2; frame_info *fInfo, *fInfoTemp; vec_t cksum_vec[3]; guint16 computed_cksum=0; @@ -204,7 +204,7 @@ comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const cksum_vec[1].ptr=&ci->ip_p; cksum_vec[1].len=1; /* skip header checksum and ip's (because of NAT)*/ - cksum_vec[2].ptr=(guint8 *)ci->ip_dst.data; + cksum_vec[2].ptr=(const guint8 *)ci->ip_dst.data; cksum_vec[2].ptr=cksum_vec[2].ptr+ci->ip_dst.len; /* dynamic computation */ cksum_vec[2].len=ci->ip_len-20; diff --git a/ui/gtk/diameter_stat.c b/ui/gtk/diameter_stat.c index c0cd20f452..c4603418c5 100644 --- a/ui/gtk/diameter_stat.c +++ b/ui/gtk/diameter_stat.c @@ -77,7 +77,7 @@ diameterstat_reset(void *pdiameter) static int diameterstat_packet(void *pdiameter, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pdi) { - const diameter_req_ans_pair_t *diameter=(diameter_req_ans_pair_t *)pdi; + const diameter_req_ans_pair_t *diameter=(const diameter_req_ans_pair_t *)pdi; diameterstat_t *fs=(diameterstat_t *)pdiameter; int* idx = NULL; diff --git a/ui/gtk/gsm_a_stat.c b/ui/gtk/gsm_a_stat.c index f21304451a..a2f06a77da 100644 --- a/ui/gtk/gsm_a_stat.c +++ b/ui/gtk/gsm_a_stat.c @@ -204,7 +204,7 @@ gsm_a_stat_packet( const void *data) { gsm_a_stat_t *stat_p = (gsm_a_stat_t *)tapdata; - const gsm_a_tap_rec_t *data_p = (gsm_a_tap_rec_t *)data; + const gsm_a_tap_rec_t *data_p = (const gsm_a_tap_rec_t *)data; switch (data_p->pdu_type) { diff --git a/ui/gtk/gsm_map_stat.c b/ui/gtk/gsm_map_stat.c index c736a939b1..44aed65725 100644 --- a/ui/gtk/gsm_map_stat.c +++ b/ui/gtk/gsm_map_stat.c @@ -291,7 +291,7 @@ gsm_map_stat_packet( const void *data) { gsm_map_stat_t *stat_p = (gsm_map_stat_t *)tapdata; - const gsm_map_tap_rec_t *data_p = (gsm_map_tap_rec_t *)data; + const gsm_map_tap_rec_t *data_p = (const gsm_map_tap_rec_t *)data; #if 0 /* always false because message_type is 8 bit value */ if (data_p->opr_code_idx > sizeof(stat_p->opr_code)) diff --git a/ui/gtk/h225_counter.c b/ui/gtk/h225_counter.c index 44e4bde668..69937793ea 100644 --- a/ui/gtk/h225_counter.c +++ b/ui/gtk/h225_counter.c @@ -160,7 +160,7 @@ static int h225counter_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { h225counter_t *hs=(h225counter_t *)phs; - const h225_packet_info *pi=(h225_packet_info *)phi; + const h225_packet_info *pi=(const h225_packet_info *)phi; switch (pi->msg_type) { diff --git a/ui/gtk/h225_ras_srt.c b/ui/gtk/h225_ras_srt.c index 20ab61edc6..39d2997725 100644 --- a/ui/gtk/h225_ras_srt.c +++ b/ui/gtk/h225_ras_srt.c @@ -145,7 +145,7 @@ static int h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { h225rassrt_t *hs=(h225rassrt_t *)phs; - const h225_packet_info *pi=(h225_packet_info *)phi; + const h225_packet_info *pi=(const h225_packet_info *)phi; ras_type rasmsg_type = RAS_OTHER; ras_category rascategory = RAS_OTHERS; diff --git a/ui/gtk/hostlist_eth.c b/ui/gtk/hostlist_eth.c index add12c9902..edf0a1038c 100644 --- a/ui/gtk/hostlist_eth.c +++ b/ui/gtk/hostlist_eth.c @@ -43,7 +43,7 @@ static int eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { hostlist_table *hosts=(hostlist_table *)pit; - const eth_hdr *ehdr=(eth_hdr *)vip; + const eth_hdr *ehdr=(const eth_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/hostlist_wlan.c b/ui/gtk/hostlist_wlan.c index 619e1d77c1..abf64d42ad 100644 --- a/ui/gtk/hostlist_wlan.c +++ b/ui/gtk/hostlist_wlan.c @@ -42,7 +42,7 @@ static int wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { hostlist_table *hosts=(hostlist_table *)pit; - const wlan_hdr *whdr=(wlan_hdr *)vip; + const wlan_hdr *whdr=(const wlan_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/iax2_analysis.c b/ui/gtk/iax2_analysis.c index ff720a1906..40f0285c48 100644 --- a/ui/gtk/iax2_analysis.c +++ b/ui/gtk/iax2_analysis.c @@ -448,7 +448,7 @@ static gboolean iax2_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *iax2info_arg) { user_data_t *user_data = (user_data_t *)user_data_arg; - const struct _iax2_info_t *iax2info = (struct _iax2_info_t *)iax2info_arg; + const struct _iax2_info_t *iax2info = (const struct _iax2_info_t *)iax2info_arg; /* we ignore packets that are not displayed */ if (pinfo->fd->flags.passed_dfilter == 0) diff --git a/ui/gtk/ncp_stat.c b/ui/gtk/ncp_stat.c index 3a8a9f2b53..46c9bda437 100644 --- a/ui/gtk/ncp_stat.c +++ b/ui/gtk/ncp_stat.c @@ -302,7 +302,7 @@ static int ncpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { ncpstat_t *ss=(ncpstat_t *)pss; - const ncp_req_hash_value *request_val=(ncp_req_hash_value *)prv; + const ncp_req_hash_value *request_val=(const ncp_req_hash_value *)prv; /* if we havent seen the request, just ignore it */ if(!request_val || request_val->ncp_rec==0){ diff --git a/ui/gtk/rpc_progs.c b/ui/gtk/rpc_progs.c index ed551514cd..9504d81cd7 100644 --- a/ui/gtk/rpc_progs.c +++ b/ui/gtk/rpc_progs.c @@ -204,7 +204,7 @@ add_new_program(rpc_program_t *rp) static gboolean rpcprogs_packet(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg) { - const rpc_call_info_value *ri = (rpc_call_info_value *)arg; + const rpc_call_info_value *ri = (const rpc_call_info_value *)arg; nstime_t delta; rpc_program_t *rp; diff --git a/ui/gtk/rpc_stat.c b/ui/gtk/rpc_stat.c index f3d3e312ac..86d8af8ea5 100644 --- a/ui/gtk/rpc_stat.c +++ b/ui/gtk/rpc_stat.c @@ -103,7 +103,7 @@ static gboolean rpcstat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2) { rpcstat_t *rs = (rpcstat_t *)arg; - const rpc_call_info_value *ri = (rpc_call_info_value *)arg2; + const rpc_call_info_value *ri = (const rpc_call_info_value *)arg2; /* we are only interested in reply packets */ if(ri->request){ diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c index e2cbf85bbe..5af2c4eca0 100644 --- a/ui/gtk/rtp_analysis.c +++ b/ui/gtk/rtp_analysis.c @@ -490,7 +490,7 @@ static int rtp_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *rtpinfo_arg) { user_data_t *user_data = (user_data_t *)user_data_arg; - const struct _rtp_info *rtpinfo = (struct _rtp_info *)rtpinfo_arg; + const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_arg; gboolean rtp_selected = FALSE; /* we ignore packets that are not displayed */ diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c index e2280c5738..7d48c4faf2 100644 --- a/ui/gtk/rtp_stream_dlg.c +++ b/ui/gtk/rtp_stream_dlg.c @@ -189,8 +189,8 @@ rtpstream_on_unselect(GtkButton *button _U_, gpointer user_data _U_) /****************************************************************************/ static gint rtp_stream_info_cmp_reverse(gconstpointer aa, gconstpointer bb) { - const struct _rtp_stream_info* a = (struct _rtp_stream_info *)aa; - const struct _rtp_stream_info* b = (struct _rtp_stream_info *)bb; + const struct _rtp_stream_info* a = (const struct _rtp_stream_info *)aa; + const struct _rtp_stream_info* b = (const struct _rtp_stream_info *)bb; if (a==NULL || b==NULL) return 1; diff --git a/ui/gtk/sip_stat.c b/ui/gtk/sip_stat.c index eae4c9018a..08f1fbb97f 100644 --- a/ui/gtk/sip_stat.c +++ b/ui/gtk/sip_stat.c @@ -361,7 +361,7 @@ sipstat_reset(void *psp) static int sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { - const sip_info_value_t *value = (sip_info_value_t *)pri; + const sip_info_value_t *value = (const sip_info_value_t *)pri; sipstat_t *sp = (sipstat_t *)psp; /* Total number of packets, including continuation packets */ diff --git a/ui/gtk/uat_gui.c b/ui/gtk/uat_gui.c index bd566095c8..ce8c2c8f1a 100644 --- a/ui/gtk/uat_gui.c +++ b/ui/gtk/uat_gui.c @@ -191,7 +191,7 @@ static char *fld_tostr(void *rec, uat_field_t *f) { GString *s = g_string_sized_new( len*2 + 1 ); guint i; - for (i=0; i<len;i++) g_string_append_printf(s, "%.2X", ((guint8*)ptr)[i]); + for (i=0; i<len;i++) g_string_append_printf(s, "%.2X", ((const guint8*)ptr)[i]); out = ep_strdup(s->str); @@ -349,7 +349,7 @@ static gboolean uat_dlg_cb(GtkWidget *win _U_, gpointer user_data) { } case PT_TXTMOD_ENUM: { gint idx = *(int*)e; - text = (idx >= 0) ? ((value_string *)(f[colnum].fld_data))[idx].strptr : ""; + text = (idx >= 0) ? ((const value_string *)(f[colnum].fld_data))[idx].strptr : ""; len = (unsigned) strlen(text); break; } |