aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-11-30 06:51:01 +0000
committerJoão Valverde <j@v6e.pt>2016-01-07 22:40:30 +0000
commitcbc36cbd97eae79d4e84f749ee78fb53037e3c6c (patch)
treea710b563169517a21257c41c8d1dd6d2091a1f9e
parent94f499bb113e2ff8a86bc721ff8799baf68d2305 (diff)
Remove constness from bytestring_to_str() [-Wcast-qual]
Change-Id: I7f942787dfdc4f76dd0ad5111d1eb528b20f0ba9 Reviewed-on: https://code.wireshark.org/review/13011 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
-rw-r--r--epan/oids.c2
-rw-r--r--epan/proto.c24
-rw-r--r--epan/to_str.c2
-rw-r--r--epan/to_str.h2
-rw-r--r--epan/tvbuff.c2
5 files changed, 16 insertions, 16 deletions
diff --git a/epan/oids.c b/epan/oids.c
index 64aa406da3..9d14838fc8 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -204,7 +204,7 @@ extern void oid_add_from_encoded(const char* name, const guint8 *oid, gint oid_l
add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,subids_len,subids);
wmem_free(NULL, sub);
} else {
- gchar* bytestr = (gchar*)bytestring_to_str(NULL, oid, oid_len, ':');
+ gchar* bytestr = bytestring_to_str(NULL, oid, oid_len, ':');
D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len, bytestr));
wmem_free(NULL, bytestr);
}
diff --git a/epan/proto.c b/epan/proto.c
index b6f1c00a62..be54c4b84c 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -4635,26 +4635,26 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
switch(hfinfo->display)
{
case SEP_DOT:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '.');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '.');
break;
case SEP_DASH:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '-');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '-');
break;
case SEP_COLON:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ':');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ':');
break;
case SEP_SPACE:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ' ');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ' ');
break;
case BASE_NONE:
default:
if (prefs.display_byte_fields_with_spaces)
{
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ' ');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ' ');
}
else
{
- str = (char*)bytes_to_str(NULL, bytes, fvalue_length(&finfo->value));
+ str = bytes_to_str(NULL, bytes, fvalue_length(&finfo->value));
}
break;
}
@@ -6662,26 +6662,26 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
switch(hfinfo->display)
{
case SEP_DOT:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '.');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '.');
break;
case SEP_DASH:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '-');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '-');
break;
case SEP_COLON:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ':');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ':');
break;
case SEP_SPACE:
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ' ');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ' ');
break;
case BASE_NONE:
default:
if (prefs.display_byte_fields_with_spaces)
{
- str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ' ');
+ str = bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ' ');
}
else
{
- str = (char*)bytes_to_str(NULL, bytes, fvalue_length(&fi->value));
+ str = bytes_to_str(NULL, bytes, fvalue_length(&fi->value));
}
break;
}
diff --git a/epan/to_str.c b/epan/to_str.c
index b24eeff65a..5380c17d6a 100644
--- a/epan/to_str.c
+++ b/epan/to_str.c
@@ -185,7 +185,7 @@ bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct)
* If punct is '\0', no punctuation is applied (and thus
* the resulting string is (len-1) bytes shorter)
*/
-const gchar *
+gchar *
bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct)
{
gchar *buf;
diff --git a/epan/to_str.h b/epan/to_str.h
index 12e08e963b..20993eab6d 100644
--- a/epan/to_str.h
+++ b/epan/to_str.h
@@ -183,7 +183,7 @@ WS_DLL_PUBLIC char *bytes_to_str(wmem_allocator_t *scope, const guint8 *bd, int
*
* @see bytes_to_str()
*/
-WS_DLL_PUBLIC const gchar *bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct);
+WS_DLL_PUBLIC gchar *bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct);
/**
* bytes_to_hexstr()
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 14e5e7f8b8..681fedc35a 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -3407,7 +3407,7 @@ tvb_skip_guint8(tvbuff_t *tvb, int offset, const int maxlength, const guint8 ch)
gchar *
tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint len, const gchar punct)
{
- return (gchar*)bytestring_to_str(scope, ensure_contiguous(tvb, offset, len), len, punct);
+ return bytestring_to_str(scope, ensure_contiguous(tvb, offset, len), len, punct);
}