From 5883bcc9d2838ef2d2989325bce04742cea13b59 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 13 Feb 1998 07:09:38 +0000 Subject: [PATCH] Don't (conditionally) override the kernel's min() and max() functions with macros. This breaks if the functions are replaced by macros with unsuitable semantics. Define a MAX() macro unconditionally instead. max() is unsuitable since we need a constant expression. Don't define MIN() - we never used min(). --- sys/i386/isa/kbdio.c | 11 ++++------- sys/isa/kbdio.c | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sys/i386/isa/kbdio.c b/sys/i386/isa/kbdio.c index b38201c39690..2d0131321fac 100644 --- a/sys/i386/isa/kbdio.c +++ b/sys/i386/isa/kbdio.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kbdio.c,v 1.10 1997/03/07 10:22:55 yokota Exp $ + * $Id: kbdio.c,v 1.11 1997/07/20 14:10:05 bde Exp $ */ #include "sc.h" @@ -76,16 +76,13 @@ /* constants */ -#define NKBDC max(max(NSC, NVT), NPSM) +#define NKBDC MAX(MAX(NSC, NVT), NPSM) #define KBDQ_BUFSIZE 32 /* macros */ -#ifndef max -#define max(x,y) ((x) > (y) ? (x) : (y)) -#endif -#ifndef min -#define min(x,y) ((x) < (y) ? (x) : (y)) +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) #endif #define kbdcp(p) ((struct kbdc_softc *)(p)) diff --git a/sys/isa/kbdio.c b/sys/isa/kbdio.c index b38201c39690..2d0131321fac 100644 --- a/sys/isa/kbdio.c +++ b/sys/isa/kbdio.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kbdio.c,v 1.10 1997/03/07 10:22:55 yokota Exp $ + * $Id: kbdio.c,v 1.11 1997/07/20 14:10:05 bde Exp $ */ #include "sc.h" @@ -76,16 +76,13 @@ /* constants */ -#define NKBDC max(max(NSC, NVT), NPSM) +#define NKBDC MAX(MAX(NSC, NVT), NPSM) #define KBDQ_BUFSIZE 32 /* macros */ -#ifndef max -#define max(x,y) ((x) > (y) ? (x) : (y)) -#endif -#ifndef min -#define min(x,y) ((x) < (y) ? (x) : (y)) +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) #endif #define kbdcp(p) ((struct kbdc_softc *)(p))