From 21735ead4f907b1323b5fd72ea698372774e0ee5 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 13 May 2017 20:05:52 -0400 Subject: Add unit_name_string_get_double to handle float/double fields Bug: 13705 Change-Id: I6bd006f216440d071e5c1eeb6b1f996b4a364c62 Reviewed-on: https://code.wireshark.org/review/21629 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/proto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'epan/proto.c') diff --git a/epan/proto.c b/epan/proto.c index 00318d6585..c9309fce59 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -5626,7 +5626,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_value64((guint64)d_value, (unit_name_string*)hfinfo->strings)); + unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings)); } else { g_snprintf(result+offset_r, size-offset_r, "%." G_STRINGIFY(FLT_DIG) "g", fvalue_get_floating(&finfo->value)); @@ -5639,7 +5639,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_value64((guint64)d_value, (unit_name_string*)hfinfo->strings)); + unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings)); } else { g_snprintf(result+offset_r, size-offset_r, "%." G_STRINGIFY(DBL_DIG) "g", fvalue_get_floating(&finfo->value)); @@ -7854,7 +7854,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_value64((guint64)d_value, (unit_name_string*)hfinfo->strings)); + unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings)); } else { g_snprintf(label_str, ITEM_LABEL_LENGTH, "%s: %." G_STRINGIFY(FLT_DIG) "g", @@ -7869,7 +7869,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_value64((guint64)d_value, (unit_name_string*)hfinfo->strings)); + unit_name_string_get_double(d_value, (unit_name_string*)hfinfo->strings)); } else { g_snprintf(label_str, ITEM_LABEL_LENGTH, "%s: %." G_STRINGIFY(DBL_DIG) "g", -- cgit v1.2.3