Change #278810
| Category | libpcap |
| Changed by | Guy Harris <gharris@sonic.net> |
| Changed at | Thu 20 Aug 2026 13:34:32 |
| Repository | https://git.tcpdump.org/libpcap |
| Project | libpcap |
| Branch | master |
| Revision | 229ba9f3498cd909cf0c7f439200c6e266ebbea8 |
Comments
pcap-util: clean up the byte-swapping macros. Use the same code style as PCAP_BSWAP_64() for PCAP_BSWAP_32() and PCAP_BSWAP_16(). For all of them: - use uintNN_t types rather than u_short or u_int; - use UINTnn_C macros for the byte masks, so that the appropriate suffix is added (for example, if uint64_t is unsigned long, it will append UL rather than ULL to the constant if necessary); - put the (uintNN_t)(y) in parentheses; - put a final cast to the desired type around the entire expression, just as we were already doing for PCAP_BSWAP_16(). Expand the comment before the macros to give additional information. Remove a no-longer-applies comment and and a now-unnecessary cast from testprogs/translatetest.c.
Changed files
- pcap-util.h
- testprogs/translatetest.c