Wireshark mailing list archives
Re: Merging wiretap pint macro to wsutil/pint.h
From: Guy Harris <guy () alum mit edu>
Date: Mon, 18 Nov 2013 15:34:44 -0800
On Nov 17, 2013, at 11:06 PM, Michal Labedzki <michal.labedzki () tieto com> wrote:
Regarding naming: As long as there is command like tvb_get_ntoh24 [40, 48, 54 and 64] (see also tvbuff.h) I will prefer to using number of bits in the rest of commands.
Does that include tvb_get_ntohl() (and the "ntohs" and "htons" macros)?
By the way Jakub, what is size of "ll" on 16,32 and 64 bit architecture? Is there any specification ensure that it cannot be bigger than 64 bit?
On 64-bit UN*Xes, "ntohl()" and "htonl()" act on data values shorter than a "long", so the "l" in "ntohl" and "htonl" are historical (dating back to 2.x BSD, running on PDP-11s, where you *did* need "long" to get 32-bit values); the same could be said about "ll". I think using the number of bits is cleaner, but going that way everywhere, not just in those macros, *would* be a major change (mechanical, but still a change). ___________________________________________________________________________ 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:
- Merging wiretap pint macro to wsutil/pint.h Jakub Zawadzki (Nov 17)
- Re: Merging wiretap pint macro to wsutil/pint.h Michal Labedzki (Nov 17)
- Re: Merging wiretap pint macro to wsutil/pint.h Guy Harris (Nov 18)
- Re: Merging wiretap pint macro to wsutil/pint.h Jakub Zawadzki (Nov 19)
- Re: Merging wiretap pint macro to wsutil/pint.h Jakub Zawadzki (Nov 28)
- Re: Merging wiretap pint macro to wsutil/pint.h Guy Harris (Nov 28)
- Re: Merging wiretap pint macro to wsutil/pint.h Jakub Zawadzki (Nov 28)
- Re: Merging wiretap pint macro to wsutil/pint.h Guy Harris (Nov 28)
- Re: Merging wiretap pint macro to wsutil/pint.h Guy Harris (Nov 18)
- Re: Merging wiretap pint macro to wsutil/pint.h Michal Labedzki (Nov 17)