From b928dbe1fcb6cf4b7acbd97d3df9514d5c554953 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 15 Oct 2024 12:22:36 +0200 Subject: [PATCH] Get rid of on-house MIN/MAX definitions This matches approach already taken in sss_client/idmap/sss_nss_ex.c Reviewed-by: Sumit Bose --- src/ldb_modules/memberof.c | 4 ---- src/util/safe-format-string.c | 10 ++-------- src/util/util.h | 9 +-------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c index 21a175cb353..53bf60e75c3 100644 --- a/src/ldb_modules/memberof.c +++ b/src/ldb_modules/memberof.c @@ -33,10 +33,6 @@ #define DB_CACHE_EXPIRE "dataExpireTimestamp" #define DB_OC "objectCategory" -#ifndef MAX -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - struct mbof_val_array { struct ldb_val *vals; int num; diff --git a/src/util/safe-format-string.c b/src/util/safe-format-string.c index 11532d42e79..2b28a802849 100644 --- a/src/util/safe-format-string.c +++ b/src/util/safe-format-string.c @@ -33,19 +33,13 @@ #include "config.h" -#include "safe-format-string.h" - +#include /* for MIN() */ #include #include #include -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif +#include "safe-format-string.h" -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif static void safe_padding (int count, diff --git a/src/util/util.h b/src/util/util.h index a25b55ef396..8674c6c9dbd 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -34,6 +34,7 @@ #include #include #include +#include /* for MIN()/MAX() */ #include #include @@ -79,14 +80,6 @@ #define NULL 0 #endif -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef ALLPERMS #define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ #endif