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 /plugins/profinet | |
parent | a869ec6f55160622a90bc437517dee91d57f85d5 (diff) | |
download | wireshark-b7f4e250599d7ea0452711d388c161fd4ef61c60.tar.gz |
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 'plugins/profinet')
-rw-r--r-- | plugins/profinet/packet-pn-rtc-one.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/plugins/profinet/packet-pn-rtc-one.c b/plugins/profinet/packet-pn-rtc-one.c index 66e2ae292e..b89a73d092 100644 --- a/plugins/profinet/packet-pn-rtc-one.c +++ b/plugins/profinet/packet-pn-rtc-one.c @@ -550,16 +550,13 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset, if (io_data_object->lastToggleBit != toggleBitSb) { /* ToggleBit has changed --> new Data incoming */ /* Special Filter for ToggleBit within Statusbyte */ - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChanged, tvb, offset, 0, - toggleBitSb, "%u", toggleBitSb); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChanged, tvb, offset, 0, toggleBitSb); PROTO_ITEM_SET_HIDDEN(ModuleID_item); - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChange_slot_nr, tvb, offset, 0, - io_data_object->slotNr, "%u", io_data_object->slotNr); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChange_slot_nr, tvb, offset, 0, io_data_object->slotNr); PROTO_ITEM_SET_HIDDEN(ModuleID_item); - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChange_subslot_nr, tvb, offset, 0, - io_data_object->subSlotNr, "%u", io_data_object->subSlotNr); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_sb_toggelBitChange_subslot_nr, tvb, offset, 0, io_data_object->subSlotNr); PROTO_ITEM_SET_HIDDEN(ModuleID_item); } @@ -748,16 +745,13 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset, if (io_data_object->lastToggleBit != toggleBitCb) { /* ToggleBit has changed --> new Data incoming */ /* Special Filter for ToggleBit within Controlbyte */ - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChanged, tvb, offset, 0, - toggleBitCb, "%u", toggleBitCb); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChanged, tvb, offset, 0, toggleBitCb); PROTO_ITEM_SET_HIDDEN(ModuleID_item); - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChange_slot_nr, tvb, offset, 0, - io_data_object->slotNr, "%u", io_data_object->slotNr); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChange_slot_nr, tvb, offset, 0, io_data_object->slotNr); PROTO_ITEM_SET_HIDDEN(ModuleID_item); - ModuleID_item = proto_tree_add_uint_format_value(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChange_subslot_nr, tvb, offset, 0, - io_data_object->subSlotNr, "%u", io_data_object->subSlotNr); + ModuleID_item = proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_cb_toggelBitChange_subslot_nr, tvb, offset, 0, io_data_object->subSlotNr); PROTO_ITEM_SET_HIDDEN(ModuleID_item); } @@ -949,17 +943,17 @@ init_pn_io_rtc1(int proto) }, { &hf_pn_io_ps_sb_toggelBitChanged, { "Status Byte", "pn_io.ps.sb.toggle_d_changed", - FT_UINT8, BASE_HEX, NULL, 0x00, + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_pn_io_ps_sb_toggelBitChange_slot_nr, { "Slot_Number", "pn_io.ps.sb.toggle_d_changed.slot", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pn_io_ps_sb_toggelBitChange_subslot_nr, { "Sub_Slot_Number", "pn_io.ps.sb.toggle_d_changed.subslot", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pn_io_ps_cb, @@ -969,17 +963,17 @@ init_pn_io_rtc1(int proto) }, { &hf_pn_io_ps_cb_toggelBitChanged, { "Control Byte", "pn_io.ps.cb.toggle_h_changed", - FT_UINT8, BASE_HEX, NULL, 0x00, + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_pn_io_ps_cb_toggelBitChange_slot_nr, { "Slot_Number", "pn_io.ps.cb.toggle_h_changed.slot", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_pn_io_ps_cb_toggelBitChange_subslot_nr, { "Sub_Slot_Number", "pn_io.ps.cb.toggle_h_changed.subslot", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Structures for dissecting Status Byte & Control Byte PROFIsafe ---dissector details */ |