fixup commit for branch 'AB_OUTLINER_BRANCH' AB_OUTLINER_BRANCH AB_OUTLINER_BASE
authorcvs2hg
Wed, 14 Nov 2001 01:31:12 +0000
branchAB_OUTLINER_BRANCH
changeset 2324 4f88d171f5c338014e412d23bd6ba9ddd4a2c8b6
parent 2249 cc5b48c8ecdda09f1389ad1eea2817104ba2da80
child 2325 4a05ace60d1c6e26b38fb2ce0c1b57cbddf668f1
child 10658 6297f44026edc6f781a1a5754a4e5cbf0ad5272b
push idunknown
push userunknown
push dateunknown
fixup commit for branch 'AB_OUTLINER_BRANCH'
dbm/src/h_page.c
dbm/src/hash.c
dbm/tests/lots.c
--- a/dbm/src/h_page.c
+++ b/dbm/src/h_page.c
@@ -1118,17 +1118,17 @@ extern void
 
 	addr = obufp->addr;
 #ifdef DEBUG1
 	(void)fprintf(stderr, "Freeing %d\n", addr);
 #endif
 	ndx = (((uint16)addr) >> SPLITSHIFT);
 	bit_address =
 	    (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
-	 if (bit_address < (unsigned)hashp->LAST_FREED)
+	if (bit_address < (uint32)hashp->LAST_FREED)
 		hashp->LAST_FREED = bit_address;
 	free_page = (bit_address >> (hashp->BSHIFT + BYTE_SHIFT));
 	free_bit = bit_address & ((hashp->BSIZE << BYTE_SHIFT) - 1);
 
 	if (!(freep = hashp->mapp[free_page])) 
 		freep = fetch_bitmap(hashp, free_page);
 
 #ifdef DEBUG
@@ -1160,21 +1160,23 @@ static int
 open_temp(HTAB *hashp)
 {
 #ifdef XP_OS2
  	hashp->fp = mkstemp(NULL);
 #else
 #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 	sigset_t set, oset;
 #endif
+#if !defined(macintosh)
 	char * tmpdir;
 	size_t len;
+	char last;
+#endif
 	static const char namestr[] = "/_hashXXXXXX";
 	char filename[1024];
-	char last;
 
 #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 	/* Block signals; make sure file goes away at process exit. */
 	(void)sigfillset(&set);
 	(void)sigprocmask(SIG_BLOCK, &set, &oset);
 #endif
 
 	filename[0] = 0;
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -863,17 +863,17 @@ hash_access(
 
 	/* Pin the bucket chain */
 	rbufp->flags |= BUF_PIN;
 	for (bp = (uint16 *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
 	{
 
 		if (bp[1] >= REAL_KEY) {
 			/* Real key/data pair */
-			if (size == (unsigned)(off - *bp) &&
+			if (size == (unsigned long)(off - *bp) &&
 			    memcmp(kp, rbufp->page + *bp, size) == 0)
 				goto found;
 			off = bp[1];
 #ifdef HASH_STATISTICS
 			hash_collisions++;
 #endif
 			bp += 2;
 			ndx += 2;
@@ -1007,17 +1007,17 @@ hash_seq(
 		hashp->cbucket = 0;
 		hashp->cndx = 1;
 		hashp->cpage = NULL;
 	}
 
 	for (bp = NULL; !bp || !bp[0]; ) {
 		if (!(bufp = hashp->cpage)) {
 			for (bucket = hashp->cbucket;
-			    bucket <= (unsigned)hashp->MAX_BUCKET;
+			    bucket <= (uint32)hashp->MAX_BUCKET;
 			    bucket++, hashp->cndx = 1) {
 				bufp = __get_buf(hashp, bucket, NULL, 0);
 				if (!bufp)
 					return (DBM_ERROR);
 				hashp->cpage = bufp;
 				bp = (uint16 *)bufp->page;
 				if (bp[0])
 					break;
@@ -1111,17 +1111,17 @@ extern int
 	 * split bucket to the next bucket.
 	 */
 	spare_ndx = __log2((uint32)(hashp->MAX_BUCKET + 1));
 	if (spare_ndx > hashp->OVFL_POINT) {
 		hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT];
 		hashp->OVFL_POINT = spare_ndx;
 	}
 
-	if (new_bucket > (unsigned)hashp->HIGH_MASK) {
+	if (new_bucket > (uint32)hashp->HIGH_MASK) {
 		/* Starting a new doubling */
 		hashp->LOW_MASK = hashp->HIGH_MASK;
 		hashp->HIGH_MASK = new_bucket | hashp->LOW_MASK;
 	}
 	/* Relocate records to the new bucket */
 	return (__split_page(hashp, old_bucket, new_bucket));
 }
 
@@ -1147,17 +1147,17 @@ hash_realloc(
 
 extern uint32
 __call_hash(HTAB *hashp, char *k, size_t len)
 {
 	uint32 n, bucket;
 
 	n = hashp->hash(k, len);
 	bucket = n & hashp->HIGH_MASK;
-	if (bucket > (unsigned)hashp->MAX_BUCKET)
+	if (bucket > (uint32)hashp->MAX_BUCKET)
 		bucket = bucket & hashp->LOW_MASK;
 	return (bucket);
 }
 
 /*
  * Allocate segment table.  On error, destroy the table and set errno.
  *
  * Returns 0 on success
--- a/dbm/tests/lots.c
+++ b/dbm/tests/lots.c
@@ -134,34 +134,34 @@ ReportError(char *string, ...)
 }
 
 DBT * MakeLargeKey(int32 num)
 {
 	int32 low_bits;
 	static DBT rv;
 	static char *string_rv=0;
 	int rep_char;
-	int32 size;
+	size_t size;
 
 	if(string_rv)
 		free(string_rv);
 
 	/* generate a really large text key derived from
 	 * an int32
 	 */
 	low_bits = (num % 10000) + 1;
 
 	/* get the repeat char from the low 26 */
 	rep_char = (char) ((low_bits % 26) + 'a');
 
 	/* malloc a string low_bits wide */
 	size = low_bits*sizeof(char);
-	string_rv = (char *)malloc((size_t)size);
+	string_rv = (char *)malloc(size);
 
-	memset(string_rv, rep_char, (size_t)size);
+	memset(string_rv, rep_char, size);
 
 	rv.data = string_rv;
 	rv.size = size;
 
 	return(&rv);
 }
 
 DBT * MakeSmallKey(int32 num)
@@ -218,17 +218,17 @@ SeqDatabase()
 
 	return(status);
 }
 
 int 
 VerifyData(DBT *data, int32 num, key_type_enum key_type)
 {
 	int32 count, compare_num;
-	uint32 size;
+	size_t size;
 	int32 *int32_array;
 
 	/* The first int32 is count 
 	 * The other n entries should
 	 * all equal num
 	 */
 	if(data->size < sizeof(int32))
 	  {
@@ -322,17 +322,17 @@ VerifyRange(int32 low, int32 high, int32
 }
 
 DBT *
 GenData(int32 num)
 {
 	int32 n;
 	static DBT *data=0;
 	int32 *int32_array;
-	int32 size;
+	size_t size;
 
 	if(!data)
 	  {
 		data = (DBT*)malloc(sizeof(DBT));
 		data->size = 0;
 		data->data = 0;
 	  }
 	else if(data->data)
@@ -341,17 +341,17 @@ GenData(int32 num)
 	  }
 
 	n = rand();
 
 	n = n % 512;  /* bound to a 2K size */
 
 	
 	size = sizeof(int32)*(n+1);
-	int32_array = (int32 *) malloc((size_t)size);
+	int32_array = (int32 *) malloc(size);
 
 	memcpy(&int32_array[0], &n, sizeof(int32));
 
 	for(; n > 0; n--)
 	  {
 		memcpy(&int32_array[n], &num, sizeof(int32));
 	  }