aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2020-07-07 09:37:44 +0200
committerAnders Broman <a.broman58@gmail.com>2020-07-07 09:50:35 +0000
commit8a4e53cbeda67ed939e4af01b6ec067be204265e (patch)
tree133a40f5bc4ce104a80a5d533c20f0ee0cbcbb53
parentdc42e2b1cb4d25e4ccb7316a0e19376c94482e5e (diff)
Fix -Wpointer-sign warnings.
Change-Id: Ide037ee1d2f9e52cb024f7335154e12ce09ac010 Reviewed-on: https://code.wireshark.org/review/37767 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-9p.c12
-rw-r--r--epan/dissectors/packet-afp.c20
2 files changed, 16 insertions, 16 deletions
diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c
index 7f8c9702de..129cb5126e 100644
--- a/epan/dissectors/packet-9p.c
+++ b/epan/dissectors/packet-9p.c
@@ -1248,7 +1248,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (!pinfo->fd->visited) {
_9p_len = tvb_get_letohs(tvb, offset);
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
if (!strcmp(tvb_s, "9P2000.L")) {
u32 = _9P2000_L;
@@ -1318,7 +1318,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if(!pinfo->fd->visited) {
_9p_len = tvb_get_letohs(tvb, offset);
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
conv_set_fid(pinfo, fid, tvb_s, _9p_len+1);
}
offset += _9p_dissect_string(tvb, ninep_tree, offset, hf_9P_aname, ett_9P_aname);
@@ -1353,7 +1353,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
for(i = 0 ; i < u16; i++) {
if (!pinfo->fd->visited) {
_9p_len = tvb_get_letohs(tvb, offset);
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
wmem_strbuf_append_c(tmppath, '/');
wmem_strbuf_append(tmppath, tvb_s);
}
@@ -1433,7 +1433,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
wmem_strbuf_append(tmppath, fid_path);
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
wmem_strbuf_append(tmppath, tvb_s);
}
offset += _9p_dissect_string(tvb, ninep_tree, offset, hf_9P_filename, ett_9P_filename);
@@ -1466,7 +1466,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
wmem_strbuf_append(tmppath, fid_path);
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
wmem_strbuf_append(tmppath, tvb_s);
}
offset += _9p_dissect_string(tvb, ninep_tree, offset, hf_9P_filename, ett_9P_filename);
@@ -1812,7 +1812,7 @@ static int dissect_9P_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
wmem_strbuf_append(tmppath, conv_get_fid(pinfo, dfid));
wmem_strbuf_append_c(tmppath, '/');
- tvb_s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
+ tvb_s = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, _9p_len, ENC_UTF_8|ENC_NA);
wmem_strbuf_append(tmppath, tvb_s);
conv_set_fid(pinfo, fid, wmem_strbuf_get_str(tmppath), wmem_strbuf_get_len(tmppath)+1);
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index f977844c4b..fee7a2b530 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -2544,7 +2544,7 @@ dissect_query_afp_set_vol_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
/* ***************************/
static gint
-decode_uam_parameters(const guint8 *uam, int len_uam, tvbuff_t *tvb, proto_tree *tree, gint offset)
+decode_uam_parameters(const gchar *uam, int len_uam, tvbuff_t *tvb, proto_tree *tree, gint offset)
{
int len;
@@ -2577,13 +2577,13 @@ dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
{
int len;
int len_uam;
- const guint8 *uam;
+ const gchar *uam;
len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_afp_Version, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len +1;
len_uam = tvb_get_guint8(tvb, offset);
- uam = tvb_get_string_enc(wmem_packet_scope(), tvb, offset +1, len_uam, ENC_UTF_8|ENC_NA);
+ uam = (const gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset +1, len_uam, ENC_UTF_8|ENC_NA);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len_uam +1;
@@ -2604,7 +2604,7 @@ dissect_query_afp_login_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
{
int len;
int len_uam;
- const guint8 *uam;
+ const gchar *uam;
guint8 path_type;
PAD(1);
@@ -2616,7 +2616,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 = tvb_get_string_enc(wmem_packet_scope(), tvb, offset +1, len_uam, ENC_UTF_8|ENC_NA);
+ uam = (const gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset +1, len_uam, ENC_UTF_8|ENC_NA);
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN);
offset += len_uam +1;
@@ -4216,7 +4216,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
guint byte_order;
gboolean mark_exists;
tvbuff_t *spotlight_tvb;
- guint8 *str_tmp;
+ gchar *str_tmp;
proto_item *item_query;
proto_tree *sub_tree;
@@ -4356,7 +4356,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
case SQ_TYPE_DATA:
switch (cpx_query_type) {
case SQ_CPX_TYPE_STRING:
- str_tmp = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 8, query_length - 8, ENC_UTF_8|ENC_NA);
+ str_tmp = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 8, query_length - 8, ENC_UTF_8|ENC_NA);
proto_tree_add_string(tree, hf_afp_string, tvb, offset, query_length, str_tmp);
break;
case SQ_CPX_TYPE_UTF16_STRING: {
@@ -4368,7 +4368,7 @@ spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
} else
mark_exists = TRUE;
- str_tmp = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + (mark_exists ? 10 : 8),
+ str_tmp = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + (mark_exists ? 10 : 8),
query_length - (mark_exists? 10 : 8), ENC_UTF_16 | byte_order);
proto_tree_add_string(tree, hf_afp_utf_16_string, tvb, offset, query_length, str_tmp);
break;
@@ -4435,7 +4435,7 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
proto_tree *sub_tree_toc;
proto_item *ti;
- if (strncmp(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 8, ENC_UTF_8|ENC_NA), "md031234", 8) == 0)
+ if (strncmp((gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 8, ENC_UTF_8|ENC_NA), "md031234", 8) == 0)
encoding = ENC_BIG_ENDIAN;
else
encoding = ENC_LITTLE_ENDIAN;
@@ -5072,7 +5072,7 @@ dissect_afp_server_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
offset = utf_ofs;
ulen = tvb_get_ntohs(tvb, offset);
- tmp = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, ulen, ENC_UTF_8|ENC_NA);
+ tmp = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, ulen, ENC_UTF_8|ENC_NA);
sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, ulen + 2,
ett_afp_utf8_name, NULL, "UTF-8 server name: %s", tmp);
proto_tree_add_uint(sub_tree, hf_afp_utf8_server_name_len, tvb, offset, 2, ulen);