From 389dd77b5060af9989527729bad5f72c0818d2e6 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 28 Feb 2023 23:52:26 +0100 Subject: [PATCH] Fix MIN/MAX macros Expressions like "x < MAX(y, z)" were broken. --- app/src/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/common.h b/app/src/common.h index dccc8316..0382d094 100644 --- a/app/src/common.h +++ b/app/src/common.h @@ -5,8 +5,8 @@ #include "compat.h" #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) -#define MIN(X,Y) (X) < (Y) ? (X) : (Y) -#define MAX(X,Y) (X) > (Y) ? (X) : (Y) +#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) +#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) #define CLAMP(V,X,Y) MIN( MAX((V),(X)), (Y) ) #define container_of(ptr, type, member) \