mirror of https://gerrit.osmocom.org/libosmocore
utils: Change semantic of OSMO_MAX/OSMO_MIN to match semantic of a function
Add parentheses around the OSMO_MAX and OSMO_MIN macro to match the behaviour of calling a function. The current version does not evaluate to what is expected. (OSMO_MAX(3, 2) + 13) currently results in 3 and not 16.
This commit is contained in:
parent
335aedabf2
commit
08b286277b
|
@ -10,9 +10,9 @@
|
|||
/*! \brief Determine number of elements in an array of static size */
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
/*! \brief Return the maximum of two specified values */
|
||||
#define OSMO_MAX(a, b) (a) >= (b) ? (a) : (b)
|
||||
#define OSMO_MAX(a, b) ((a) >= (b) ? (a) : (b))
|
||||
/*! \brief Return the minimum of two specified values */
|
||||
#define OSMO_MIN(a, b) (a) >= (b) ? (b) : (a)
|
||||
#define OSMO_MIN(a, b) ((a) >= (b) ? (b) : (a))
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue