| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
pow2.h
Go to the documentation of this file.
1
9
10#ifndef __WS_POW2_H__
11#define __WS_POW2_H__
12
13/*
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).
16 *
17 * The first argument is the type of the desired result; the second
18 * argument is M.
19 */
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)))
28
29#endif /* __WS_POW2_H__ */