3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
14 * Macros to calculate pow2^M, for various power-of-2 values and positive
15 * integer values of M. That's (2^N)^M, i.e. 2^(N*M).
17 * The first argument is the type of the desired result; the second
20 #define pow2(type, m) (((type)1U) << (m))
21 #define pow4(type, m) (((type)1U) << (2*(m)))
22 #define pow8(type, m) (((type)1U) << (3*(m)))
23 #define pow16(type, m) (((type)1U) << (4*(m)))
24 #define pow32(type, m) (((type)1U) << (5*(m)))
25 #define pow64(type, m) (((type)1U) << (6*(m)))
26 #define pow128(type, m) (((type)1U) << (7*(m)))
27 #define pow256(type, m) (((type)1U) << (8*(m)))
29 #endif /* __WS_POW2_H__ */