forked from osmocom/wireshark
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>
This commit is contained in:
parent
94f499bb11
commit
cbc36cbd97
|
@ -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);
|
||||
}
|
||||
|
|
24
epan/proto.c
24
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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue