Bugzilla bug 104444: change the type of the h_charkey member of
authorwtc%netscape.com
Sat, 13 Oct 2001 03:16:13 +0000
changeset 2143 2cddef993db1467550705d98f0de8248c71aaeb0
parent 2142 1402c6addae2b41176dc2bb306721478f00787d5
child 2144 8ccb8b453b653aa321f9234af4aeae063dd1f9ec
push idunknown
push userunknown
push dateunknown
bugs104444
Bugzilla bug 104444: change the type of the h_charkey member of struct hashhdr from int32 to uint32. Modified files: dbm/include/hash.h dbm/src/hash.c
dbm/include/hash.h
dbm/src/hash.c
--- a/dbm/include/hash.h
+++ b/dbm/include/hash.h
@@ -88,17 +88,17 @@ typedef struct hashhdr {		/* Disk reside
 	int32		last_freed;	/* Last overflow page freed */
 	int32		max_bucket;	/* ID of Maximum bucket in use */
 	int32		high_mask;	/* Mask to modulo into entire table */
 	int32		low_mask;	/* Mask to modulo into lower half of 
 					 * table */
 	int32		ffactor;	/* Fill factor */
 	int32		nkeys;		/* Number of keys in hash table */
 	int32		hdrpages;	/* Size of table header */
-	int32		h_charkey;	/* value of hash(CHARKEY) */
+	uint32		h_charkey;	/* value of hash(CHARKEY) */
 #define NCACHED	32			/* number of bit maps and spare 
 					 * points */
 	int32		spares[NCACHED];/* spare pages for overflow */
 	uint16		bitmaps[NCACHED];	/* address of overflow page 
 						 * bitmaps */
 } HASHHDR;
 
 typedef struct htab	 {		/* Memory resident data structure */
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -234,17 +234,17 @@ extern DB *
 			RETURN_ERROR(EFTYPE, error1);
 		/* Verify file type, versions and hash function */
 		if (hashp->MAGIC != HASHMAGIC)
 			RETURN_ERROR(EFTYPE, error1);
 #define	OLDHASHVERSION	1
 		if (hashp->VERSION != HASHVERSION &&
 		    hashp->VERSION != OLDHASHVERSION)
 			RETURN_ERROR(EFTYPE, error1);
-		if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != (unsigned)hashp->H_CHARKEY)
+		if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY)
 			RETURN_ERROR(EFTYPE, error1);
 		if (hashp->NKEYS < 0) {
 		    /*
 		    ** OOPS. Old bad database from previously busted
 		    ** code. Blow it away.
 		    */
 		    close(hashp->fp);
 		    if (remove(file) < 0) {