Wireshark-commits: [Wireshark-commits] master 76a69be: If possible use proto_tree_add_item(), not p
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 28 Apr 2020 18:24:01 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=76a69be324fd109bec2c4693e4ab57b9bc140c58
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

76a69be by Guy Harris (guy@xxxxxxxxxxxx):

    If possible use proto_tree_add_item(), not proto_tree_add_bytes_item().
    
    Only use proto_tree_add_bytes_item() if you
    
    	1) are processing a hex string rather than binary byte array;
    
    	2) need the raw byte data.
    
    While we're at it, fix the encoding argument in some calls adding
    FT_BYTES fields to be ENC_NA, and, for some cases that could use
    FT_UINT_BYTES, use proto_tree_add_item_ret_uint() to handle the length
    and add a comment about that.
    
    Change-Id: I6a1baca5c7da3001c0a6669f9c251e9773346c8c
    Reviewed-on: https://code.wireshark.org/review/36967
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    

Actions performed:

    from  50806f2   Qt: workaround a C4138 warning generated by MSVC2019
     add  76a69be   If possible use proto_tree_add_item(), not proto_tree_add_bytes_item().


Summary of changes:
 epan/dissectors/packet-ieee802154.c     |  2 +-
 epan/dissectors/packet-netlink-net_dm.c |  2 +-
 epan/dissectors/packet-optommp.c        |  9 ++-------
 epan/dissectors/packet-wifi-nan.c       | 20 +++++++++++---------
 4 files changed, 15 insertions(+), 18 deletions(-)