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().
This commit is contained in:
Bruce Evans 1998-02-13 07:09:38 +00:00
parent 359888780e
commit 5883bcc9d2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33312
2 changed files with 8 additions and 14 deletions

View File

@ -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))

View File

@ -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))