Skip to content

Commit

Permalink
Get rid of on-house MIN/MAX definitions
Browse files Browse the repository at this point in the history
This matches approach already taken in sss_client/idmap/sss_nss_ex.c

Reviewed-by: Sumit Bose <[email protected]>
  • Loading branch information
alexey-tikhonov committed Oct 17, 2024
1 parent cbe3b03 commit b928dbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/ldb_modules/memberof.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions src/util/safe-format-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@

#include "config.h"

#include "safe-format-string.h"

#include <sys/param.h> /* for MIN() */
#include <errno.h>
#include <stdarg.h>
#include <string.h>

#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,
Expand Down
9 changes: 1 addition & 8 deletions src/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <limits.h>
#include <sys/un.h>
#include <sys/capability.h>
#include <sys/param.h> /* for MIN()/MAX() */

#include <talloc.h>
#include <tevent.h>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b928dbe

Please sign in to comment.