summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakkana%netscape.com <devnull@localhost>2000-01-26 01:35:17 +0000
committerakkana%netscape.com <devnull@localhost>2000-01-26 01:35:17 +0000
commit9360b4a1f8fad316f20e405897b780070ab4eb06 (patch)
treec061241b447d4207d206e3ecd6a83f2befd1b2b0
parent14c49767192261a9cdace22fd9ec68ea43737e95 (diff)
downloadnss-hg-9360b4a1f8fad316f20e405897b780070ab4eb06.tar.gz
18391: Remove MAX and MIN. Fix from cls@seawood.org, reviewed by meANDREAS_URL2_BASE
-rw-r--r--dbm/include/mcom_db.h8
-rw-r--r--dbm/src/h_bigkey.c6
-rw-r--r--dbm/src/hash.c4
-rw-r--r--dbm/src/hash_buf.c2
4 files changed, 6 insertions, 14 deletions
diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h
index 09a2085bf..260eb9811 100644
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -224,14 +224,6 @@ XP_END_PROTOS
#include <limits.h>
#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 48377d248..5dfa0cc4f 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 a3a0e90d9..23b172ef8 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 35968601b..764a22d3e 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;