Eliminate proto_tree_add_text from odds and ends.

A few calls in the epan directory and comments in the ui directory

Change-Id: Ia8f8830ac6909ab94d3a03283bfd173456bc9718
Reviewed-on: https://code.wireshark.org/review/10492
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-09-11 17:41:13 -04:00
parent aebc99a49c
commit 51360b5380
5 changed files with 11 additions and 14 deletions

View File

@ -284,7 +284,7 @@ dvb_add_chartbl(proto_tree *tree, int hf,
if (length==0) {
proto_item *pi;
pi = proto_tree_add_text(tree, NULL, 0, 0,
pi = proto_tree_add_bytes_format(tree, hf, tvb, 0, 0, NULL,
"Default character table (Latin)");
PROTO_ITEM_SET_GENERATED(pi);
}

View File

@ -75,8 +75,7 @@ WS_DLL_PUBLIC guint8* tpg_ipv6(tvbparse_elem_t*);
#define TPG_ADD_UINT(tpg, hfid, elem, value) proto_tree_add_uint(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value)
#define TPG_ADD_IPV4(tpg, hfid, elem, value) proto_tree_add_ipv4(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value)
#define TPG_ADD_IPV6(tpg, hfid, elem, value) proto_tree_add_ipv6(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), hfid, (elem)->tvb, (elem)->offset, (elem)->len, value)
#define TPG_ADD_TEXT(tpg, elem) proto_tree_add_text(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), (elem)->tvb, (elem)->offset, (elem)->len, \
"%s",tvb_format_text((elem)->tvb, (elem)->offset, (elem)->len))
#define TPG_ADD_TEXT(tpg, elem) proto_tree_add_format_text(ep_stack_peek(((tpg_parser_data_t*)tpg)->stack), (elem)->tvb, (elem)->offset, (elem)->len)
#define TPG_SET_TEXT(pi, elem) proto_item_set_text((pi), "%s",tvb_format_text((elem)->tvb, (elem)->offset, (elem)->len))

View File

@ -1366,7 +1366,7 @@ void tvbparse_tree_add_elem(proto_tree* tree, tvbparse_elem_t* curr) {
frame->elem = curr;
while (curr) {
pi = proto_tree_add_text(frame->tree,curr->tvb,curr->offset,curr->len,"%s",tvb_format_text(curr->tvb,curr->offset,curr->len));
pi = proto_tree_add_format_text(frame->tree,curr->tvb,curr->offset,curr->len);
if(curr->sub) {
frame->elem = curr;

View File

@ -874,7 +874,7 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_)
} else {
/*
* Don't show anything if the field name is zero-length;
* the pseudo-field for "proto_tree_add_text()" is such
* the pseudo-field for text-only items is such
* a field, and we don't want "Text (text)" showing up
* on the status line if you've selected such a field.
*
@ -886,10 +886,9 @@ tree_view_selection_changed_cb(GtkTreeSelection *sel, gpointer user_data _U_)
* but we'd have to add checks for null pointers in some
* places if we did that.
*
* Or perhaps protocol tree items added with
* "proto_tree_add_text()" should have -1 as the field index,
* with no pseudo-field being used, but that might also
* require special checks for -1 to be added.
* Or perhaps text-only items should have -1 as the field
* index, with no pseudo-field being used, but that might
* also require special checks for -1 to be added.
*/
statusbar_push_field_msg("%s", "");
}

View File

@ -392,7 +392,7 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) {
} // else the GTK+ version pushes an empty string as described below.
/*
* Don't show anything if the field name is zero-length;
* the pseudo-field for "proto_tree_add_text()" is such
* the pseudo-field for text-only items is such
* a field, and we don't want "Text (text)" showing up
* on the status line if you've selected such a field.
*
@ -404,10 +404,9 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) {
* but we'd have to add checks for null pointers in some
* places if we did that.
*
* Or perhaps protocol tree items added with
* "proto_tree_add_text()" should have -1 as the field index,
* with no pseudo-field being used, but that might also
* require special checks for -1 to be added.
* Or perhaps text-only items should have -1 as the field
* index, with no pseudo-field being used, but that might
* also require special checks for -1 to be added.
*/
} else {