aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-04-18 12:35:36 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-04-18 12:35:36 +0000
commit68ec58d385e313d0c85f36cc94e76d73f6d2af2c (patch)
tree31e6024ab3eb3e03c40c324df6650fa14f3230ac
parent658fc3cb04f713eb4463bbc653ce360af487c3ea (diff)
Fix some: 'cast discards qualifiers from pointer target type' warnings
- Add const qualifier - Remove some strange casts svn path=/trunk/; revision=42131
-rw-r--r--epan/dissectors/packet-cups.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c4
-rw-r--r--epan/dissectors/packet-gsm_rlcmac.c6
-rw-r--r--epan/dissectors/packet-ip.c2
-rw-r--r--epan/dissectors/packet-irc.c12
-rw-r--r--epan/dissectors/packet-megaco.c2
-rw-r--r--epan/dissectors/packet-pdcp-lte.c4
-rw-r--r--epan/dissectors/packet-rohc.c4
-rw-r--r--epan/dissectors/packet-roofnet.c4
-rw-r--r--epan/dissectors/packet-sdp.c4
-rw-r--r--epan/tvbuff.c5
-rw-r--r--ui/gtk/airpcap_gui_utils.c2
-rw-r--r--ui/gtk/airpcap_gui_utils.h2
-rw-r--r--ui/gtk/summary_dlg.c2
14 files changed, 27 insertions, 28 deletions
diff --git a/epan/dissectors/packet-cups.c b/epan/dissectors/packet-cups.c
index 1a1d2ceb1d..29918aa1e5 100644
--- a/epan/dissectors/packet-cups.c
+++ b/epan/dissectors/packet-cups.c
@@ -336,7 +336,7 @@ get_unquoted_string(tvbuff_t *tvb, gint offset, gint *next_offset, guint *len)
guint l = 0;
gint o;
- o = tvb_pbrk_guint8(tvb, offset, -1, (const guint8*)" \t\r\n", NULL);
+ o = tvb_pbrk_guint8(tvb, offset, -1, " \t\r\n", NULL);
if (o != -1) {
l = o - offset;
s = tvb_get_ptr(tvb, offset, l);
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index e577a00d4e..e943d1f121 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -4057,13 +4057,13 @@ dissect_dcerpc_cn_rts (tvbuff_t *tvb, gint offset, packet_info *pinfo,
switch (addrtype) {
case RTS_IPV4: {
const guint32 addr4 = tvb_get_ipv4(tvb, offset);
- proto_tree_add_text(cn_rts_command_tree, tvb, offset, 4, "%s", (const char *)get_hostname(addr4));
+ proto_tree_add_text(cn_rts_command_tree, tvb, offset, 4, "%s", get_hostname(addr4));
offset += 4;
} break;
case RTS_IPV6: {
struct e_in6_addr addr6;
tvb_get_ipv6(tvb, offset, &addr6);
- proto_tree_add_text(cn_rts_command_tree, tvb, offset, 16, "%s", (const char *)get_hostname6(&addr6));
+ proto_tree_add_text(cn_rts_command_tree, tvb, offset, 16, "%s", get_hostname6(&addr6));
offset += 16;
} break;
}
diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c
index 991db7a02c..3b97b059e4 100644
--- a/epan/dissectors/packet-gsm_rlcmac.c
+++ b/epan/dissectors/packet-gsm_rlcmac.c
@@ -5993,7 +5993,7 @@ CSN_DESCR_END (PSI13_t)
-typedef char* MT_Strings_t;
+typedef const char* MT_Strings_t;
static const MT_Strings_t szMT_Downlink[] = {
"Invalid Message Type", /* 0x00 */
@@ -6078,7 +6078,7 @@ static const MT_Strings_t szMT_Uplink[] = {
"PACKET_SI_STATUS", /* 0x0D */
};
-static char*
+static const char*
MT_DL_TextGet(guint8 mt)
{
if (mt < ElementsOf(szMT_Downlink))
@@ -6091,7 +6091,7 @@ MT_DL_TextGet(guint8 mt)
}
}
-static char*
+static const char*
MT_UL_TextGet(guint8 mt)
{
if (mt < ElementsOf(szMT_Uplink))
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 74417091e6..51ed6205ad 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1178,7 +1178,7 @@ dissect_ipopt_timestamp(const ip_tcp_opt *optp, tvbuff_t *tvb,
proto_tree_add_text(field_tree, tvb, offset + optoffset, 8,
"Address = %s, time stamp = %u",
((addr == 0) ? "-" :
- (const char *)get_hostname(addr)), ts);
+ get_hostname(addr)), ts);
optoffset += 8;
} else {
if (optlen < 4) {
diff --git a/epan/dissectors/packet-irc.c b/epan/dissectors/packet-irc.c
index 341b328da4..cf6efefd53 100644
--- a/epan/dissectors/packet-irc.c
+++ b/epan/dissectors/packet-irc.c
@@ -134,7 +134,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off
if (tvb_get_guint8(tvb, offset) == ':')
{
/* find the end of the prefix */
- eop_offset = tvb_pbrk_guint8(tvb, offset+1, linelen-1, (const guint8 *)" ", &found_needle);
+ eop_offset = tvb_pbrk_guint8(tvb, offset+1, linelen-1, " ", &found_needle);
if (eop_offset == -1)
{
expert_add_info_format(pinfo, request_item, PI_MALFORMED, PI_ERROR, "Prefix missing ending <space>");
@@ -157,7 +157,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off
return;
}
- eoc_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, (const guint8 *)" ", &found_needle);
+ eoc_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, " ", &found_needle);
if (eoc_offset == -1)
{
proto_tree_add_item(request_tree, hf_irc_request_command, tvb, offset, linelen-offset, ENC_ASCII|ENC_NA);
@@ -211,7 +211,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off
while(offset < end_offset)
{
- eocp_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, (const guint8 *)" ", &found_needle);
+ eocp_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, " ", &found_needle);
tag_start_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, TAG_DELIMITER, &found_tag_needle);
/* Create subtree when the first parameter is found */
@@ -302,7 +302,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
if (tvb_get_guint8(tvb, offset) == ':')
{
/* find the end of the prefix */
- eop_offset = tvb_pbrk_guint8(tvb, offset+1, linelen-1, (const guint8 *)" ", &found_needle);
+ eop_offset = tvb_pbrk_guint8(tvb, offset+1, linelen-1, " ", &found_needle);
if (eop_offset == -1)
{
expert_add_info_format(pinfo, response_item, PI_MALFORMED, PI_ERROR, "Prefix missing ending <space>");
@@ -325,7 +325,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
return;
}
- eoc_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, (const guint8 *)" ", &found_needle);
+ eoc_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, " ", &found_needle);
if (eoc_offset == -1)
{
proto_tree_add_item(response_tree, hf_irc_response_command, tvb, offset, linelen-offset, ENC_ASCII|ENC_NA);
@@ -383,7 +383,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
while(offset < end_offset)
{
- eocp_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, (const guint8 *)" ", &found_needle);
+ eocp_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, " ", &found_needle);
tag_start_offset = tvb_pbrk_guint8(tvb, offset, linelen-offset, TAG_DELIMITER, &found_tag_needle);
/* Create subtree when the first parameter is found */
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index edd374b76b..f05cd1976b 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -3314,7 +3314,7 @@ static gint megaco_tvb_find_token(tvbuff_t* tvb, gint offset, gint maxlength){
guchar needle;
do {
- pos = tvb_pbrk_guint8(tvb, pos + 1, maxlength,(guint8*)"{}", &needle);
+ pos = tvb_pbrk_guint8(tvb, pos + 1, maxlength, "{}", &needle);
if(pos == -1)
return -1;
switch(needle){
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index d16f122e02..48c41d9dbf 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1036,8 +1036,8 @@ static int dissect_pdcp_ir_packet(proto_tree *tree,
/* Add summary to root item */
proto_item_append_text(root_ti, " (prot=%s: %s -> %s)",
val_to_str_const(protocol, ip_protocol_vals, "Unknown"),
- (char*)get_hostname(source),
- (char*)get_hostname(dest));
+ get_hostname(source),
+ get_hostname(dest));
}
/* UDP static part. TODO: also check protocol from last part!? */
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index 8612dc5685..8401e9e3b8 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -1151,8 +1151,8 @@ dissect_rohc_ir_rtp_udp_profile_static(tvbuff_t *tvb, proto_tree *tree, packet_i
/* Add summary to root item */
proto_item_append_text(ipv4_item, " (prot=%s: %s -> %s)",
val_to_str_ext_const(protocol, &ipproto_val_ext, "Unknown"),
- (char*)get_hostname(source),
- (char*)get_hostname(dest));
+ get_hostname(source),
+ get_hostname(dest));
}
break;
case 6:
diff --git a/epan/dissectors/packet-roofnet.c b/epan/dissectors/packet-roofnet.c
index a4db0b1366..56601151ca 100644
--- a/epan/dissectors/packet-roofnet.c
+++ b/epan/dissectors/packet-roofnet.c
@@ -147,8 +147,8 @@ static void dissect_roofnet_link(proto_tree *tree, tvbuff_t *tvb, guint *offset,
it = proto_tree_add_text(tree, tvb, *offset, ROOFNET_LINK_LEN,
"link: %u, src: %s, dst: %s",
link,
- (char*)get_hostname(addr_src),
- (char*)get_hostname(addr_dst));
+ get_hostname(addr_src),
+ get_hostname(addr_dst));
subtree= proto_item_add_subtree(it, ett_roofnet_link);
proto_tree_add_ipv4(subtree, hf_roofnet_link_src, tvb, *offset, 4, addr_src);
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index a11bf0192c..8bb1e260ba 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -1035,7 +1035,7 @@ static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, pr
offset = next_offset + 1;
if (strcmp((char*)field_name, "ipbcp") == 0) {
- offset = tvb_pbrk_guint8(tvb,offset,-1,(guint8 *)"0123456789", NULL);
+ offset = tvb_pbrk_guint8(tvb,offset,-1,"0123456789", NULL);
if (offset == -1)
return;
@@ -1049,7 +1049,7 @@ static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, pr
proto_tree_add_item(sdp_session_attribute_tree,hf_ipbcp_version,tvb,offset,tokenlen,ENC_ASCII|ENC_NA);
- offset = tvb_pbrk_guint8(tvb,offset,-1,(guint8 *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ", NULL);
+ offset = tvb_pbrk_guint8(tvb,offset,-1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ", NULL);
if (offset == -1)
return;
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index c6b9d694ce..2aa6f5f49f 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2835,7 +2835,7 @@ tvb_find_line_end(tvbuff_t *tvb, const gint offset, int len, gint *next_offset,
/*
* Look either for a CR or an LF.
*/
- eol_offset = tvb_pbrk_guint8(tvb, offset, len, (const guint8 *)"\r\n", &found_needle);
+ eol_offset = tvb_pbrk_guint8(tvb, offset, len, "\r\n", &found_needle);
if (eol_offset == -1) {
/*
* No CR or LF - line is presumably continued in next packet.
@@ -2964,8 +2964,7 @@ tvb_find_line_end_unquoted(tvbuff_t *tvb, const gint offset, int len, gint *next
/*
* Look either for a CR, an LF, or a '"'.
*/
- char_offset = tvb_pbrk_guint8(tvb, cur_offset, len,
- (const guint8 *)"\r\n\"", &c);
+ char_offset = tvb_pbrk_guint8(tvb, cur_offset, len, "\r\n\"", &c);
}
if (char_offset == -1) {
/*
diff --git a/ui/gtk/airpcap_gui_utils.c b/ui/gtk/airpcap_gui_utils.c
index 1d6ce032eb..f626271767 100644
--- a/ui/gtk/airpcap_gui_utils.c
+++ b/ui/gtk/airpcap_gui_utils.c
@@ -350,7 +350,7 @@ airpcap_get_validation_type(const gchar* name)
* Function used to retrieve the string name given an AirpcapValidationType,
* or NULL in case of error
*/
-gchar*
+const gchar*
airpcap_get_validation_name(AirpcapValidationType vt)
{
if(vt == AIRPCAP_VT_ACCEPT_EVERYTHING)
diff --git a/ui/gtk/airpcap_gui_utils.h b/ui/gtk/airpcap_gui_utils.h
index fb84a25d66..f1ec7c12eb 100644
--- a/ui/gtk/airpcap_gui_utils.h
+++ b/ui/gtk/airpcap_gui_utils.h
@@ -92,7 +92,7 @@ airpcap_get_validation_type(const gchar* name);
/*
* Function used to retrieve the string name given an AirpcapValidationType.
*/
-gchar*
+const gchar*
airpcap_get_validation_name(AirpcapValidationType vt);
/*
diff --git a/ui/gtk/summary_dlg.c b/ui/gtk/summary_dlg.c
index a4eb604e61..306f1ff867 100644
--- a/ui/gtk/summary_dlg.c
+++ b/ui/gtk/summary_dlg.c
@@ -97,7 +97,7 @@ add_string_to_table(GtkWidget *list, guint *row, const gchar *title, const gchar
static void
-add_string_to_list(GtkWidget *list, gchar *title, gchar *captured, gchar *displayed, gchar *marked)
+add_string_to_list(GtkWidget *list, const gchar *title, gchar *captured, gchar *displayed, gchar *marked)
{
simple_list_append(list, 0, title, 1, captured, 2, displayed, 3, marked, -1);
}