On 04/04/14 16:08, Evan Huus wrote:
On Fri, Apr 4, 2014 at 4:04 PM, Guy Harris <g...@alum.mit.edu> wrote:

On Apr 4, 2014, at 7:30 AM, Hadriel Kaplan <hadriel.kap...@oracle.com> wrote:
And I'd like to see proto_tree_add_XXX_item() routines that add an item with a 
particular type *and* take a pointer argument and return the value for the item 
through that pointer; that could replace

         xxx = tvb_get_XXX();
         proto_tree_add_XXX(..., xxx);

combinations and

         xxx = tvb_get_XXX();
         proto_tree_add_item(...);       /* re-fetches the item value */

with

         proto_tree_add_XXX_item(..., &xxx);

That would be neat, though we would have to be careful with our
fast-path handling, since we should return the value regardless.

Yeah, Anders asked about doing that a while back [hmm, some years ago] and I decided that it was going to be too much code (at least for my patience level) to get around TRY_TO_FAKE_THIS_ITEM() and friends.

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@wireshark.org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Reply via email to