diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-21 17:34:41 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-12-21 17:34:41 +0000 |
commit | 4cf7cdd387d3caca7729521f8f89ec5123322c05 (patch) | |
tree | 5d212d2dde19b495d966274eca27fe0b2748ca82 /epan | |
parent | 4f6f488c20f5d43b78b939f71328d3c12a01dc56 (diff) |
fix some warnings.
svn path=/trunk/; revision=54334
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ftp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-rpc.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-sametime.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-sbus.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-sua.c | 4 | ||||
-rw-r--r-- | epan/dvb_chartbl.h | 2 | ||||
-rw-r--r-- | epan/gcp.c | 2 | ||||
-rw-r--r-- | epan/sna-utils.c | 4 | ||||
-rw-r--r-- | epan/uat.c | 6 |
11 files changed, 26 insertions, 26 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c index 8196e11c97..1bf970aa96 100644 --- a/epan/dissectors/packet-ftp.c +++ b/epan/dissectors/packet-ftp.c @@ -843,7 +843,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else if (ftp_ip_address.type == AT_IPv6) { addr_it = proto_tree_add_ipv6(reqresp_tree, hf_ftp_epsv_ipv6, tvb, 0, 0, - (guint8*)ftp_ip_address.data); + (const guint8*)ftp_ip_address.data); PROTO_ITEM_SET_GENERATED(addr_it); } diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 89689daa37..ff39c40e58 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -3287,9 +3287,9 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) truncated, so we can 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; phdr[0] = g_htonl(reported_length); diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index b4fde3a10e..fd64067607 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2208,7 +2208,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) src_host = get_hostname(addr); if (ip_summary_in_tree) { proto_item_append_text(ti, ", Src: %s (%s)", src_host, - ip_to_str((guint8 *)iph->ip_src.data)); + ip_to_str((const guint8 *)iph->ip_src.data)); } proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, addr); item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, addr); @@ -2276,7 +2276,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) cur_rt = tvb_get_ipv4(tvb, offset + 16); if (ip_summary_in_tree) { proto_item_append_text(ti, ", Dst: %s (%s)", dst_host, - ip_to_str((guint8 *)iph->ip_dst.data)); + ip_to_str((const guint8 *)iph->ip_dst.data)); if (dst_off) proto_item_append_text(ti, ", Via: %s (%s)", get_hostname(cur_rt), ip_to_str((gchar *)&cur_rt)); diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 8100629fa8..c19d0eeaf2 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -1688,7 +1688,7 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, conversation_t* conversation; static address null_address = { AT_NONE, -1, 0, NULL }; rpc_call_info_value *rpc_call; - char *procname=NULL; + const char *procname=NULL; dissect_function_t *dissect_function = NULL; rpc_conv_info_t *rpc_conv_info=NULL; guint32 xid; @@ -1762,7 +1762,7 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (rpc_call->proc_info != NULL) { dissect_function = rpc_call->proc_info->dissect_reply; if (rpc_call->proc_info->name != NULL) { - procname = (char *)rpc_call->proc_info->name; + procname = rpc_call->proc_info->name; } else { procname=wmem_strdup_printf(wmem_packet_scope(), "proc-%u", rpc_call->proc); @@ -1898,7 +1898,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const char *msg_type_name = NULL; const char *progname = NULL; - char *procname = NULL; + const char *procname = NULL; unsigned int vers_low; unsigned int vers_high; @@ -2180,7 +2180,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if ((value = (rpc_proc_info_value *)g_hash_table_lookup(rpc_procs,&key)) != NULL) { dissect_function = value->dissect_call; - procname = (char *)value->name; + procname = value->name; } else { /* happens only with strange program versions or @@ -2226,8 +2226,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tvb_get_ntohl(tvb, offset+28)) { flavor = FLAVOR_AUTHGSSAPI_MSG; gss_proc = proc; - procname = (char *) - val_to_str(gss_proc, + procname = val_to_str(gss_proc, rpc_authgssapi_proc, "Unknown (%d)"); } else { flavor = FLAVOR_AUTHGSSAPI; @@ -2414,7 +2413,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (rpc_call->proc_info != NULL) { dissect_function = rpc_call->proc_info->dissect_reply; if (rpc_call->proc_info->name != NULL) { - procname = (char *)rpc_call->proc_info->name; + procname = rpc_call->proc_info->name; } else { procname=wmem_strdup_printf(wmem_packet_scope(), "proc-%u", proc); @@ -2435,7 +2434,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * AUTH_GSSAPI procname. */ if (flavor == FLAVOR_AUTHGSSAPI_MSG) { - procname = (char *)val_to_str_const(gss_proc, rpc_authgssapi_proc, "(null)"); + procname = val_to_str_const(gss_proc, rpc_authgssapi_proc, "(null)"); } rpc_prog_key.prog = prog; diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c index 4b83abfe78..944902342c 100644 --- a/epan/dissectors/packet-sametime.c +++ b/epan/dissectors/packet-sametime.c @@ -635,7 +635,7 @@ dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int sametime_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { - struct SametimeTap *pi = (struct SametimeTap *)p; + const struct SametimeTap *pi = (const struct SametimeTap *)p; tick_stat_node(st, st_str_packet, 0, FALSE); if (pi->message_type != -1) diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c index 14995dddcf..ef45041a22 100644 --- a/epan/dissectors/packet-sbus.c +++ b/epan/dissectors/packet-sbus.c @@ -567,8 +567,8 @@ static guint crc_calc (guint crc, guint val) /* Hash functions*/ static gint sbus_equal(gconstpointer v, gconstpointer w) { - sbus_request_key *v1 = (sbus_request_key *)v; - sbus_request_key *v2 = (sbus_request_key *)w; + const sbus_request_key *v1 = (const sbus_request_key *)v; + const sbus_request_key *v2 = (const sbus_request_key *)w; if (v1->conversation == v2->conversation && v1->sequence == v2->sequence) { @@ -579,8 +579,9 @@ static gint sbus_equal(gconstpointer v, gconstpointer w) static guint sbus_hash(gconstpointer v) { - sbus_request_key *key = (sbus_request_key *)v; + const sbus_request_key *key = (const sbus_request_key *)v; guint val; + val = key->conversation + key->sequence; return val; } diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c index 8ff32028ef..39a31d8571 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -437,8 +437,8 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds return &no_sua_assoc; } - opck = opc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)opc->data) : g_str_hash(ep_address_to_str(opc)); - dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)dpc->data) : g_str_hash(ep_address_to_str(dpc)); + opck = opc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)opc->data) : g_str_hash(ep_address_to_str(opc)); + dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)dpc->data) : g_str_hash(ep_address_to_str(dpc)); switch (message_type) { case MESSAGE_TYPE_CORE: diff --git a/epan/dvb_chartbl.h b/epan/dvb_chartbl.h index 6c2941026b..8e70016cfd 100644 --- a/epan/dvb_chartbl.h +++ b/epan/dvb_chartbl.h @@ -62,7 +62,7 @@ typedef enum { DVB_ENCODING_KSX_1001, DVB_ENCODING_GB_2312, DVB_ENCODING_ISO_10646_BIG5, - DVB_ENCODING_ISO_10646_UTF8_BMP, + DVB_ENCODING_ISO_10646_UTF8_BMP } dvb_encoding_e; WS_DLL_PUBLIC diff --git a/epan/gcp.c b/epan/gcp.c index 5c6ca7327f..b00c030b61 100644 --- a/epan/gcp.c +++ b/epan/gcp.c @@ -402,7 +402,7 @@ gcp_term_t* gcp_cmd_add_term(gcp_msg_t* m, gcp_trx_t* tr, gcp_cmd_t* c, gcp_term gcp_terms_t* ct; gcp_terms_t* ct2; - static gcp_term_t all_terms = {"$",(guint8*)"",1,GCP_TERM_TYPE_UNKNOWN,NULL,NULL,NULL}; + static gcp_term_t all_terms = {"$",(const guint8*)"",1,GCP_TERM_TYPE_UNKNOWN,NULL,NULL,NULL}; if ( !c ) return NULL; diff --git a/epan/sna-utils.c b/epan/sna-utils.c index 54cc44f7bc..0d0acbe1e2 100644 --- a/epan/sna-utils.c +++ b/epan/sna-utils.c @@ -51,12 +51,12 @@ sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len) switch (addr->len) { case 1: - addrdata = (guint8 *)addr->data; + addrdata = (const guint8 *)addr->data; g_snprintf(buf, buf_len, "%04X", addrdata[0]); break; case 2: - addrdata = (guint8 *)addr->data; + addrdata = (const guint8 *)addr->data; g_snprintf(buf, buf_len, "%04X", pntoh16(&addrdata[0])); break; diff --git a/epan/uat.c b/epan/uat.c index 85c34493ff..d42854f4ca 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -258,7 +258,7 @@ static void putfld(FILE* fp, void* rec, uat_field_t* f) { guint i; for(i=0;i<fld_len;i++) { - fprintf(fp,"%.2x",((guint8*)fld_ptr)[i]); + fprintf(fp,"%.2x",((const guint8*)fld_ptr)[i]); } return; @@ -709,12 +709,12 @@ char* uat_undquote(const char* si, guint in_len, guint* len_p) { char* uat_esc(const char* buf, guint len) { - const guint8* end = ((guint8*)buf)+len; + const guint8* end = ((const guint8*)buf)+len; char* out = (char *)ep_alloc0((4*len)+1); const guint8* b; char* s = out; - for (b = (guint8 *)buf; b < end; b++) { + for (b = (const guint8 *)buf; b < end; b++) { if (isprint(*b) ) { *(s++) = (*b); } else { |