From: Denis Ovsienko Date: Sat, 26 Dec 2020 00:28:02 +0000 (+0000) Subject: Lose the HTON and NTOH macros. [skip ci] X-Git-Tag: tcpdump-4.99-bp~7 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/2e86599b4c3fba6cc07e9d6ea47a9db79a1be20e Lose the HTON and NTOH macros. [skip ci] Out of the four macros two were never used, and the other two were used only once. Use htonl() and htons() directly instead. --- diff --git a/addrtoname.c b/addrtoname.c index e4251a18..33b93784 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -33,13 +33,6 @@ #include "netdissect-stdinc.h" -#ifndef NTOHL -#define NTOHL(x) (x) = ntohl(x) -#define NTOHS(x) (x) = ntohs(x) -#define HTONL(x) (x) = htonl(x) -#define HTONS(x) (x) = htons(x) -#endif - #ifdef _WIN32 /* * We have our own ether_ntohost(), reading from the system's @@ -235,7 +228,7 @@ intoa(uint32_t addr) int n; static char buf[sizeof(".xxx.xxx.xxx.xxx")]; - NTOHL(addr); + addr = ntohl(addr); cp = buf + sizeof(buf); *--cp = '\0'; @@ -794,7 +787,7 @@ ipxsap_string(netdissect_options *ndo, u_short port) tp->nxt = newhnamemem(ndo); cp = buf; - NTOHS(port); + port = ntohs(port); *cp++ = hex[port >> 12 & 0xf]; *cp++ = hex[port >> 8 & 0xf]; *cp++ = hex[port >> 4 & 0xf];