diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-13 14:26:27 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-13 22:56:50 +0000 |
commit | b7f4e250599d7ea0452711d388c161fd4ef61c60 (patch) | |
tree | 0eb636cef1c72912cef640148b680d8ddabbed2d /epan/unit_strings.c | |
parent | a869ec6f55160622a90bc437517dee91d57f85d5 (diff) |
Adjust proto_tree_add_uint_format_value calls to use unit string
Several calls to proto_tree_add_uint_format_value could be better served
using BASE_UNIT_STRING with a "unit string" in hf_ field. There also
a few cases where proto_tree_add_uint_format_value could just be
proto_tree_add_uint.
Added a few more "common" unit string values to unit_strings.[ch]
Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d
Reviewed-on: https://code.wireshark.org/review/19242
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/unit_strings.c')
-rw-r--r-- | epan/unit_strings.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/unit_strings.c b/epan/unit_strings.c index 03dd077923..cfcfeb9bce 100644 --- a/epan/unit_strings.c +++ b/epan/unit_strings.c @@ -22,6 +22,7 @@ #include "config.h" +#include <wsutil/utf8_entities.h> #include <wsutil/str_util.h> #include "unit_strings.h" @@ -49,16 +50,27 @@ char* unit_name_string_get_value64(guint64 value, unit_name_string* units) const unit_name_string units_foot_feet = { " foot", " feet" }; const unit_name_string units_bit_bits = { " bit", " bits" }; const unit_name_string units_byte_bytes = { " byte", " bytes" }; +const unit_name_string units_octet_octets = { " octet", " octets" }; const unit_name_string units_word_words = { " word", " words" }; +const unit_name_string units_tick_ticks = { " tick", " ticks" }; const unit_name_string units_second_seconds = { " second", " seconds" }; const unit_name_string units_seconds = { "s", NULL }; const unit_name_string units_millisecond_milliseconds = { " millisecond", " milliseconds" }; const unit_name_string units_milliseconds = { "ms", NULL }; +const unit_name_string units_microseconds = { UTF8_MICRO_SIGN "s", NULL }; const unit_name_string units_nanosecond_nanoseconds = { " nanosecond", " nanoseconds" }; +const unit_name_string units_nanometers = { "nm", NULL }; const unit_name_string units_degree_degrees = { " degree", " degrees" }; +const unit_name_string units_decibals = { "dB", NULL }; +const unit_name_string units_percent = { "%", NULL }; +const unit_name_string units_mhz = { "MHz", NULL }; const unit_name_string units_ghz = { "GHz", NULL }; const unit_name_string units_hz = { "Hz", NULL }; const unit_name_string units_hz_s = { "Hz/s", NULL }; +const unit_name_string units_kbit = { "kbit", NULL }; +const unit_name_string units_kbps = { "Kbps", NULL }; +const unit_name_string units_bit_sec = { "bits/s", NULL }; +const unit_name_string units_segment_remaining = { " segment remaining", " segments remaining" }; /* |