util: More parens in LFS3_MIN/MAX
Previously this had a very naive number of parens, which led to a very confusing night trying to debug some code that looked roughly like this: LFS3_MAX(1, (false) ? 64 : 256) => 1 ??? Fixed by adding more parens.
This commit is contained in:
+2
-2
@@ -317,8 +317,8 @@
|
||||
//
|
||||
|
||||
// Compile time min/max
|
||||
#define LFS3_MIN(a, b) ((a < b) ? a : b)
|
||||
#define LFS3_MAX(a, b) ((a > b) ? a : b)
|
||||
#define LFS3_MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define LFS3_MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
// Min/max functions for unsigned 32-bit numbers
|
||||
static inline uint32_t lfs3_min(uint32_t a, uint32_t b) {
|
||||
|
||||
Reference in New Issue
Block a user