Wireshark mailing list archives

Re: No tvb_get for string-encoded numbers?


From: Jeff Morriss <jeff.morriss.ws () gmail com>
Date: Fri, 04 Apr 2014 16:27:52 -0400

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

On Apr 4, 2014, at 7:30 AM, Hadriel Kaplan <hadriel.kaplan () 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-request () wireshark org?subject=unsubscribe


Current thread: