]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Lose the HTON and NTOH macros. [skip ci]
authorDenis Ovsienko <[email protected]>
Sat, 26 Dec 2020 00:28:02 +0000 (00:28 +0000)
committerDenis Ovsienko <[email protected]>
Sat, 26 Dec 2020 00:40:55 +0000 (00:40 +0000)
Out of the four macros two were never used, and the other two were used
only once. Use htonl() and htons() directly instead.

addrtoname.c

index e4251a1836e90f340060fee5aa7f6f71c8478e8a..33b93784b231da3e8e9d36721a646222ece93fce 100644 (file)
 
 #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];