Consolidate MIN/MAX macros into one place (param.h).

Submitted by: Hiten Pandya <hiten@unixdaemons.com>
This commit is contained in:
alfred 2003-02-02 13:17:30 +00:00
parent 81ccce55b8
commit b5c0015ac9
24 changed files with 0 additions and 64 deletions

View File

@ -45,8 +45,6 @@
#include <machine/sgmap.h>
#include <machine/md_var.h>
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX_BPAGES 128
struct bus_dma_tag {

View File

@ -44,8 +44,6 @@
#include <machine/bus.h>
#include <machine/md_var.h>
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX_BPAGES 128
struct bus_dma_tag {

View File

@ -172,10 +172,6 @@ static struct cd_quirk_entry cd_quirk_table[] =
}
};
#ifndef MIN
#define MIN(x,y) ((x<y) ? x : y)
#endif
#define CD_CDEV_MAJOR 15
static d_open_t cdopen;

View File

@ -76,10 +76,6 @@ struct pass_softc {
dev_t dev;
};
#ifndef MIN
#define MIN(x,y) ((x<y) ? x : y)
#endif
#define PASS_CDEV_MAJOR 31
static d_open_t passopen;

View File

@ -69,8 +69,6 @@ typedef enum {
#define MAX_IMMEDIATE 16
#define MAX_BUF_SIZE 256 /* Max inquiry/sense/mode page transfer */
#define MIN(a, b) ((a > b) ? b : a)
/* Offsets into our private CCB area for storing accept information */
#define ccb_type ppriv_field0
#define ccb_descr ppriv_ptr1

View File

@ -329,9 +329,6 @@ svr4_recvit(td, s, mp, namelenp)
if (len <= 0 || fromsa == 0)
len = 0;
else {
#ifndef MIN
#define MIN(a,b) ((a)>(b)?(b):(a))
#endif
/* save sa_len before it is destroyed by MSG_COMPAT */
len = MIN(len, fromsa->sa_len);
error = copyout(fromsa,

View File

@ -92,7 +92,6 @@
#define PCI_VENDOR_OLICOM 0x108D
#define MIN(A,B) (((A) < (B)) ? (A) : (B))
#define MIN3(A,B,C) (MIN(A, (MIN(B, C))))
char *AdapterName[] = {

View File

@ -84,10 +84,6 @@ static const char rcsid[] = "@(#)$FreeBSD$";
extern KRWLOCK_T ipf_nat, ipf_state;
#endif
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int ));

View File

@ -1170,8 +1170,6 @@ adv_period_offset_to_sdtr(struct adv_softc *adv, u_int *period,
period = &dummy_period;
}
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
*offset = MIN(ADV_SYN_MAX_OFFSET, *offset);
if (*period != 0 && *offset != 0) {
for (i = 0; i < adv->sdtr_period_tbl_size; i++) {

View File

@ -72,8 +72,6 @@
#define ccb_acb_ptr spriv_ptr0
#define ccb_adw_ptr spriv_ptr1
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
u_long adw_unit;
static __inline cam_status adwccbstatus(union ccb*);

View File

@ -84,10 +84,6 @@
*/
#define PROBABLY_NEW_BOARD(REV) (REV > 0x43 && REV < 0x56)
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
/* MailBox Management functions */
static __inline void ahanextinbox(struct aha_softc *aha);
static __inline void ahanextoutbox(struct aha_softc *aha);

View File

@ -55,8 +55,6 @@
#define ccb_ecb_ptr spriv_ptr0
#define ccb_ahb_ptr spriv_ptr1
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ahb_inb(ahb, port) \
bus_space_read_1((ahb)->tag, (ahb)->bsh, port)

View File

@ -72,10 +72,6 @@
#include <dev/buslogic/btreg.h>
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
/* MailBox Management functions */
static __inline void btnextinbox(struct bt_softc *bt);
static __inline void btnextoutbox(struct bt_softc *bt);

View File

@ -50,9 +50,6 @@ SND_DECLARE_FILE("$FreeBSD$");
/* Misc */
#define MIN(x,y) (x) < (y) ? (x) : (y)
#define MAX(x,y) (x) > (y) ? (x) : (y)
#define inline __inline
#ifndef DEB

View File

@ -397,13 +397,6 @@ static __inline struct sym_quehead *sym_remque_tail(struct sym_quehead *head)
*/
#define MAX_QUEUE SYM_CONF_MAX_QUEUE
/*
* These ones should have been already defined.
*/
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
/*
* Active debugging tags and verbosity.
*/

View File

@ -44,8 +44,6 @@
#include <machine/bus.h>
#include <machine/md_var.h>
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX_BPAGES 128
struct bus_dma_tag {

View File

@ -35,8 +35,6 @@
#error "The gpib device requires the old isa compatibility shims"
#endif
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define GPIBPRI (PZERO + 8) | PCATCH
#define SLEEP_MAX 1000
#define SLEEP_MIN 4

View File

@ -80,8 +80,6 @@
#define lprintf(args)
#endif
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define TIMEOUT (hz*15) /* timeout while reading a buffer - default value */
#define LONG (hz/60) /* timesteps while reading a buffer */
#define GSCPRI PRIBIO /* priority while reading a buffer */

View File

@ -42,8 +42,6 @@
#include <machine/bus.h>
#include <machine/md_var.h>
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX_BPAGES 128
struct bus_dma_tag {

View File

@ -947,9 +947,6 @@ recvit(td, s, mp, namelenp)
if (len <= 0 || fromsa == 0)
len = 0;
else {
#ifndef MIN
#define MIN(a,b) ((a)>(b)?(b):(a))
#endif
/* save sa_len before it is destroyed by MSG_COMPAT */
len = MIN(len, fromsa->sa_len);
#ifdef COMPAT_OLDSOCK

View File

@ -2055,8 +2055,6 @@ local void send_bits(s, value, length)
}
#endif /* DEBUG_ZLIB */
#define MAX(a,b) (a >= b ? a : b)
/* the arguments must not have side effects */
/* ===========================================================================

View File

@ -204,7 +204,6 @@ void
nd6_setmtu(ifp)
struct ifnet *ifp;
{
#define MIN(a,b) ((a) < (b) ? (a) : (b))
struct nd_ifinfo *ndi = &nd_ifinfo[ifp->if_index];
u_long oldmaxmtu = ndi->maxmtu;
u_long oldlinkmtu = ndi->linkmtu;

View File

@ -52,8 +52,6 @@
#include <machine/md_var.h>
#define MIN(a,b) ((a)<(b)?(a):(b))
static int allocate_driver(struct slot *, struct dev_desc *);
static void inserted(void *);
static void disable_slot(struct slot *);

View File

@ -252,10 +252,8 @@
#define powerof2(x) ((((x)-1)&(x))==0)
/* Macros for min/max. */
#ifndef _KERNEL
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#ifdef _KERNEL
/*