]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Make roundup2() generally available.
authorGuy Harris <[email protected]>
Fri, 22 Jun 2018 18:18:20 +0000 (11:18 -0700)
committerGuy Harris <[email protected]>
Fri, 22 Jun 2018 18:18:20 +0000 (11:18 -0700)
netdissect.h
print-802_11.c

index 443a9310e5fe1326bae9f86099880240e4ea4947..4f3c666adc41cfe562175fdbd6d99dae8777f8c9 100644 (file)
@@ -104,6 +104,13 @@ typedef unsigned char nd_mac_addr[MAC_ADDR_LEN];
  */
 typedef unsigned char nd_byte;
 
+/*
+ * Round up x to a multiple of y; y must be a power of 2.
+ */
+#ifndef roundup2
+#define        roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))
+#endif
+
 /* nd_snprintf et al */
 
 #include <stdarg.h>
index 7f6a2301f0e51188eb19487b06ac8430aa44040a..227e1bf37e7ee3a61d6b734712db57322aaa53d3 100644 (file)
@@ -2000,11 +2000,6 @@ ieee_802_11_hdr_print(netdissect_options *ndo,
        }
 }
 
-#ifndef roundup2
-#define        roundup2(x, y)  (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#endif
-
-
 static u_int
 ieee802_11_print(netdissect_options *ndo,
                  const u_char *p, u_int length, u_int orig_caplen, int pad,