diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h index 09a2085bfbe0..260eb9811a92 100644 --- a/dbm/include/mcom_db.h +++ b/dbm/include/mcom_db.h @@ -224,14 +224,6 @@ XP_END_PROTOS #include #endif -#ifndef MIN -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#endif - #define RET_ERROR -1 /* Return values. */ #define RET_SUCCESS 0 #define RET_SPECIAL 1 diff --git a/dbm/src/h_bigkey.c b/dbm/src/h_bigkey.c index 48377d248829..5dfa0cc4fb66 100644 --- a/dbm/src/h_bigkey.c +++ b/dbm/src/h_bigkey.c @@ -107,7 +107,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) /* First move the Key */ for (space = FREESPACE(p) - BIGOVERHEAD; key_size; space = FREESPACE(p) - BIGOVERHEAD) { - move_bytes = MIN(space, key_size); + move_bytes = PR_MIN(space, key_size); off = OFFSET(p) - move_bytes; memmove(cp + off, key_data, move_bytes); key_size -= move_bytes; @@ -124,7 +124,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) n = p[0]; if (!key_size) { if (FREESPACE(p)) { - move_bytes = MIN(FREESPACE(p), val_size); + move_bytes = PR_MIN(FREESPACE(p), val_size); off = OFFSET(p) - move_bytes; p[n] = off; memmove(cp + off, val_data, move_bytes); @@ -144,7 +144,7 @@ __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) /* Now move the data */ for (space = FREESPACE(p) - BIGOVERHEAD; val_size; space = FREESPACE(p) - BIGOVERHEAD) { - move_bytes = MIN(space, val_size); + move_bytes = PR_MIN(space, val_size); /* * Here's the hack to make sure that if the data ends on the * same page as the key ends, FREESPACE is at least one. diff --git a/dbm/src/hash.c b/dbm/src/hash.c index a3a0e90d9982..23b172ef823a 100644 --- a/dbm/src/hash.c +++ b/dbm/src/hash.c @@ -477,7 +477,7 @@ init_htab(HTAB *hashp, int nelem) */ nelem = (nelem - 1) / hashp->FFACTOR + 1; - l2 = __log2((uint32)MAX(nelem, 2)); + l2 = __log2((uint32)PR_MAX(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; @@ -491,7 +491,7 @@ init_htab(HTAB *hashp, int nelem) hashp->MAX_BUCKET = hashp->LOW_MASK = nbuckets - 1; hashp->HIGH_MASK = (nbuckets << 1) - 1; - hashp->HDRPAGES = ((MAX(sizeof(HASHHDR), MINHDRSIZE) - 1) >> + hashp->HDRPAGES = ((PR_MAX(sizeof(HASHHDR), MINHDRSIZE) - 1) >> hashp->BSHIFT) + 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; diff --git a/dbm/src/hash_buf.c b/dbm/src/hash_buf.c index 35968601b924..764a22d3e95b 100644 --- a/dbm/src/hash_buf.c +++ b/dbm/src/hash_buf.c @@ -343,7 +343,7 @@ extern void __buf_init(HTAB *hashp, int32 nbytes) bfp = &(hashp->bufhead); npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT; - npages = MAX(npages, MIN_BUFFERS); + npages = PR_MAX(npages, MIN_BUFFERS); hashp->nbufs = npages; bfp->next = bfp;