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:
Christopher Haster
2025-09-09 21:59:11 -05:00
parent 2a2d3173ce
commit 052fc200c8
+2 -2
View File
@@ -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) {