Wireshark mailing list archives
Re: bug 5175 PPI-GEOLOCATION patch, input pcap
From: Guy Harris <guy () alum mit edu>
Date: Thu, 11 Nov 2010 09:27:26 -0800
On Nov 8, 2010, at 1:15 PM, Jon Ellch wrote:
Is there a reason g_appstr_num is fetched using tvb_get_letohl() andthen addedto the tree with proto_tree_add_uint() instead of adding it directly with proto_tree_add_item()? That would make for cleaner code as it appears that g_appstr_num isn't used after the proto_tree_add_uint() call. using _add_item() makes the code easier to read if the variable isn't neededafterthat. There may be other cases of this; this is just an example I noticed.Point made, however I would like to keep a copy of the values locally for future improvements (maybe making a cleaner text representation with the appropriate degrees of precision displayed). Also, if I were to skip the tvb_get_letohl() call, how do I make sure values are byte-swapped on big-endian systems?
The last argument to proto_tree_add_item() specifies the representation of the item; for multi-byte integral values, you can pass ENC_BIG_ENDIAN or ENC_LITTLE_ENDIAN to specify whether the value is big-endian or little-endian. ___________________________________________________________________________ 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:
- bug 5175 PPI-GEOLOCATION patch, input pcap johnny cache (Nov 08)
- <Possible follow-ups>
- bug 5175 PPI-GEOLOCATION patch, input pcap Jon Ellch (Nov 11)
- Re: bug 5175 PPI-GEOLOCATION patch, input pcap Guy Harris (Nov 11)