aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-20 21:34:04 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-21 05:34:52 +0000
commit238550b9c5aad47448cc5ac537108ee23125a252 (patch)
tree908aaa0772eaa386fb5707fa763377a802667d1e /epan/proto.c
parent1c5e6a1b3470b23554ddbd3718bc815f19bf8684 (diff)
Make some arguments const, and remove casting-away of constness.
Change-Id: Iaa43b4b355179a265975f67952feac819e79f7a6 Reviewed-on: https://code.wireshark.org/review/25957 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 03f7a95f5f..21471f08ed 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -5965,7 +5965,7 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
double d_value = fvalue_get_floating(&finfo->value);
g_snprintf(result+offset_r, size-offset_r,
"%." G_STRINGIFY(FLT_DIG) "g%s", d_value,
- unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings));
+ unit_name_string_get_double(d_value, (const unit_name_string*)hfinfo->strings));
} else {
g_snprintf(result+offset_r, size-offset_r,
"%." G_STRINGIFY(FLT_DIG) "g", fvalue_get_floating(&finfo->value));
@@ -5978,7 +5978,7 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
double d_value = fvalue_get_floating(&finfo->value);
g_snprintf(result+offset_r, size-offset_r,
"%." G_STRINGIFY(DBL_DIG) "g%s", d_value,
- unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings));
+ unit_name_string_get_double(d_value, (const unit_name_string*)hfinfo->strings));
} else {
g_snprintf(result+offset_r, size-offset_r,
"%." G_STRINGIFY(DBL_DIG) "g", fvalue_get_floating(&finfo->value));
@@ -8224,7 +8224,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %." G_STRINGIFY(FLT_DIG) "g%s",
hfinfo->name, d_value,
- unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings));
+ unit_name_string_get_double(d_value, (const unit_name_string*)hfinfo->strings));
} else {
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %." G_STRINGIFY(FLT_DIG) "g",
@@ -8240,7 +8240,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %." G_STRINGIFY(DBL_DIG) "g%s",
hfinfo->name, d_value,
- unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings));
+ unit_name_string_get_double(d_value, (const unit_name_string*)hfinfo->strings));
} else {
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %." G_STRINGIFY(DBL_DIG) "g",
@@ -8468,7 +8468,7 @@ hf_try_val_to_str(guint32 value, const header_field_info *hfinfo)
return try_val64_to_str(value, (const val64_string *) hfinfo->strings);
if (hfinfo->display & BASE_UNIT_STRING)
- return unit_name_string_get_value(value, (struct unit_name_string*) hfinfo->strings);
+ return unit_name_string_get_value(value, (const struct unit_name_string*) hfinfo->strings);
return try_val_to_str(value, (const value_string *) hfinfo->strings);
}
@@ -8483,7 +8483,7 @@ hf_try_val64_to_str(guint64 value, const header_field_info *hfinfo)
return try_rval64_to_str(value, (const range_string *) hfinfo->strings);
if (hfinfo->display & BASE_UNIT_STRING)
- return unit_name_string_get_value64(value, (struct unit_name_string*) hfinfo->strings);
+ return unit_name_string_get_value64(value, (const struct unit_name_string*) hfinfo->strings);
/* If this is reached somebody registered a 64-bit field with a 32-bit
* value-string, which isn't right. */
@@ -9799,7 +9799,7 @@ proto_registrar_dump_values(void)
if (hfinfo->display & BASE_RANGE_STRING) {
range = (const range_string *)hfinfo->strings;
} else if (hfinfo->display & BASE_EXT_STRING) {
- vals = VALUE_STRING_EXT_VS_P((value_string_ext *)hfinfo->strings);
+ vals = VALUE_STRING_EXT_VS_P((const value_string_ext *)hfinfo->strings);
} else if (hfinfo->display & BASE_VAL64_STRING) {
vals64 = (const val64_string *)hfinfo->strings;
} else if (hfinfo->display & BASE_UNIT_STRING) {
@@ -10547,7 +10547,7 @@ proto_item_add_bitmask_tree(proto_item *item, tvbuff_t *tvb, const int offset,
out = hfinfo_number_value_format(hf, buf, (guint32) tmpval);
if (hf->display & BASE_UNIT_STRING) {
- proto_item_append_text(item, "%s: %s%s", hf->name, out, unit_name_string_get_value((guint32) tmpval, (unit_name_string*)hf->strings));
+ proto_item_append_text(item, "%s: %s%s", hf->name, out, unit_name_string_get_value((guint32) tmpval, (const unit_name_string*)hf->strings));
} else {
proto_item_append_text(item, "%s: %s", hf->name, out);
}
@@ -10590,7 +10590,7 @@ proto_item_add_bitmask_tree(proto_item *item, tvbuff_t *tvb, const int offset,
out = hfinfo_number_value_format(hf, buf, (gint32) integer32);
if ((hf->strings) &&(!(hf->display & BASE_UNIT_STRING))) {
- proto_item_append_text(item, "%s: %s%s", hf->name, out, unit_name_string_get_value((guint32) tmpval, (unit_name_string*)hf->strings));
+ proto_item_append_text(item, "%s: %s%s", hf->name, out, unit_name_string_get_value((guint32) tmpval, (const unit_name_string*)hf->strings));
} else {
proto_item_append_text(item, "%s: %s", hf->name, out);
}