From de46edef693d9fc7ab530eb17286edc999c12f03 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Mon, 9 Sep 2024 13:22:07 -0600 Subject: [PATCH] Remove lowercase min/max macro definitions A prior commit: "Replace lowercase min/max macros with opr_min/max" (Change-Id: Ib7c91b4e59aaf76ab77f293016496d6179c23c88) replaced the uses of the min and max macros with opr_min and opr_max. As a cleanup, remove the definitions for the min() and max() macros. As noted in the above commit, there were several locations that left the min/max macros alone: src/WINNT src/external/heimdal Change-Id: I263d91b04a2aed14bf9e1ebca1616629f36e6b23 Reviewed-on: https://gerrit.openafs.org/15843 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie --- src/afs/AIX/osi_vfs.h | 1 - src/butc/afsxbsa.h | 8 -------- src/config/stds.h | 8 -------- src/crypto/rfc3961/krb5_locl.h | 4 ---- src/rxkad/rxkad_client.c | 4 ---- src/tests/create-files.c | 5 ----- src/util/ktime.h | 1 - 7 files changed, 31 deletions(-) diff --git a/src/afs/AIX/osi_vfs.h b/src/afs/AIX/osi_vfs.h index f2ab72ead6..5d37efb084 100644 --- a/src/afs/AIX/osi_vfs.h +++ b/src/afs/AIX/osi_vfs.h @@ -14,7 +14,6 @@ #define VSGID S_ISGID #define VSVTX S_ISVTX -#define min(a, b) (((a) < (b)) ? (a) : (b)) #define bcopyin copyin /* Aux has identical bcopyin */ #define BLKDEV_IOSIZE BSIZE diff --git a/src/butc/afsxbsa.h b/src/butc/afsxbsa.h index d2af72bdde..d8ac4f06b8 100644 --- a/src/butc/afsxbsa.h +++ b/src/butc/afsxbsa.h @@ -808,14 +808,6 @@ extern char traceStr2[]; #define dsFree(a) free(a) extern void StrUpper(char *s); -/* Min() and Max() macros */ -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif /* Combined file name w/ line number */ #define TrFL __FILE__, __LINE__ diff --git a/src/config/stds.h b/src/config/stds.h index cb3fde3f89..3ac231dd36 100644 --- a/src/config/stds.h +++ b/src/config/stds.h @@ -176,14 +176,6 @@ typedef struct afs_hyper_t { /* unsigned 64 bit integers */ #define hadd(a,b) (hadd32(a,(b).low), (a).high += (b).high) -#if !defined(KERNEL) || defined(UKERNEL) -#ifndef AFS_NT40_ENV -#define max(a, b) ((a) < (b) ? (b) : (a)) -#define min(a, b) ((a) > (b) ? (b) : (a)) -#endif -/*#define abs(x) ((x) >= 0 ? (x) : -(x))*/ -#endif - /* minumum length of string to pass to int_to_base64 */ typedef char b64_string_t[8]; #ifndef AFS_NT40_ENV diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h index 04292eefaf..e575084fcf 100644 --- a/src/crypto/rfc3961/krb5_locl.h +++ b/src/crypto/rfc3961/krb5_locl.h @@ -66,10 +66,6 @@ #define ALLOC(X, N) (X) = calloc((N), sizeof(*(X))) -#ifndef max -#define max(a,b) (((a)>(b))?(a):(b)) -#endif - #ifndef O_BINARY #define O_BINARY 0 #endif diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c index d48b8951d2..c7e5764e91 100644 --- a/src/rxkad/rxkad_client.c +++ b/src/rxkad/rxkad_client.c @@ -45,10 +45,6 @@ #include "private_data.h" #define XPRT_RXKAD_CLIENT -#ifndef max -#define max(a,b) ((a) < (b)? (b) : (a)) -#endif /* max */ - static struct rx_securityOps rxkad_client_ops = { rxkad_Close, rxkad_NewConnection, /* every new connection */ diff --git a/src/tests/create-files.c b/src/tests/create-files.c index 88701af7fe..27e4017775 100644 --- a/src/tests/create-files.c +++ b/src/tests/create-files.c @@ -46,11 +46,6 @@ #include -#undef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#undef min -#define min(a,b) ((a) < (b) ? (a) : (b)) - static int creat_files(int count, long startsize) { diff --git a/src/util/ktime.h b/src/util/ktime.h index ace4b83a0b..2c442fb77c 100644 --- a/src/util/ktime.h +++ b/src/util/ktime.h @@ -62,5 +62,4 @@ struct ktime { afs_int32 ktime_InterpretDate(struct ktime_date *akdate); -#define min(a,b) (((a) < (b)) ? (a) : (b)) #endif /* __INCL_KTIME_ */