aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-03-28 21:55:11 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-03-28 21:55:11 +0000
commit8fd3ee05600dd7d0e6434e7eb824932c52000ce3 (patch)
treedc1df6288600e883ed53ac7e43a38a2d03abb9f3 /epan
parent32780e71e8ce8c8fd1898cbcb62f6bc8a59341f3 (diff)
Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it. svn path=/trunk/; revision=21253
Diffstat (limited to 'epan')
-rw-r--r--epan/addr_resolv.c2
-rw-r--r--epan/column-utils.c2
-rw-r--r--epan/dissectors/packet-3g-a11.c4
-rw-r--r--epan/dissectors/packet-afp.c8
-rw-r--r--epan/dissectors/packet-ajp13.c4
-rw-r--r--epan/dissectors/packet-bittorrent.c12
-rw-r--r--epan/dissectors/packet-cops.c8
-rw-r--r--epan/dissectors/packet-dcm.c6
-rw-r--r--epan/dissectors/packet-dcom.c2
-rw-r--r--epan/dissectors/packet-dhcp-failover.c4
-rw-r--r--epan/dissectors/packet-dhcpv6.c2
-rw-r--r--epan/dissectors/packet-diameter.c4
-rw-r--r--epan/dissectors/packet-distcc.c10
-rw-r--r--epan/dissectors/packet-dns.c40
-rw-r--r--epan/dissectors/packet-dsi.c2
-rw-r--r--epan/dissectors/packet-edonkey.c2
-rw-r--r--epan/dissectors/packet-extreme.c8
-rw-r--r--epan/dissectors/packet-fcdns.c6
-rw-r--r--epan/dissectors/packet-fcswils.c8
-rw-r--r--epan/dissectors/packet-fix.c6
-rw-r--r--epan/dissectors/packet-ftp.c4
-rw-r--r--epan/dissectors/packet-fw1.c2
-rw-r--r--epan/dissectors/packet-gtp.c4
-rw-r--r--epan/dissectors/packet-hsrp.c2
-rw-r--r--epan/dissectors/packet-iax2.c6
-rw-r--r--epan/dissectors/packet-icep.c2
-rw-r--r--epan/dissectors/packet-igap.c2
-rw-r--r--epan/dissectors/packet-image-gif.c2
-rw-r--r--epan/dissectors/packet-image-jfif.c6
-rw-r--r--epan/dissectors/packet-ipdc.c2
-rw-r--r--epan/dissectors/packet-ipp.c10
-rw-r--r--epan/dissectors/packet-iscsi.c6
-rw-r--r--epan/dissectors/packet-jxta.c24
-rw-r--r--epan/dissectors/packet-kismet.c8
-rw-r--r--epan/dissectors/packet-megaco.c10
-rw-r--r--epan/dissectors/packet-mmse.c10
-rw-r--r--epan/dissectors/packet-mount.c10
-rw-r--r--epan/dissectors/packet-msrp.c10
-rw-r--r--epan/dissectors/packet-rsvp.c4
-rw-r--r--epan/dissectors/packet-smb.c110
-rw-r--r--epan/dissectors/packet-smb2.c2
-rw-r--r--epan/dissectors/packet-smtp.c8
-rw-r--r--epan/dissectors/packet-sna.c2
-rw-r--r--epan/dissectors/packet-wsp.c4
-rw-r--r--epan/dissectors/packet-ymsg.c2
-rw-r--r--epan/proto.c12
-rw-r--r--epan/req_resp_hdrs.c8
-rw-r--r--epan/sigcomp-udvm.c4
-rw-r--r--epan/sigcomp_state_hdlr.c4
-rw-r--r--epan/stats_tree.c30
-rw-r--r--epan/tvbparse.c2
51 files changed, 226 insertions, 226 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 8c1544aced..85d2f02b05 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -553,7 +553,7 @@ static const gchar *solve_address_to_name(address *addr)
return get_hostname6(&ipv6_addr);
case AT_STRINGZ:
- return (gchar*)addr->data;
+ return addr->data;
default:
return NULL;
diff --git a/epan/column-utils.c b/epan/column-utils.c
index cea5fced43..1931fec65c 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -930,7 +930,7 @@ col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res,
/* XXX - should be done in "address_to_str_buf()", but that routine
doesn't know COL_MAX_LEN; it should be changed to take the
maximum length as an argument. */
- strncpy(pinfo->cinfo->col_buf[col], (gchar*)addr->data, COL_MAX_LEN);
+ strncpy(pinfo->cinfo->col_buf[col], addr->data, COL_MAX_LEN);
pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
break;
diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c
index ec5623954d..5a86226663 100644
--- a/epan/dissectors/packet-3g-a11.c
+++ b/epan/dissectors/packet-3g-a11.c
@@ -496,7 +496,7 @@ decode_sse(proto_tree* ext_tree, tvbuff_t* tvb, int offset, size_t ext_len)
if(msid_len > A11_MSG_MSID_ELEM_LEN_MAX)
{
- p_msid = (guint8 *)"MSID is too long";
+ p_msid = "MSID is too long";
}else
{
/* Decode the BCD digits */
@@ -527,7 +527,7 @@ decode_sse(proto_tree* ext_tree, tvbuff_t* tvb, int offset, size_t ext_len)
proto_tree_add_string
- (ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, (gchar *)p_msid);
+ (ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, p_msid);
return;
}
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index 8fb00ac0fc..a4a9fd4fb1 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -1590,7 +1590,7 @@ name_in_bitmap(tvbuff_t *tvb, gint offset, guint16 bitmap, int isdir)
tp_ofs = nameoff +org_offset;
len = tvb_get_guint8(tvb, tp_ofs);
tp_ofs++;
- name = (gchar*)tvb_get_ephemeral_string(tvb, tp_ofs,
+ name = tvb_get_ephemeral_string(tvb, tp_ofs,
len);
return name;
}
@@ -1629,7 +1629,7 @@ name_in_bitmap(tvbuff_t *tvb, gint offset, guint16 bitmap, int isdir)
tp_ofs = nameoff +org_offset +4;
len16 = tvb_get_ntohs(tvb, tp_ofs);
tp_ofs += 2;
- name = (gchar*)tvb_get_ephemeral_string(tvb, tp_ofs,
+ name = tvb_get_ephemeral_string(tvb, tp_ofs,
len16);
return name;
}
@@ -2393,7 +2393,7 @@ dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item(tree, hf_afp_AFPVersion, tvb, offset, 1,FALSE);
offset += len +1;
len_uam = tvb_get_guint8(tvb, offset);
- uam = (char*)tvb_get_ptr(tvb, offset +1, len_uam);
+ uam = tvb_get_ptr(tvb, offset +1, len_uam);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
offset += len_uam +1;
@@ -2428,7 +2428,7 @@ dissect_query_afp_login_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
offset += len +1;
len_uam = tvb_get_guint8(tvb, offset);
- uam = (char*)tvb_get_ptr(tvb, offset +1, len_uam);
+ uam = tvb_get_ptr(tvb, offset +1, len_uam);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
offset += len_uam +1;
diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c
index e5fb99c8e4..bf73b42af5 100644
--- a/epan/dissectors/packet-ajp13.c
+++ b/epan/dissectors/packet-ajp13.c
@@ -378,7 +378,7 @@ display_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ajp13_tree)
/* HEADER VALUE
*/
orig_pos = pos;
- hval_len = get_nstring(tvb, pos, (guint8*)hval, sizeof hval);
+ hval_len = get_nstring(tvb, pos, hval, sizeof hval);
pos+=hval_len+2;
dp = pos - orig_pos;
@@ -629,7 +629,7 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo,
*/
orig_pos = pos;
hval=ep_alloc(8192);
- hval_len = get_nstring(tvb, pos, (guint8*)hval, 8192);
+ hval_len = get_nstring(tvb, pos, hval, 8192);
pos+=hval_len+2;
dp = pos - orig_pos;
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index f4d67158e9..43da881a68 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -199,7 +199,7 @@ static guint get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, in
guint32 length;
if (tvb_get_guint8(tvb, offset) == 19 &&
- tvb_memeql(tvb, offset + 1, (guint8*)"BitTorrent protocol", 19) == 0) {
+ tvb_memeql(tvb, offset + 1, "BitTorrent protocol", 19) == 0) {
/* Return the length of a Handshake message */
return 1 + /* pstrlen */
19 + /* pstr */
@@ -540,7 +540,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto
for ( i=0 ; amp_messages[i].name ; i++ ) {
if (strlen(amp_messages[i].name)==typelen &&
tvb_memeql(tvb, offset + BITTORRENT_HEADER_LENGTH + 4,
- (guint8*)amp_messages[i].name, strlen(amp_messages[i].name))==0) {
+ amp_messages[i].name, strlen(amp_messages[i].name))==0) {
prio = tvb_get_guint8(tvb, offset + BITTORRENT_HEADER_LENGTH + 4 + typelen);
if (prio==0 || prio==1 || prio==2) {
@@ -706,11 +706,11 @@ static void dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, p
if(decode_client_information) {
for(i = 0; peer_id[i].id[0] != '\0'; ++i)
{
- if(tvb_memeql(tvb, offset, (guint8*)peer_id[i].id, strlen(peer_id[i].id)) == 0) {
+ if(tvb_memeql(tvb, offset, peer_id[i].id, strlen(peer_id[i].id)) == 0) {
/* The version number is 4 numeric characters for the
client ids beginning with '-' and 3 characters for the
rest. */
- version = (char*)tvb_get_string(tvb, offset + strlen(peer_id[i].id),
+ version = tvb_get_string(tvb, offset + strlen(peer_id[i].id),
(peer_id[i].id[0] == '-') ? 4 : 3);
proto_tree_add_text(tree, tvb, offset, 20, "Client is %s v%s",
peer_id[i].name,
@@ -739,7 +739,7 @@ static void dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto
tree = proto_item_add_subtree(ti, ett_bittorrent);
if (tvb_get_guint8(tvb, 0) == 19 &&
- tvb_memeql(tvb, 1, (guint8*)"BitTorrent protocol", 19) == 0) {
+ tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) {
dissect_bittorrent_welcome(tvb, pinfo, tree);
} else {
dissect_bittorrent_message(tvb, pinfo, tree);
@@ -764,7 +764,7 @@ static gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo,
if (tvb_bytes_exist(tvb, 0, 20) &&
tvb_get_guint8(tvb, 0) == 19 &&
- tvb_memeql(tvb, 1, (guint8*)"BitTorrent protocol", 19) == 0) {
+ tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) {
conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
conversation_set_dissector(conversation, dissector_handle);
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index ac3821f9d7..fe1197406b 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -1361,7 +1361,7 @@ static guchar*format_asn_value (struct variable_list *variable, subid_t *variabl
variable->type=mib_to_asn_type(subtree->type);
if (!sprint_realloc_by_type(&buf, &buf_len, &out_len, FALSE, variable, subtree->enums, subtree->hint, NULL))
- g_snprintf((char*)buf,SPRINT_MAX_LEN,"%s","sprint_realloc_by_type failed");
+ g_snprintf(buf,SPRINT_MAX_LEN,"%s","sprint_realloc_by_type failed");
return buf;
}
@@ -1448,7 +1448,7 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb,packet_info *pinfo, guint32 of
value = vb_integer_value;
variable.val.integer = &value;
variable.val_len = vb_length ;
- vb_display_string=(gchar*)format_asn_value(&variable,
+ vb_display_string=format_asn_value(&variable,
last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_INTEGER);
proto_tree_add_text(tree, tvb, vb_value_start, length,
@@ -1475,7 +1475,7 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb,packet_info *pinfo, guint32 of
variable.val.integer = &value;
variable.val_len = vb_length;
- vb_display_string=(gchar*)format_asn_value(&variable,
+ vb_display_string=format_asn_value(&variable,
last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_UINTEGER);
proto_tree_add_text(tree,tvb, vb_value_start, length, "Value %s: %s",vb_type_name, vb_display_string);
@@ -1504,7 +1504,7 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb,packet_info *pinfo, guint32 of
variable.type = 0;
variable.val.string = vb_octet_string;
variable.val_len = vb_length;
- vb_display_string = (gchar*)format_asn_value(&variable,
+ vb_display_string = format_asn_value(&variable,
last_decoded_prid_oid,last_decoded_prid_oid_length,ASN_OCTET_STR);
proto_tree_add_text(tree, tvb, vb_value_start, length,
"Value: %s (ASN.1 type from packet: %s)", vb_display_string, vb_type_name);
diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c
index 86d1fd6a12..930073e232 100644
--- a/epan/dissectors/packet-dcm.c
+++ b/epan/dissectors/packet-dcm.c
@@ -529,7 +529,7 @@ dcm_tag2str(guint16 grp, guint16 elm, guint8 syntax, tvbuff_t *tvb, int offset,
p+=MIN(MAX_BUF_LEN-(p-buf),
g_snprintf(p, MAX_BUF_LEN-(p-buf), "%s", dtag->desc));
if (vr > 0) {
- vval = (guint8*)tvb_format_text(tvb, vr, 2);
+ vval = tvb_format_text(tvb, vr, 2);
p+=MIN(MAX_BUF_LEN-(p-buf),
g_snprintf(p, MAX_BUF_LEN-(p-buf), " [%s]", vval));
}
@@ -537,7 +537,7 @@ dcm_tag2str(guint16 grp, guint16 elm, guint8 syntax, tvbuff_t *tvb, int offset,
switch (tr > 0 ? tr : dtag->dtype) {
case DCM_TSTR:
default: /* try ascii */
- vval = (guint8*)tvb_format_text(tvb, offset, len);
+ vval = tvb_format_text(tvb, offset, len);
p+=MIN(MAX_BUF_LEN-(p-buf),
g_snprintf(p, MAX_BUF_LEN-(p-buf), " %s", vval));
break;
@@ -639,7 +639,7 @@ dissect_dcm_assoc(dcmState_t *dcm_data, proto_item *ti, tvbuff_t *tvb, int offse
proto_tree_add_item(dcm_tree, hf_dcm_pdi_syntax, tvb, offset, len > 65 ? 65 : len, FALSE);
if (reply && di && di->valid) {
name = tvb_get_ephemeral_string(tvb, offset, len);
- dcm_setSyntax(di, (char*)name);
+ dcm_setSyntax(di, name);
}
reply = 0;
offset += len;
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c
index f5dc920fe8..2320f5b7e6 100644
--- a/epan/dissectors/packet-dcom.c
+++ b/epan/dissectors/packet-dcom.c
@@ -1971,7 +1971,7 @@ dissect_dcom_OBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
/* add interface instance to database (we currently only handle IPv4) */
if(pinfo->net_src.type == AT_IPv4) {
dcom_if = dcom_interface_new(pinfo,
- (guint8*)ip,
+ ip,
&iid, oxid, oid, &ipid);
}
}
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index a37d1dfa6b..c271af9b75 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -584,7 +584,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
format_text(client_identifier_str, option_length));
proto_tree_add_string(option_tree,
hf_dhcpfo_client_identifier, tvb, offset,
- option_length, (char*)client_identifier_str);
+ option_length, client_identifier_str);
break;
case DHCP_FO_PD_CLIENT_HARDWARE_ADDRESS:
@@ -661,7 +661,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
format_text(vendor_class_str, option_length));
proto_tree_add_string(option_tree,
hf_dhcpfo_vendor_class, tvb, offset,
- option_length, (char*)vendor_class_str);
+ option_length, vendor_class_str);
break;
case DHCP_FO_PD_LEASE_EXPIRATION_TIME:
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index 2c021286d5..a942cf5b68 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -579,7 +579,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
status_code);
if (optlen - 2 > 0) {
- status_message = (char*)tvb_get_ephemeral_string(tvb, off + 2, optlen - 2);
+ status_message = tvb_get_ephemeral_string(tvb, off + 2, optlen - 2);
proto_tree_add_text(subtree, tvb, off + 2, optlen - 2,
"Status Message: %s",
status_message);
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index f67e3a5ecd..a302f04f3b 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -1871,7 +1871,7 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
data = tvb_get_ptr(tvb, offset, avpDataLength);
proto_tree_add_string_format(avpi_tree, hf_diameter_avp_data_string,
- tvb, offset, avpDataLength, (char*)data,
+ tvb, offset, avpDataLength, data,
"Identity: %*.*s",
(int)avpDataLength,
(int)avpDataLength, data);
@@ -1883,7 +1883,7 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
data = tvb_get_ptr(tvb, offset, avpDataLength);
proto_tree_add_string_format(avpi_tree, hf_diameter_avp_data_string,
- tvb, offset, avpDataLength, (char*)data,
+ tvb, offset, avpDataLength, data,
"UTF8String: %*.*s",
(int)avpDataLength,
(int)avpDataLength, data);
diff --git a/epan/dissectors/packet-distcc.c b/epan/dissectors/packet-distcc.c
index d7d854bf7f..f39a5cf89b 100644
--- a/epan/dissectors/packet-distcc.c
+++ b/epan/dissectors/packet-distcc.c
@@ -158,7 +158,7 @@ dissect_distcc_argv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
argv_len=len>255?255:len;
- tvb_memcpy(tvb, (guint8*)argv, offset, argv_len);
+ tvb_memcpy(tvb, argv, offset, argv_len);
argv[argv_len]=0;
proto_tree_add_item(tree, hf_distcc_argv, tvb, offset, len, FALSE);
@@ -189,7 +189,7 @@ dissect_distcc_serr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
argv_len=len>255?255:len;
- tvb_memcpy(tvb, (guint8*)argv, offset, argv_len);
+ tvb_memcpy(tvb, argv, offset, argv_len);
argv[argv_len]=0;
proto_tree_add_item(tree, hf_distcc_serr, tvb, offset, len, FALSE);
@@ -220,7 +220,7 @@ dissect_distcc_sout(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
argv_len=len>255?255:len;
- tvb_memcpy(tvb, (guint8*)argv, offset, argv_len);
+ tvb_memcpy(tvb, argv, offset, argv_len);
argv[argv_len]=0;
proto_tree_add_item(tree, hf_distcc_sout, tvb, offset, len, FALSE);
@@ -313,11 +313,11 @@ dissect_distcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
/* read the token */
- tvb_memcpy(tvb, (guint8*)token, offset, 4);
+ tvb_memcpy(tvb, token, offset, 4);
offset+=4;
/* read the parameter */
- sscanf((char*)tvb_get_ptr(tvb, offset, 8), "%08x", &parameter);
+ sscanf(tvb_get_ptr(tvb, offset, 8), "%08x", &parameter);
offset+=8;
if(!strncmp(token, "DIST", 4)){
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index fccf85c1db..7f564c6b8a 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -820,7 +820,7 @@ dissect_dns_query(tvbuff_t *tvb, int offset, int dns_data_offset,
* The name might contain octets that aren't printable characters,
* format it for display.
*/
- name_out = format_text((guchar*)name, strlen(name));
+ name_out = format_text(name, strlen(name));
if (cinfo != NULL) {
col_append_fstr(cinfo, COL_INFO, " %s %s", type_name, name_out);
@@ -1051,7 +1051,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
* The name might contain octets that aren't printable characters,
* format it for display.
*/
- name_out = format_text((guchar*)name, strlen(name));
+ name_out = format_text(name, strlen(name));
if (type != T_OPT) {
trr = proto_tree_add_text(dns_tree, tvb, offset,
(data_offset - data_start) + data_len,
@@ -1101,7 +1101,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
int ns_name_len;
ns_name_len = get_dns_name(tvb, cur_offset, dns_data_offset, &ns_name);
- name_out = format_text((guchar*)ns_name, strlen(ns_name));
+ name_out = format_text(ns_name, strlen(ns_name));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1118,7 +1118,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
int cname_len;
cname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &cname);
- name_out = format_text((guchar*)cname, strlen(cname));
+ name_out = format_text(cname, strlen(cname));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1142,7 +1142,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
guint32 minimum;
mname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &mname);
- name_out = format_text((guchar*)mname, strlen(mname));
+ name_out = format_text(mname, strlen(mname));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1152,7 +1152,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
cur_offset += mname_len;
rname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &rname);
- name_out = format_text((guchar*)rname, strlen(rname));
+ name_out = format_text(rname, strlen(rname));
proto_tree_add_text(rr_tree, tvb, cur_offset, rname_len, "Responsible authority's mailbox: %s",
name_out);
cur_offset += rname_len;
@@ -1190,7 +1190,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
int pname_len;
pname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &pname);
- name_out = format_text((guchar*)pname, strlen(pname));
+ name_out = format_text(pname, strlen(pname));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1323,7 +1323,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
preference = tvb_get_ntohs(tvb, cur_offset);
mx_name_len = get_dns_name(tvb, cur_offset + 2, dns_data_offset, &mx_name);
- name_out = format_text((guchar*)mx_name, strlen(mx_name));
+ name_out = format_text(mx_name, strlen(mx_name));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %u %s", preference, name_out);
if (dns_tree != NULL) {
@@ -1423,7 +1423,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
signer_name_len = get_dns_name(tvb, cur_offset, dns_data_offset, &signer_name);
proto_tree_add_text(rr_tree, tvb, cur_offset, signer_name_len,
"Signer's name: %s",
- format_text((guchar*)signer_name, strlen(signer_name)));
+ format_text(signer_name, strlen(signer_name)));
cur_offset += signer_name_len;
rr_len -= signer_name_len;
@@ -1573,7 +1573,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
case 3:
gw_name_len = get_dns_name(tvb, cur_offset, dns_data_offset, &gw);
proto_tree_add_text(rr_tree, tvb, cur_offset, gw_name_len,
- "Gateway: %s", format_text((guchar*)gw, strlen(gw)));
+ "Gateway: %s", format_text(gw, strlen(gw)));
cur_offset += gw_name_len;
rr_len -= gw_name_len;
@@ -1643,7 +1643,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
pname="";
pname_len = 0;
}
- name_out = format_text((guchar*)pname, strlen(pname));
+ name_out = format_text(pname, strlen(pname));
if (cinfo != NULL) {
col_append_fstr(cinfo, COL_INFO, " %d %s %s",
@@ -1680,7 +1680,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
dname_len = get_dns_name(tvb, cur_offset, dns_data_offset,
&dname);
- name_out = format_text((guchar*)dname, strlen(dname));
+ name_out = format_text(dname, strlen(dname));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1742,7 +1742,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
next_domain_name_len = get_dns_name(tvb, cur_offset, dns_data_offset,
&next_domain_name);
- name_out = format_text((guchar*)next_domain_name, strlen(next_domain_name));
+ name_out = format_text(next_domain_name, strlen(next_domain_name));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1790,7 +1790,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
next_domain_name_len = get_dns_name(tvb, cur_offset, dns_data_offset,
&next_domain_name);
- name_out = format_text((guchar*)next_domain_name, strlen(next_domain_name));
+ name_out = format_text(next_domain_name, strlen(next_domain_name));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -1827,7 +1827,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
preference = tvb_get_ntohs(tvb, cur_offset);
kx_name_len = get_dns_name(tvb, cur_offset + 2, dns_data_offset, &kx_name);
- name_out = format_text((guchar*)kx_name, strlen(kx_name));
+ name_out = format_text(kx_name, strlen(kx_name));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %u %s", preference, name_out);
if (dns_tree != NULL) {
@@ -1951,7 +1951,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
tkey_algname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &tkey_algname);
proto_tree_add_text(rr_tree, tvb, cur_offset, tkey_algname_len,
"Algorithm name: %s",
- format_text((guchar*)tkey_algname, strlen(tkey_algname)));
+ format_text(tkey_algname, strlen(tkey_algname)));
cur_offset += tkey_algname_len;
rr_len -= tkey_algname_len;
@@ -2074,7 +2074,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
if (dns_tree != NULL) {
tsig_algname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &tsig_raw_algname);
- tsig_algname=format_text((guchar*)tsig_raw_algname, strlen(tsig_raw_algname));
+ tsig_algname=format_text(tsig_raw_algname, strlen(tsig_raw_algname));
proto_tree_add_string(rr_tree, hf_dns_tsig_algorithm_name, tvb, cur_offset, tsig_algname_len, tsig_algname);
cur_offset += tsig_algname_len;
rr_len -= tsig_algname_len;
@@ -2262,7 +2262,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
rr_len -= 4;
dname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &dname);
- name_out = format_text((guchar*)dname, strlen(dname));
+ name_out = format_text(dname, strlen(dname));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
if (dns_tree != NULL) {
@@ -2286,7 +2286,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
port = tvb_get_ntohs(tvb, cur_offset+4);
target_len = get_dns_name(tvb, cur_offset + 6, dns_data_offset, &target);
- name_out = format_text((guchar*)target, strlen(target));
+ name_out = format_text(target, strlen(target));
if (cinfo != NULL)
col_append_fstr(cinfo, COL_INFO, " %u %u %u %s", priority, weight, port, name_out);
if (dns_tree != NULL) {
@@ -2322,7 +2322,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
offset += 2;
flags_len = tvb_get_guint8(tvb, offset);
offset++;
- flags = (gchar*)tvb_get_ephemeral_string(tvb, offset, flags_len);
+ flags = tvb_get_ephemeral_string(tvb, offset, flags_len);
offset += flags_len;
service_len = tvb_get_guint8(tvb, offset);
offset++;
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index e78c27ff89..d95753b532 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -468,7 +468,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
ofs = utf_ofs;
ulen = tvb_get_ntohs(tvb, ofs);
- tmp = (char*)tvb_get_ephemeral_string(tvb, ofs + 2, ulen);
+ tmp = tvb_get_ephemeral_string(tvb, ofs + 2, ulen);
ti = proto_tree_add_text(tree, tvb, ofs, ulen + 2, "UTF8 server name: %s", tmp);
sub_tree = proto_item_add_subtree(ti, ett_dsi_utf8_name);
proto_tree_add_uint(sub_tree, hf_dsi_utf8_server_name_len, tvb, ofs, 2, ulen);
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index 321aa38665..ce171bcc34 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -329,7 +329,7 @@ static guint8 edonkey_metatag_name_get_type(tvbuff_t *tvb, gint start, gint leng
if (match_strval(special_tagtype, edonkey_special_tags) == NULL) {
gint index;
tag_name = tvb_get_ephemeral_string(tvb, start, length);
- index = lookup_str_index((gchar*)tag_name, length, edonkey_special_tags);
+ index = lookup_str_index(tag_name, length, edonkey_special_tags);
if (index < 0)
return EDONKEY_STAG_UNKNOWN;
else return edonkey_special_tags[index].value;
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c
index dd161e7758..f925ce44ef 100644
--- a/epan/dissectors/packet-extreme.c
+++ b/epan/dissectors/packet-extreme.c
@@ -361,9 +361,9 @@ dissect_display_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, p
display_name = tvb_get_ephemeral_string(tvb, offset, length);
proto_item_append_text(display_item, ": \"%s\"",
- format_text(display_name, strlen((char*)display_name)));
+ format_text(display_name, strlen(display_name)));
proto_tree_add_string(display_tree, hf_edp_display_string, tvb, offset, length,
- (char*)display_name);
+ display_name);
}
static void
@@ -552,9 +552,9 @@ dissect_vlan_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, prot
vlan_name = tvb_get_ephemeral_string(tvb, offset, length);
proto_item_append_text(vlan_item, ", Name \"%s\"",
- format_text(vlan_name, strlen((char*)vlan_name)));
+ format_text(vlan_name, strlen(vlan_name)));
proto_tree_add_string(vlan_tree, hf_edp_vlan_name, tvb, offset, length,
- (char*)vlan_name);
+ vlan_name);
offset += length;
}
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index a9ba32608e..c7e357804e 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -602,7 +602,7 @@ dissect_fcdns_gspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
tvb, offset, 1, 0);
proto_tree_add_string (req_tree, hf_fcdns_rply_spname, tvb,
offset+1, len,
- (char*)tvb_get_ptr (tvb, offset+1, len));
+ tvb_get_ptr (tvb, offset+1, len));
}
}
}
@@ -1234,7 +1234,7 @@ dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
3)));
break;
case FC_SWILS_ZONEMBR_ALIAS:
- str = (char*)zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
offset+4, idlen, str);
break;
@@ -1452,7 +1452,7 @@ dissect_fcdns_gezn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
proto_tree_add_text (req_tree, tvb, offset, 1, "Name Length: %d",
strlen);
proto_tree_add_string (req_tree, hf_fcdns_zonenm, tvb, offset+3,
- strlen, (char*)tvb_get_ptr (tvb, offset+3, strlen));
+ strlen, tvb_get_ptr (tvb, offset+3, strlen));
}
}
else {
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index fcea72acab..90b2be19b7 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -1260,7 +1260,7 @@ dissect_swils_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
3)));
break;
case FC_SWILS_ZONEMBR_ALIAS:
- str = (char*)zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
offset+4, idlen, str);
break;
@@ -1311,7 +1311,7 @@ dissect_swils_zone_obj (tvbuff_t *tvb, proto_tree *zobj_tree, int offset)
1, 0);
proto_tree_add_item (zobj_tree, hf_swils_zone_protocol, tvb,
offset+1, 1, 0);
- str = (char*)zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (zobj_tree, hf_swils_zone_objname, tvb,
offset+4, ZONENAME_LEN (tvb, offset+4), str);
@@ -1356,7 +1356,7 @@ dissect_swils_mergereq (tvbuff_t *tvb, proto_tree *mr_tree, guint8 isreq)
"Active ZoneSet Length: %u", zonesetlen);
if (zonesetlen) {
- str = (char*)zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (mr_tree, hf_swils_zone_activezonenm, tvb,
offset+4, ZONENAME_LEN (tvb, offset+4),
str);
@@ -1503,7 +1503,7 @@ dissect_swils_sfc (tvbuff_t *tvb, proto_tree *sfc_tree, guint8 isreq)
"ZoneSet Length: %d", zonesetlen);
if (zonesetlen) {
- str = (char*)zonenm_to_str (tvb, offset+4);
+ str = zonenm_to_str (tvb, offset+4);
proto_tree_add_string (sfc_tree, hf_swils_sfc_zonenm, tvb,
offset+4, ZONENAME_LEN (tvb, offset+4),
str);
diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c
index 2607f74d53..d87acce6c7 100644
--- a/epan/dissectors/packet-fix.c
+++ b/epan/dissectors/packet-fix.c
@@ -913,7 +913,7 @@ dissect_fix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- value = (char*)tvb_get_ephemeral_string(tvb, value_offset, value_len);
+ value = tvb_get_ephemeral_string(tvb, value_offset, value_len);
msg_type = (char *)g_datalist_get_data(&msg_types, value);
if(msg_type) {
summary_label = g_string_new(msg_type);
@@ -972,10 +972,10 @@ dissect_fix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
packet. */
return TRUE;
}
- tag_str = (char*)tvb_get_ephemeral_string(tvb, field_offset, tag_len);
+ tag_str = tvb_get_ephemeral_string(tvb, field_offset, tag_len);
tag = atoi(tag_str);
- value = (char*)tvb_get_ephemeral_string(tvb, value_offset, value_len);
+ value = tvb_get_ephemeral_string(tvb, value_offset, value_len);
switch(tag) {
case 1: /* Field Account */
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index da9e7b597d..ea62b24274 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -315,7 +315,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_ftp_request_command, tvb, offset,
tokenlen, FALSE);
}
- if (strncmp((char*)line, "PORT", tokenlen) == 0)
+ if (strncmp(line, "PORT", tokenlen) == 0)
is_port_request = TRUE;
}
} else {
@@ -337,7 +337,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* One-line reply, or first or last line
* of a multi-line reply.
*/
- tvb_get_nstringz0(tvb, offset, sizeof(code_str), (guint8*)code_str);
+ tvb_get_nstringz0(tvb, offset, sizeof(code_str), code_str);
code = strtoul(code_str, NULL, 10);
if (tree) {
diff --git a/epan/dissectors/packet-fw1.c b/epan/dissectors/packet-fw1.c
index 1472ce9066..d7f1fe5569 100644
--- a/epan/dissectors/packet-fw1.c
+++ b/epan/dissectors/packet-fw1.c
@@ -170,7 +170,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iface_len = 6;
interface_name=ep_alloc(iface_len+1);
- tvb_get_nstringz0(tvb, 2, iface_len, (guint8*)interface_name);
+ tvb_get_nstringz0(tvb, 2, iface_len, interface_name);
/* Known interface name - if not, remember it */
found=FALSE;
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index dfedaff2d8..5bd196fc15 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -3787,7 +3787,7 @@ decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, const gchar* qos_st
static const gchar* dissect_radius_qos_umts(proto_tree *tree, tvbuff_t *tvb) {
decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
- return (gchar*)tvb_get_ephemeral_string(tvb,0,tvb_length(tvb));
+ return tvb_get_ephemeral_string(tvb,0,tvb_length(tvb));
}
static void
@@ -3810,7 +3810,7 @@ decode_apn(tvbuff_t *tvb, int offset, guint16 length, proto_tree *tree) {
} else
apn = tvb_get_ephemeral_string(tvb, offset, length);
- proto_tree_add_string (tree, hf_gtp_apn, tvb, offset, length, (char*)apn);
+ proto_tree_add_string (tree, hf_gtp_apn, tvb, offset, length, apn);
}
}
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c
index e88761981c..ace081dd7d 100644
--- a/epan/dissectors/packet-hsrp.c
+++ b/epan/dissectors/packet-hsrp.c
@@ -230,7 +230,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset++;
tvb_memcpy(tvb, auth_buf, offset, 8);
auth_buf[sizeof auth_buf - 1] = '\0';
- proto_tree_add_string_format(hsrp_tree, hf_hsrp_auth_data, tvb, offset, 8, (char*)auth_buf,
+ proto_tree_add_string_format(hsrp_tree, hf_hsrp_auth_data, tvb, offset, 8, auth_buf,
"Authentication Data: %sDefault (%s)",
(tvb_strneql(tvb, offset, "cisco", strlen("cisco"))) == 0 ? "" : "Non-",
auth_buf);
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 7ab70834ac..531b37a0a9 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1203,7 +1203,7 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
/* we don't understand this ie: add a generic one */
guint32 value;
const guint8 *ptr;
- const guint8 *ie_name = (guint8*)val_to_str(ies_type, iax_ies_type, "Unknown");
+ const guint8 *ie_name = val_to_str(ies_type, iax_ies_type, "Unknown");
switch(ies_len) {
case 1:
@@ -1234,7 +1234,7 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
ptr = tvb_get_ptr(tvb, offset + 2, ies_len);
ie_item =
proto_tree_add_string_format(ies_tree, hf_IAX_IE_UNKNOWN_BYTES,
- tvb, offset+2, ies_len, (char*)ptr,
+ tvb, offset+2, ies_len, ptr,
"%s: %s", ie_name, ptr );
break;
}
@@ -1258,7 +1258,7 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
else {
guint8 *ie_val = NULL;
ie_val = g_malloc(ITEM_LABEL_LENGTH);
- proto_item_fill_label(ie_finfo, (gchar*)ie_val);
+ proto_item_fill_label(ie_finfo, ie_val);
proto_item_set_text(ti, "Information Element: %s",
ie_val);
g_free(ie_val);
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index aefd307976..4ff5f58e33 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -257,7 +257,7 @@ static void dissect_ice_string(proto_tree *tree, int hf_icep,
if ( Size != 0 ) {
- s = (char*)tvb_get_ephemeral_string(tvb, offset, Size);
+ s = tvb_get_ephemeral_string(tvb, offset, Size);
if (tree && add_hf)
proto_tree_add_string(tree, hf_icep, tvb, offset, Size, s);
} else {
diff --git a/epan/dissectors/packet-igap.c b/epan/dissectors/packet-igap.c
index c60f36547d..85b29d7ae0 100644
--- a/epan/dissectors/packet-igap.c
+++ b/epan/dissectors/packet-igap.c
@@ -200,7 +200,7 @@ dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
}
tvb_memcpy(tvb, account, offset, asize);
account[asize] = '\0';
- proto_tree_add_string(tree, hf_account, tvb, offset, asize, (char*)account);
+ proto_tree_add_string(tree, hf_account, tvb, offset, asize, account);
}
offset += ACCOUNT_SIZE;
diff --git a/epan/dissectors/packet-image-gif.c b/epan/dissectors/packet-image-gif.c
index a05984e1ee..aec14d016a 100644
--- a/epan/dissectors/packet-image-gif.c
+++ b/epan/dissectors/packet-image-gif.c
@@ -163,7 +163,7 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
guint8 color_resolution;
guint8 image_bpp;
guint tvb_len = tvb_reported_length(tvb);
- char *str = (char*)tvb_get_ephemeral_string(tvb, 0, 6);
+ char *str = tvb_get_ephemeral_string(tvb, 0, 6);
guint8 version;
/* Check whether we're processing a GIF object */
diff --git a/epan/dissectors/packet-image-jfif.c b/epan/dissectors/packet-image-jfif.c
index 9eb1229f95..2fbf8fd012 100644
--- a/epan/dissectors/packet-image-jfif.c
+++ b/epan/dissectors/packet-image-jfif.c
@@ -509,7 +509,7 @@ process_app0_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len,
proto_tree_add_item(subtree, hf_len, tvb, 2, 2, FALSE);
- str = (char*)tvb_get_ephemeral_stringz(tvb, 4, &str_size);
+ str = tvb_get_ephemeral_stringz(tvb, 4, &str_size);
ti = proto_tree_add_item(subtree, hf_identifier, tvb, 4, str_size, FALSE);
if (strcmp(str, "JFIF") == 0) {
/* Version */
@@ -603,7 +603,7 @@ process_app1_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len,
proto_tree_add_item(subtree, hf_len, tvb, offset, 2, FALSE);
offset += 2;
- str = (char*)tvb_get_ephemeral_stringz(tvb, offset, &str_size);
+ str = tvb_get_ephemeral_stringz(tvb, offset, &str_size);
ti = proto_tree_add_item(subtree, hf_identifier, tvb, offset, str_size, FALSE);
offset += str_size;
if (strcmp(str, "Exif") == 0) {
@@ -759,7 +759,7 @@ process_app2_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len,
proto_tree_add_item(subtree, hf_len, tvb, 2, 2, FALSE);
- str = (char*)tvb_get_ephemeral_stringz(tvb, 4, &str_size);
+ str = tvb_get_ephemeral_stringz(tvb, 4, &str_size);
ti = proto_tree_add_item(subtree, hf_identifier, tvb, 4, str_size, FALSE);
if (strcmp(str, "FPXR") == 0) {
proto_tree_add_text(tree, tvb, 0, -1, "Exif FlashPix APP2 application marker");
diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c
index 95ab42894d..23f99cda5a 100644
--- a/epan/dissectors/packet-ipdc.c
+++ b/epan/dissectors/packet-ipdc.c
@@ -206,7 +206,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* simple IPDC_ASCII strings */
case IPDC_ASCII:
g_assert(len<=IPDC_STR_LEN);
- tvb_memcpy(tvb, (guint8*)tmp_tag_text, offset+2, len);
+ tvb_memcpy(tvb, tmp_tag_text, offset+2, len);
tmp_tag_text[len] = 0;
proto_tree_add_text(tag_tree, tvb, offset,
len + 2, "0x%2.2x: %s: %s", tag, des,
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c
index 211571a56e..e05ce21309 100644
--- a/epan/dissectors/packet-ipp.c
+++ b/epan/dissectors/packet-ipp.c
@@ -480,18 +480,18 @@ add_integer_tree(proto_tree *tree, tvbuff_t *tvb, int offset,
* ends in '-time' then assume they are timestamps instead
* of integers.
*/
- name_val=(char*)tvb_get_ptr(tvb, offset + 1 + 2, name_length);
- if( (name_length > 5) && name_val && !tvb_memeql(tvb, offset + 1 + 2 + name_length - 5, (guint8*)"-time", 5)){
+ name_val=tvb_get_ptr(tvb, offset + 1 + 2, name_length);
+ if( (name_length > 5) && name_val && !tvb_memeql(tvb, offset + 1 + 2 + name_length - 5, "-time", 5)){
ti = proto_tree_add_text(tree, tvb, offset,
1 + 2 + name_length + 2 + value_length,
"%s: %s",
- format_text((guchar*)name_val, name_length),
+ format_text(name_val, name_length),
abs_time_secs_to_str(tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2)));
} else {
ti = proto_tree_add_text(tree, tvb, offset,
1 + 2 + name_length + 2 + value_length,
"%s: %u",
- format_text((guchar*)name_val, name_length),
+ format_text(name_val, name_length),
tvb_get_ntohl(tvb, offset + 1 + 2 + name_length + 2));
}
}
@@ -620,7 +620,7 @@ add_value_head(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb,
proto_tree_add_text(tree, tvb, offset, name_length,
"Name: %s", format_text(nv, name_length));
if(name_val){
- *name_val=(char*)nv;
+ *name_val=nv;
}
}
offset += name_length;
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index ca2c8f2842..c5c5dd2cdc 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -1603,11 +1603,11 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
*/
cdb_buf=ep_alloc(16+ahs_cdb_length);
/* the 16 first bytes of the cdb */
- tvb_memcpy(tvb, (guint8*)cdb_buf, cdb_offset, 16);
+ tvb_memcpy(tvb, cdb_buf, cdb_offset, 16);
/* the remainder of the cdb from the ahs */
- tvb_memcpy(tvb, (guint8*)cdb_buf+16, ahs_cdb_offset, ahs_cdb_length);
+ tvb_memcpy(tvb, cdb_buf+16, ahs_cdb_offset, ahs_cdb_length);
- cdb_tvb = tvb_new_real_data((guint8*)cdb_buf,
+ cdb_tvb = tvb_new_real_data(cdb_buf,
ahs_cdb_length+16,
ahs_cdb_length+16);
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index 12b2498fc0..19228ef473 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -441,7 +441,7 @@ static gboolean dissect_jxta_UDP_heur(tvbuff_t * tvb, packet_info * pinfo, proto
if (!gUDP_HEUR)
return FALSE;
- if (tvb_memeql(tvb, 0, (guint8*)JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) {
+ if (tvb_memeql(tvb, 0, JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) {
return FALSE;
}
@@ -633,7 +633,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
break;
}
- if (tvb_memeql(tvb, offset, (guint8*)JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) {
+ if (tvb_memeql(tvb, offset, JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) {
/* not ours */
return 0;
}
@@ -761,7 +761,7 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
goto Common_Exit;
}
- if (0 == tvb_memeql(tvb, 0, (guint8*)JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) {
+ if (0 == tvb_memeql(tvb, 0, JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) {
/* The beginning of a JXTA stream connection */
address *welcome_addr;
gboolean initiator = FALSE;
@@ -1030,7 +1030,7 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree
return (gint) (available - sizeof(JXTA_WELCOME_MSG_SIG));
}
- if (0 != tvb_memeql(tvb, 0, (guint8*)JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) {
+ if (0 != tvb_memeql(tvb, 0, JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) {
/* not ours! */
return 0;
}
@@ -1058,7 +1058,7 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree
}
{
- gchar *welcomeline = (char*)tvb_get_ephemeral_string(tvb, offset, first_linelen);
+ gchar *welcomeline = tvb_get_ephemeral_string(tvb, offset, first_linelen);
gchar **current_token;
guint token_offset = offset;
proto_item *jxta_welcome_tree_item = NULL;
@@ -1134,7 +1134,7 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree
found_addr->type = AT_URI;
found_addr->len = strlen(*current_token);
/* FIXME 20050605 bondolo THIS ALLOCATION IS A MEMORY LEAK! */
- found_addr->data = (guint8*)g_strdup(*current_token);
+ found_addr->data = g_strdup(*current_token);
}
token_offset += strlen(*current_token) + 1;
@@ -1292,7 +1292,7 @@ static int dissect_jxta_message_framing(tvbuff_t * tvb, packet_info * pinfo, pro
if (content_type && (sizeof("content-type") - 1) == headername_len) {
if (0 == tvb_strncaseeql(tvb, headername_offset, "content-type", sizeof("content-type") - 1)) {
- *content_type = (gchar*)tvb_get_ephemeral_string(tvb, headervalue_offset, headervalue_len);
+ *content_type = tvb_get_ephemeral_string(tvb, headervalue_offset, headervalue_len);
}
}
@@ -1402,7 +1402,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
break;
}
- if (tvb_memeql(tvb, offset, (guint8*)JXTA_MSG_SIG, sizeof(JXTA_MSG_SIG)) != 0) {
+ if (tvb_memeql(tvb, offset, JXTA_MSG_SIG, sizeof(JXTA_MSG_SIG)) != 0) {
/* It is not one of ours */
return 0;
}
@@ -1618,7 +1618,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
for (each_name = 0; each_name < msg_names_count; each_name++) {
guint16 name_len = tvb_get_ntohs(tvb, tree_offset);
- names_table[2 + each_name] = (gchar*)tvb_get_ephemeral_string(tvb, tree_offset + sizeof(name_len), name_len);
+ names_table[2 + each_name] = tvb_get_ephemeral_string(tvb, tree_offset + sizeof(name_len), name_len);
proto_tree_add_item(jxta_msg_tree, hf_jxta_message_names_name, tvb, tree_offset, sizeof(name_len), FALSE);
tree_offset += sizeof(name_len) + name_len;
}
@@ -1689,7 +1689,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
needed = (gint) (sizeof(JXTA_MSGELEM_SIG) - available);
}
- if (tvb_memeql(tvb, offset, (guint8*)JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) {
+ if (tvb_memeql(tvb, offset, JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) {
/* It is not one of ours */
return 0;
}
@@ -1873,7 +1873,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
proto_tree_add_item(jxta_elem_tree, hf_jxta_element_type, tvb, tree_offset, sizeof(guint16), FALSE);
tree_offset += sizeof(guint16);
- mediatype = (gchar*)tvb_get_ephemeral_string(tvb, tree_offset, type_len);
+ mediatype = tvb_get_ephemeral_string(tvb, tree_offset, type_len);
/* remove any params */
{
@@ -1990,7 +1990,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
needed = (gint) (sizeof(JXTA_MSGELEM_SIG) - available);
}
- if (tvb_memeql(tvb, offset, (guint8*)JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) {
+ if (tvb_memeql(tvb, offset, JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) {
/* It is not one of ours */
return 0;
}
diff --git a/epan/dissectors/packet-kismet.c b/epan/dissectors/packet-kismet.c
index b6aa11f8c2..80439657e6 100644
--- a/epan/dissectors/packet-kismet.c
+++ b/epan/dissectors/packet-kismet.c
@@ -183,7 +183,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* *KISMET: {Version} {Start time} \001{Server name}\001 {Build Revision}
* two fields left undocumented: {???} {?ExtendedVersion?}
*/
- if (!strncmp((char*)reqresp, "*KISMET", 7)) {
+ if (!strncmp(reqresp, "*KISMET", 7)) {
offset += next_token - line;
linelen -= next_token - line;
line = next_token;
@@ -236,7 +236,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/*
* *TIME: {Time}
*/
- if (!strncmp((char*)reqresp, "*TIME", 5)) {
+ if (!strncmp(reqresp, "*TIME", 5)) {
time_t t;
char *ptr;
@@ -278,10 +278,10 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
static gboolean
response_is_continuation(const guchar * data)
{
- if (!strncmp((char*)data, "*", 1))
+ if (!strncmp(data, "*", 1))
return FALSE;
- if (!strncmp((char*)data, "!", 1))
+ if (!strncmp(data, "!", 1))
return FALSE;
return TRUE;
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index e86ae3917e..24f1aadd07 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -361,7 +361,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* tvb_offset = tvb_find_guint8(tvb, tvb_offset, 5, 'M');
*/
if(!tvb_get_nstringz0(tvb,tvb_offset,sizeof(word),word)) return;
- if (strncasecmp((gchar*)word, "MEGACO", 6) != 0 && (gchar)tvb_get_guint8(tvb, tvb_offset ) != '!'){
+ if (strncasecmp(word, "MEGACO", 6) != 0 && tvb_get_guint8(tvb, tvb_offset ) != '!'){
call_dissector(h248_handle,tvb,pinfo,tree);
return;
}
@@ -1169,7 +1169,7 @@ nextcontext:
/*** TERM ***/
my_proto_tree_add_string(megaco_tree_command_line, hf_megaco_termid, tvb,
tvb_offset, tokenlen,
- (gchar*)TermID);
+ TermID);
break;
case '*':
@@ -2312,7 +2312,7 @@ dissect_megaco_servicechangedescriptor(tvbuff_t *tvb, proto_tree *megaco_tree,
break;
tvb_get_nstringz0(tvb,tvb_current_offset,4,ServiceChangeReason_str);
- reason = atoi((gchar*)ServiceChangeReason_str);
+ reason = atoi(ServiceChangeReason_str);
proto_item_append_text(item,"[ %s ]", val_to_str(reason, MEGACO_ServiceChangeReasons_vals,"Unknown (%u)"));
break;
@@ -2792,7 +2792,7 @@ dissect_megaco_errordescriptor(tvbuff_t *tvb, proto_tree *megaco_tree_command_li
tvb_current_offset = tvb_find_guint8(tvb, tvb_previous_offset , tvb_RBRKT, '=');
tvb_current_offset = tvb_skip_wsp(tvb, tvb_current_offset +1);
tvb_get_nstringz0(tvb,tvb_current_offset,4,error);
- error_code = atoi((gchar*)error);
+ error_code = atoi(error);
proto_tree_add_string_hidden(megaco_tree_command_line, hf_megaco_error_descriptor, tvb,
tvb_current_offset, 3,
tvb_format_text(tvb, tvb_current_offset,
@@ -3160,7 +3160,7 @@ dissect_megaco_LocalControldescriptor(tvbuff_t *tvb, proto_tree *megaco_mediades
tokenlen));
tvb_get_nstringz0(tvb,tvb_current_offset,3,code_str);
- proto_item_append_text(item,"[ %s ]", val_to_str(strtoul((gchar*)code_str,NULL,16), dscp_vals,"Unknown (%u)"));
+ proto_item_append_text(item,"[ %s ]", val_to_str(strtoul(code_str,NULL,16), dscp_vals,"Unknown (%u)"));
tvb_current_offset = tvb_skip_wsp(tvb, tvb_offset +1);
break;
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index aa350dc9be..03a7b6eecc 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -1180,7 +1180,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
hf_mmse_prev_sent_by,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
- format_text((guchar*)strval, strlen(strval)),
+ format_text(strval, strlen(strval)),
fwd_count);
subtree = proto_item_add_subtree(ti,
ett_mmse_hdr_details);
@@ -1217,7 +1217,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
hf_mmse_prev_sent_date,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
- format_text((guchar*)strval, strlen(strval)),
+ format_text(strval, strlen(strval)),
fwd_count);
subtree = proto_item_add_subtree(ti,
ett_mmse_hdr_details);
@@ -1256,7 +1256,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
proto_tree_add_text(mmse_tree, tvb, offset - 1,
length + 1, "%s: %s (Not decoded)",
hdr_name,
- format_text((guchar*)strval, strlen(strval)));
+ format_text(strval, strlen(strval)));
}
} else { /* General form with length */
if (peek == 0x1F) { /* Value length in guintvar */
@@ -1292,8 +1292,8 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
(const char *) tvb_get_ptr(
tvb, offset, length + length2),
"%s: %s",
- format_text((guchar*)strval, strlen(strval)),
- format_text((guchar*)strval2, strlen(strval2)));
+ format_text(strval, strlen(strval)),
+ format_text(strval2, strlen(strval2)));
}
offset += length + length2;
}
diff --git a/epan/dissectors/packet-mount.c b/epan/dissectors/packet-mount.c
index cc8003bfab..5866c63152 100644
--- a/epan/dissectors/packet-mount.c
+++ b/epan/dissectors/packet-mount.c
@@ -172,7 +172,7 @@ dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
unsigned const char *dir;
int len;
- host=(unsigned char*)ip_to_str(pinfo->dst.data);
+ host=ip_to_str(pinfo->dst.data);
len=tvb_get_ntohl(tvb, offset);
if (len >= ITEM_LABEL_LENGTH)
THROW(ReportedBoundsError);
@@ -180,16 +180,16 @@ dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
dir=tvb_get_ptr(tvb, offset+4, len);
if(dir){
unsigned char *ptr;
- name=(unsigned char*)g_malloc(strlen(host)+1+len+1+200);
+ name=g_malloc(strlen(host)+1+len+1+200);
ptr=name;
- memcpy(ptr, host, strlen((char*)host));
- ptr+=strlen((char*)host);
+ memcpy(ptr, host, strlen(host));
+ ptr+=strlen(host);
*ptr++=':';
memcpy(ptr, dir, len);
ptr+=len;
*ptr=0;
- nfs_name_snoop_add_name(civ->xid, tvb, -1, strlen((char*)name), 0, 0, name);
+ nfs_name_snoop_add_name(civ->xid, tvb, -1, strlen(name), 0, 0, name);
}
}
}
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index 794c8f14fd..e7c759ca66 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -513,7 +513,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
token_2_len = space_offset - token_2_start;
/* Transaction ID found store it for later use */
- transaction_id_str = (char*)tvb_get_ephemeral_string(tvb, token_2_start, token_2_len);
+ transaction_id_str = tvb_get_ephemeral_string(tvb, token_2_start, token_2_len);
/* Look for another space in this line to indicate a 4th token */
token_3_start = space_offset + 1;
@@ -590,7 +590,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
reqresp_tree = proto_item_add_subtree(th, ett_msrp_reqresp);
proto_tree_add_item(reqresp_tree,hf_msrp_transactionID,tvb,token_2_start,token_2_len,FALSE);
proto_tree_add_uint(reqresp_tree,hf_msrp_status_code,tvb,token_3_start,token_3_len,
- atoi((char*)tvb_get_string(tvb, token_3_start, token_3_len)));
+ atoi(tvb_get_string(tvb, token_3_start, token_3_len)));
}else{
th = proto_tree_add_item(msrp_tree,hf_msrp_request_line,tvb,0,linelen,FALSE);
@@ -654,7 +654,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Fetch the value.
*/
value_len = line_end_offset - value_offset;
- value = (char*)tvb_get_ephemeral_string(tvb, value_offset,
+ value = tvb_get_ephemeral_string(tvb, value_offset,
value_len);
/*
@@ -684,10 +684,10 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
parameter_offset++;
content_type_len = semi_colon_offset - value_offset;
content_type_parameter_str_len = line_end_offset - parameter_offset;
- content_type_parameter_str = (char*)tvb_get_ephemeral_string(tvb,
+ content_type_parameter_str = tvb_get_ephemeral_string(tvb,
parameter_offset, content_type_parameter_str_len);
}
- media_type_str = (char*)tvb_get_ephemeral_string(tvb, value_offset, content_type_len);
+ media_type_str = tvb_get_ephemeral_string(tvb, value_offset, content_type_len);
#if GLIB_MAJOR_VERSION < 2
media_type_str_lower_case = g_strdup(media_type_str);
g_strdown(media_type_str_lower_case);
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c
index 0f4a5d79e6..c7cc5d07b0 100644
--- a/epan/dissectors/packet-rsvp.c
+++ b/epan/dissectors/packet-rsvp.c
@@ -4617,12 +4617,12 @@ dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree,
"C-type: 2 (globally unique)");
proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
val_to_str(type, address_type_vals, "Unknown (%u)"));
- str = (char*)tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
+ str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
"International Segment: %s", str);
proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ",
val_to_str(type, address_type_vals, "Unknown (%u)"), str);
- str = (char*)tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
+ str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
"National Segment: %s", str);
proto_item_append_text(ti, "Natl Segment: %s. ", str);
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 65ebf68afe..2e3621bf3d 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -2082,7 +2082,7 @@ dissect_negprot_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/*Dialect Name */
CHECK_BYTE_COUNT(len);
proto_tree_add_string(dtr, hf_smb_dialect_name, tvb, offset,
- len, (char*)str);
+ len, str);
COUNT_BYTES(len);
}
@@ -2429,7 +2429,7 @@ dissect_old_dir_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Directory: %s",
- format_text(dn, strlen((guchar*)dn)));
+ format_text(dn, strlen(dn)));
}
END_OF_SMB
@@ -2534,7 +2534,7 @@ dissect_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(an, strlen((guchar*)an)));
+ format_text(an, strlen(an)));
}
/* buffer format */
@@ -2813,12 +2813,12 @@ dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "Old File Name: %s", format_text(fn, strlen((guchar*)fn)));
+ fn_len, fn, "Old File Name: %s", format_text(fn, strlen(fn)));
COUNT_BYTES(fn_len);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* buffer format */
@@ -2832,12 +2832,12 @@ dissect_move_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "New File Name: %s", format_text(fn, strlen((guchar*)fn)));
+ fn_len, fn, "New File Name: %s", format_text(fn, strlen(fn)));
COUNT_BYTES(fn_len);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -2882,12 +2882,12 @@ dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if (fn == NULL)
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
- fn_len, fn, "Source File Name: %s", format_text(fn, strlen((guchar*)fn)));
+ fn_len, fn, "Source File Name: %s", format_text(fn, strlen(fn)));
COUNT_BYTES(fn_len);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* buffer format */
@@ -2902,11 +2902,11 @@ dissect_copy_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
goto endofcommand;
proto_tree_add_string_format(tree, hf_smb_file_name, tvb, offset,
fn_len, fn, "Destination File Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
COUNT_BYTES(fn_len);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Destination Name: %s", format_text(fn, strlen((guchar*)fn)));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Destination Name: %s", format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -2989,7 +2989,7 @@ dissect_open_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3253,7 +3253,7 @@ dissect_create_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3318,7 +3318,7 @@ dissect_delete_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3360,7 +3360,7 @@ dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* buffer format */
@@ -3379,7 +3379,7 @@ dissect_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3427,7 +3427,7 @@ dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Old Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* buffer format */
@@ -3446,7 +3446,7 @@ dissect_nt_rename_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", New Name: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3486,7 +3486,7 @@ dissect_query_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3564,7 +3564,7 @@ dissect_set_information_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -3933,7 +3933,7 @@ dissect_create_temporary_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -4777,7 +4777,7 @@ dissect_search_find_request(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* buffer format */
@@ -5395,7 +5395,7 @@ dissect_open_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -6318,8 +6318,8 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
else
col_append_fstr(pinfo->cinfo, COL_INFO,
"%s\\%s",
- format_text(dn, strlen((guchar*)dn)),
- format_text(an, strlen((guchar*)an)));
+ format_text(dn, strlen(dn)),
+ format_text(an, strlen(an)));
}
/* OS */
@@ -6656,7 +6656,7 @@ dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(an, strlen((guchar*)an)));
+ format_text(an, strlen(an)));
}
/*
@@ -6669,7 +6669,7 @@ dissect_tree_connect_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* XXX - what if this runs past bc? */
an_len = tvb_strsize(tvb, offset);
CHECK_BYTE_COUNT(an_len);
- an = (char*)tvb_get_ptr(tvb, offset, an_len);
+ an = tvb_get_ptr(tvb, offset, an_len);
proto_tree_add_string(tree, hf_smb_service, tvb,
offset, an_len, an);
COUNT_BYTES(an_len);
@@ -6769,7 +6769,7 @@ dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* XXX - what if this runs past bc? */
an_len = tvb_strsize(tvb, offset);
CHECK_BYTE_COUNT(an_len);
- an = (char*)tvb_get_ptr(tvb, offset, an_len);
+ an = tvb_get_ptr(tvb, offset, an_len);
proto_tree_add_string(tree, hf_smb_service, tvb,
offset, an_len, an);
COUNT_BYTES(an_len);
@@ -7909,7 +7909,7 @@ dissect_nt_trans_param_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
bc -= 1;
/* file name */
- fn = (char*)get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, &bc);
+ fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, &bc);
if (fn != NULL) {
proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len,
fn);
@@ -8507,7 +8507,7 @@ dissect_nt_trans_param_response(tvbuff_t *tvb, packet_info *pinfo,
if(len<0)break;
/* file name */
- fn = (char*)get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, &bc);
+ fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, &bc);
if (fn == NULL)
break;
proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len,
@@ -9348,7 +9348,7 @@ dissect_nt_create_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
END_OF_SMB
@@ -9978,7 +9978,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
case 0x01: /*TRANS2_FIND_FIRST2*/
@@ -10019,7 +10019,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Pattern: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10061,7 +10061,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Continue: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10110,7 +10110,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10137,7 +10137,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10267,7 +10267,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Path: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10301,7 +10301,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Dir: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
case 0x0e: /*TRANS2_SESSION_SETUP*/
@@ -10322,7 +10322,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10336,7 +10336,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
break;
@@ -10845,7 +10845,7 @@ dissect_4_2_16_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* EA name */
name = tvb_get_ephemeral_string(tvb, offset, name_len);
- proto_item_append_text(item, ": %s", format_text(name, strlen((guchar*)name)));
+ proto_item_append_text(item, ": %s", format_text(name, strlen(name)));
CHECK_BYTE_COUNT_SUBR(name_len + 1);
proto_tree_add_item(
@@ -11158,7 +11158,7 @@ dissect_qfi_SMB_FILE_ALL_INFO(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* file name */
CHECK_BYTE_COUNT_SUBR(fn_len);
- fn = (char*)get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, bcp);
+ fn = get_unicode_or_ascii_string(tvb, &offset, si->unicode, &fn_len, TRUE, TRUE, bcp);
if (fn != NULL) {
proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len,
fn);
@@ -11229,7 +11229,7 @@ dissect_qfi_SMB_FILE_STREAM_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
fn);
COUNT_BYTES_SUBR(fn_len);
- proto_item_append_text(item, ": %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, ": %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
if (neo == 0)
@@ -12595,10 +12595,10 @@ dissect_4_3_4_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -12701,10 +12701,10 @@ dissect_4_3_4_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -12785,7 +12785,7 @@ dissect_4_3_4_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* skip to next structure */
@@ -12803,7 +12803,7 @@ dissect_4_3_4_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -12890,7 +12890,7 @@ dissect_4_3_4_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* skip to next structure */
@@ -12908,7 +12908,7 @@ dissect_4_3_4_5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -13021,7 +13021,7 @@ dissect_4_3_4_6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* skip to next structure */
@@ -13039,7 +13039,7 @@ dissect_4_3_4_6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
@@ -13100,7 +13100,7 @@ dissect_4_3_4_7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- format_text(fn, strlen((guchar*)fn)));
+ format_text(fn, strlen(fn)));
}
/* skip to next structure */
@@ -13118,7 +13118,7 @@ dissect_4_3_4_7(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- proto_item_append_text(item, " File: %s", format_text(fn, strlen((guchar*)fn)));
+ proto_item_append_text(item, " File: %s", format_text(fn, strlen(fn)));
proto_item_set_len(item, offset-old_offset);
*trunc = FALSE;
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index f1ac5454da..5dbdc4556d 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -1711,7 +1711,7 @@ static void
dissect_smb2_secblob(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, smb2_info_t *si _U_)
{
if( (tvb_length(tvb)>=7)
- && (!tvb_memeql(tvb, 0, (guint8*)"NTLMSSP", 7))){
+ && (!tvb_memeql(tvb, 0, "NTLMSSP", 7))){
call_dissector(ntlmssp_handle, tvb, pinfo, tree);
} else {
call_dissector(gssapi_handle, tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index ddc7126c87..fe3f05ee35 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -262,7 +262,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (linelen >= 4 && ISALPHA(line[0]) && ISALPHA(line[1]) &&
ISALPHA(line[2]) && ISALPHA(line[3]) &&
(linelen == 4 || line[4] == ' ')) {
- if (strncasecmp((char*)line, "DATA", 4) == 0) {
+ if (strncasecmp(line, "DATA", 4) == 0) {
/*
* DATA command.
@@ -281,9 +281,9 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
} else {
- if ((linelen >= 7) && line[0] == 'X' && ( (strncasecmp((char*)line, "X-EXPS ", 7) == 0) ||
- ((linelen >=13) && (strncasecmp((char*)line, "X-LINK2STATE ", 13) == 0)) ||
- ((linelen >= 8) && (strncasecmp((char*)line, "XEXCH50 ", 8) == 0)) ))
+ if ((linelen >= 7) && line[0] == 'X' && ( (strncasecmp(line, "X-EXPS ", 7) == 0) ||
+ ((linelen >=13) && (strncasecmp(line, "X-LINK2STATE ", 13) == 0)) ||
+ ((linelen >= 8) && (strncasecmp(line, "XEXCH50 ", 8) == 0)) ))
frame_data->pdu_type = SMTP_PDU_CMD;
else
/*
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index a89a1c79be..8835870694 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -2424,7 +2424,7 @@ dissect_control_0e(tvbuff_t *tvb, proto_tree *tree)
buf = tvb_get_ephemeral_string(tvb, 3, len);
EBCDIC_to_ASCII(buf, len);
- proto_tree_add_string(tree, hf_sna_control_0e_value, tvb, 3, len, (char*)buf);
+ proto_tree_add_string(tree, hf_sna_control_0e_value, tvb, 3, len, buf);
}
static void
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 9bdfa61bfc..15c07a204d 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -5910,7 +5910,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v
char *variableBuffer;
char *valueBuffer;
- variableBuffer = (char*)tvb_get_ephemeral_string(tvb, variableStart, variableLength);
+ variableBuffer = tvb_get_ephemeral_string(tvb, variableStart, variableLength);
if (valueEnd < valueStart)
{
@@ -5923,7 +5923,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v
valueLength = valueEnd-valueStart;
/* XXX - if this throws an exception, "variableBuffer"
is leaked */
- valueBuffer = (char*)tvb_get_ephemeral_string(tvb, valueStart, valueLength);
+ valueBuffer = tvb_get_ephemeral_string(tvb, valueStart, valueLength);
}
/* Check for variables with no value */
diff --git a/epan/dissectors/packet-ymsg.c b/epan/dissectors/packet-ymsg.c
index 4005508aca..1c2420b926 100644
--- a/epan/dissectors/packet-ymsg.c
+++ b/epan/dissectors/packet-ymsg.c
@@ -337,7 +337,7 @@ static gboolean
dissect_ymsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- if (tvb_memeql(tvb, 0, (guint8*)"YMSG", 4) == -1) {
+ if (tvb_memeql(tvb, 0, "YMSG", 4) == -1) {
/* Not a Yahoo Messenger packet. */
return FALSE;
}
diff --git a/epan/proto.c b/epan/proto.c
index f90fa183c6..b8fe50d426 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -943,7 +943,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, int hfindex,
string = ep_alloc(length);
- tvb_memcpy(tvb, (guint8*)string, start, length);
+ tvb_memcpy(tvb, string, start, length);
} else if (length == 0) {
string = "[Empty]";
} else {
@@ -978,7 +978,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, int hfindex,
* we made string values counted
* rather than null-terminated.)
*/
- string = (gchar*)tvb_get_ephemeral_string(tvb,
+ string = tvb_get_ephemeral_string(tvb,
start,
length);
}
@@ -1965,7 +1965,7 @@ proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length
length = tvb_ensure_length_remaining(tvb, start);
}
- string = (gchar*)tvb_get_ephemeral_string(tvb, start, length);
+ string = tvb_get_ephemeral_string(tvb, start, length);
proto_tree_set_string(fi, string);
}
@@ -3872,14 +3872,14 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_STRINGZ:
case FT_UINT_STRING:
bytes = fvalue_get(&fi->value);
- if(strlen((char*)bytes) > ITEM_LABEL_LENGTH) {
+ if(strlen(bytes) > ITEM_LABEL_LENGTH) {
ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s [truncated]: %s", hfinfo->name,
- format_text(bytes, strlen((char*)bytes)));
+ format_text(bytes, strlen(bytes)));
} else {
ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %s", hfinfo->name,
- format_text(bytes, strlen((char*)bytes)));
+ format_text(bytes, strlen(bytes)));
}
if ((ret == -1) || (ret >= ITEM_LABEL_LENGTH))
label_str[ITEM_LABEL_LENGTH - 1] = '\0';
diff --git a/epan/req_resp_hdrs.c b/epan/req_resp_hdrs.c
index 078b2bab3f..6947c47052 100644
--- a/epan/req_resp_hdrs.c
+++ b/epan/req_resp_hdrs.c
@@ -148,7 +148,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
if (tvb_strncaseeql(tvb, next_offset_sav,
"Content-Length:", 15) == 0) {
- header_val = (gchar*)tvb_get_ephemeral_string(tvb,
+ header_val = tvb_get_ephemeral_string(tvb,
next_offset_sav + 15,
linelen - 15);
if (sscanf(header_val,
@@ -161,7 +161,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
} else if (tvb_strncaseeql(tvb, next_offset_sav,
"Connection:", 11) == 0) {
/* Check for keep-alive */
- header_val = (gchar*)tvb_get_ephemeral_string(tvb,
+ header_val = tvb_get_ephemeral_string(tvb,
next_offset_sav + 11,
linelen - 11);
if(header_val){
@@ -184,7 +184,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
gchar *p;
gint len;
- header_val = (gchar*)tvb_get_ephemeral_string(tvb,
+ header_val = tvb_get_ephemeral_string(tvb,
next_offset_sav + 18, linelen - 18);
p = header_val;
len = strlen(header_val);
@@ -282,7 +282,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
/* We have a line with the chunk size in it.*/
- chunk_string = (gchar*)tvb_get_ephemeral_string(tvb, next_offset,
+ chunk_string = tvb_get_ephemeral_string(tvb, next_offset,
linelen);
c = chunk_string;
diff --git a/epan/sigcomp-udvm.c b/epan/sigcomp-udvm.c
index 910529d565..d1d0259e59 100644
--- a/epan/sigcomp-udvm.c
+++ b/epan/sigcomp-udvm.c
@@ -2463,7 +2463,7 @@ execute_next_instruction:
if (print_level_3 ){
proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,
" Addr: %5u State value: %u (0x%x) ASCII(%s)",
- k,buff[k],buff[k],format_text((guchar*)string, 1));
+ k,buff[k],buff[k],format_text(string, 1));
}
k = ( k + 1 ) & 0xffff;
n++;
@@ -2584,7 +2584,7 @@ execute_next_instruction:
if (print_level_3 ){
proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,
" Output value: %u (0x%x) ASCII(%s) from Addr: %u ,output to dispatcher position %u",
- buff[k],buff[k],format_text((guchar*)string,1), k,output_address);
+ buff[k],buff[k],format_text(string,1), k,output_address);
}
k = ( k + 1 ) & 0xffff;
output_address ++;
diff --git a/epan/sigcomp_state_hdlr.c b/epan/sigcomp_state_hdlr.c
index 623b5859bd..26e01f4e10 100644
--- a/epan/sigcomp_state_hdlr.c
+++ b/epan/sigcomp_state_hdlr.c
@@ -467,7 +467,7 @@ int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_
partial_state[n] = buff[p_id_start + n];
n++;
}
- partial_state_str = bytes_to_str((guint8*)partial_state, p_id_length);
+ partial_state_str = bytes_to_str(partial_state, p_id_length);
proto_tree_add_text(tree,tvb, 0, -1,"### Accessing state ###");
proto_tree_add_string(tree,hf_id, tvb, 0, 0, partial_state_str);
@@ -581,7 +581,7 @@ void udvm_state_create(guint8 *state_buff,guint8 *state_identifier,guint16 p_id_
partial_state[i] = state_identifier[i];
i++;
}
- partial_state_str = bytes_to_str((guint8*)partial_state, p_id_length);
+ partial_state_str = bytes_to_str(partial_state, p_id_length);
dummy_buff = g_hash_table_lookup(state_buffer_table, partial_state_str);
if ( dummy_buff == NULL ){
diff --git a/epan/stats_tree.c b/epan/stats_tree.c
index d63cb0f970..ec533ca7f0 100644
--- a/epan/stats_tree.c
+++ b/epan/stats_tree.c
@@ -48,13 +48,13 @@ static GHashTable* registry = NULL;
extern void stats_tree_get_strs_from_node(const stat_node* node, guint8* value, guint8* rate, guint8* percent) {
float f;
- if (value) g_snprintf((char*)value,NUM_BUF_SIZE,"%u",node->counter);
+ if (value) g_snprintf(value,NUM_BUF_SIZE,"%u",node->counter);
if (rate) {
*rate = '\0';
if (node->st->elapsed > 0.0) {
f = ((float)node->counter) / (float)node->st->elapsed;
- g_snprintf((gchar*)rate,NUM_BUF_SIZE,"%f",f);
+ g_snprintf(rate,NUM_BUF_SIZE,"%f",f);
}
}
@@ -62,7 +62,7 @@ extern void stats_tree_get_strs_from_node(const stat_node* node, guint8* value,
*percent = '\0';
if (node->parent->counter > 0) {
f = (float)(((float)node->counter * 100.0) / node->parent->counter);
- g_snprintf((gchar*)percent,NUM_BUF_SIZE,"%.2f%%",f);
+ g_snprintf(percent,NUM_BUF_SIZE,"%.2f%%",f);
}
}
}
@@ -73,10 +73,10 @@ if buffer is NULL returns a newly allocated string */
extern guint8* stats_tree_node_to_str(const stat_node* node,
guint8* buffer, guint len) {
if (buffer) {
- g_snprintf((gchar*)buffer,len,"%s: %i",node->name, node->counter);
+ g_snprintf(buffer,len,"%s: %i",node->name, node->counter);
return buffer;
} else {
- return (guint8*)g_strdup_printf("%s: %i",node->name, node->counter);
+ return g_strdup_printf("%s: %i",node->name, node->counter);
}
}
@@ -117,7 +117,7 @@ extern void stats_tree_branch_to_str(const stat_node* node, GString* s, guint in
format = g_strdup_printf(" %%s%%-%us%%12s %%12s %%12s\n",stats_tree_branch_max_namelen(node,0));
}
- stats_tree_get_strs_from_node(node, (guint8*)value, (guint8*)rate, (guint8*)percent);
+ stats_tree_get_strs_from_node(node, value, rate, percent);
indent = indent > INDENT_MAX ? INDENT_MAX : indent;
@@ -256,9 +256,9 @@ extern void stats_tree_register(const guint8* tapname,
/* at the very least the abbrev and the packet function should be given */
g_assert( tapname && abbr && packet );
- cfg->tapname = (guint8*)g_strdup((gchar*)tapname);
- cfg->abbr = (guint8*)g_strdup((gchar*)abbr);
- cfg->name = name ? (guint8*)g_strdup((gchar*)name) : (guint8*)g_strdup((gchar*)abbr);
+ cfg->tapname = g_strdup(tapname);
+ cfg->abbr = g_strdup(abbr);
+ cfg->name = name ? g_strdup(name) : g_strdup(abbr);
cfg->packet = packet;
cfg->init = init;
@@ -294,7 +294,7 @@ extern stats_tree* stats_tree_new(stats_tree_cfg* cfg, tree_pres* pr,char* filte
st->elapsed = 0.0;
st->root.counter = 0;
- st->root.name = g_strdup((gchar*)cfg->name);
+ st->root.name = g_strdup(cfg->name);
st->root.st = st;
st->root.parent = NULL;
st->root.children = NULL;
@@ -494,7 +494,7 @@ extern int stats_tree_manip_node(manip_node_mode mode, stats_tree* st, const gui
}
if ( node == NULL )
- node = new_stat_node(st,(gchar*)name,parent_id,with_hash,with_hash);
+ node = new_stat_node(st,name,parent_id,with_hash,with_hash);
switch (mode) {
case MN_INCREASE: node->counter += value; break;
@@ -518,7 +518,7 @@ extern guint8* stats_tree_get_abbr(const guint8* optarg) {
for (i=0; optarg[i] && optarg[i] != ','; i++);
if (optarg[i] == ',') {
- return (guint8*)g_strndup((gchar*)optarg,i);
+ return g_strndup(optarg,i);
} else {
return NULL;
}
@@ -593,7 +593,7 @@ extern int stats_tree_create_range_node(stats_tree* st,
va_start( list, parent_id );
while (( curr_range = va_arg(list, guint8*) )) {
- range_node = new_stat_node(st, (gchar*)curr_range, rng_root->id, FALSE, FALSE);
+ range_node = new_stat_node(st, curr_range, rng_root->id, FALSE, FALSE);
range_node->rng = get_range(curr_range);
}
va_end( list );
@@ -624,7 +624,7 @@ extern int stats_tree_range_node_with_pname(stats_tree* st,
va_start( list, parent_name );
while (( curr_range = va_arg(list, guint8*) )) {
- range_node = new_stat_node(st, (gchar*)curr_range, rng_root->id, FALSE, FALSE);
+ range_node = new_stat_node(st, curr_range, rng_root->id, FALSE, FALSE);
range_node->rng = get_range(curr_range);
}
va_end( list );
@@ -703,7 +703,7 @@ extern int stats_tree_tick_pivot(stats_tree* st,
stat_node* parent = g_ptr_array_index(st->parents,pivot_id);
parent->counter++;
- stats_tree_manip_node( MN_INCREASE, st, (guint8*)pivot_value, pivot_id, FALSE, 1);
+ stats_tree_manip_node( MN_INCREASE, st, pivot_value, pivot_id, FALSE, 1);
return pivot_id;
}
diff --git a/epan/tvbparse.c b/epan/tvbparse.c
index f37f103cc6..7b0114ddba 100644
--- a/epan/tvbparse.c
+++ b/epan/tvbparse.c
@@ -512,7 +512,7 @@ static int cond_hash(tvbparse_t* tt, int offset, const tvbparse_wanted_t* wanted
if (key_len < 0)
return -1;
- key = (gchar*)tvb_get_ephemeral_string(key_elem->tvb,key_elem->offset,key_elem->len);
+ key = tvb_get_ephemeral_string(key_elem->tvb,key_elem->offset,key_elem->len);
#ifdef TVBPARSE_DEBUG
if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: got key='%s'",key);
#endif