diff options
author | Guy Harris <gharris@sonic.net> | 2021-06-16 02:01:23 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-06-16 02:01:23 -0700 |
commit | 25a254823f21dee60f621b445e6689b2bbf9d9c4 (patch) | |
tree | 38f5033c9ea6dde5bdfbb9b4399d86be0de7579b /epan/dissectors/packet-aeron.c | |
parent | f541e5e769321df0b4968164f583ecd684152d0e (diff) |
wsutil: add a header that defines some "round to power of 2" macros.
Add macros to round to multiples of 2, 4, 8, 16, and 32.
Use them instead of independently defined macros.
(We don't define a general "round to a power of 2" macro to avoid the
risk of somebody passing something other than a power of 2 to it.)
Diffstat (limited to 'epan/dissectors/packet-aeron.c')
-rw-r--r-- | epan/dissectors/packet-aeron.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-aeron.c b/epan/dissectors/packet-aeron.c index 71cfd1eb24..7adbca6ac4 100644 --- a/epan/dissectors/packet-aeron.c +++ b/epan/dissectors/packet-aeron.c @@ -18,6 +18,7 @@ #include <epan/exceptions.h> #include <epan/to_str.h> #include <wsutil/pint.h> +#include <wsutil/ws_roundup.h> /* * The Aeron protocol is defined at @@ -55,7 +56,7 @@ typedef struct static int aeron_pos_roundup(int offset) { - return ((offset+31) & (~31)); + return WS_ROUNDUP_32(offset); } static int aeron_pos_compare(const aeron_pos_t * pos1, const aeron_pos_t * pos2) |