about summary refs log tree commit diff
path: root/db/btree
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-23 14:02:16 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-23 14:02:16 +0000
commit24fd4cc4512102239f408ad965c7d65229be90d3 (patch)
treecccbe271bb9e2373a4beae0b0ae58773619b7856 /db/btree
parent1cd9c90dc94714b358b7f968122f00088c852763 (diff)
downloadglibc-24fd4cc4512102239f408ad965c7d65229be90d3.tar.gz
glibc-24fd4cc4512102239f408ad965c7d65229be90d3.tar.xz
glibc-24fd4cc4512102239f408ad965c7d65229be90d3.zip
Update.
1998-09-23 13:52  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig (all-subdirs): Add db.
	* Versions.def: Add definition for libdb1.
	* shlib-versions: Add definitions for libdb1.
	* db/Makefile (extra-libs): Replace by libdb1.
	(libdb-routines): Rename to libdb1-routines.
	(headers): Rename to db1-headers.
	(distribute): Add $(db1-headers).
	(install-others): Define to install symlink libdb.so.NN and the
	$(db1-headers).
	(CPPFLAGS): Add -USE_LIBDB1
	Remove rules to build makedb.
	* db/Versions: Rename libdb to libdb1.
	* include/db.h: If USE_LIBDB1 is defined include db/db.h.

	* scripts/versions.awk: Recognize digits in library names.

	* db/btree/bt_open.c: Fix compiler warnings.
	* db/btree/bt_put.c: Likewise.
	* db/btree/bt_split.c: Likewise.
	* db/hash/hash.c: Likewise.
	* db/hash/hash_bigkey.c: Likewise.
	* db/recno/rec_close.c: Likewise.
Diffstat (limited to 'db/btree')
-rw-r--r--db/btree/bt_open.c8
-rw-r--r--db/btree/bt_put.c3
-rw-r--r--db/btree/bt_split.c4
3 files changed, 8 insertions, 7 deletions
diff --git a/db/btree/bt_open.c b/db/btree/bt_open.c
index 1396f3a255..8c2f48ebf5 100644
--- a/db/btree/bt_open.c
+++ b/db/btree/bt_open.c
@@ -125,7 +125,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
 		 */
 		if (b.psize &&
 		    (b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
-		    b.psize & sizeof(indx_t) - 1))
+		    b.psize & (sizeof(indx_t) - 1)))
 			goto einval;
 
 		/* Minimum number of keys per page; absolute minimum is 2. */
@@ -245,7 +245,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
 		if (m.magic != BTREEMAGIC || m.version != BTREEVERSION)
 			goto eftype;
 		if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
-		    m.psize & sizeof(indx_t) - 1)
+		    m.psize & (sizeof(indx_t) - 1))
 			goto eftype;
 		if (m.flags & ~SAVEMETA)
 			goto eftype;
@@ -280,8 +280,8 @@ __bt_open(fname, flags, mode, openinfo, dflags)
 	t->bt_psize = b.psize;
 
 	/* Set the cache size; must be a multiple of the page size. */
-	if (b.cachesize && b.cachesize & b.psize - 1)
-		b.cachesize += (~b.cachesize & b.psize - 1) + 1;
+	if (b.cachesize && b.cachesize & (b.psize - 1))
+		b.cachesize += (~b.cachesize & (b.psize - 1)) + 1;
 	if (b.cachesize < b.psize * MINCACHE)
 		b.cachesize = b.psize * MINCACHE;
 
diff --git a/db/btree/bt_put.c b/db/btree/bt_put.c
index e6241152f3..15309c66e2 100644
--- a/db/btree/bt_put.c
+++ b/db/btree/bt_put.c
@@ -223,7 +223,7 @@ delete:		if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
 	    t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index >= index)
 		++t->bt_cursor.pg.index;
 
-	if (t->bt_order == NOT)
+	if (t->bt_order == NOT) {
 		if (h->nextpg == P_INVALID) {
 			if (index == NEXTINDEX(h) - 1) {
 				t->bt_order = FORWARD;
@@ -237,6 +237,7 @@ delete:		if (__bt_dleaf(t, key, h, index) == RET_ERROR) {
 				t->bt_last.pgno = h->pgno;
 			}
 		}
+	}
 
 	mpool_put(t->bt_mp, h, MPOOL_DIRTY);
 
diff --git a/db/btree/bt_split.c b/db/btree/bt_split.c
index 4484219ae2..4119ccbf79 100644
--- a/db/btree/bt_split.c
+++ b/db/btree/bt_split.c
@@ -674,8 +674,8 @@ bt_psplit(t, h, l, r, pskip, ilen)
 		 * where we decide to try and copy too much onto the left page.
 		 * Make sure that doesn't happen.
 		 */
-		if (skip <= off &&
-		    used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
+		if ((skip <= off && used + nbytes + sizeof(indx_t) >= full)
+		    || nxt == top - 1) {
 			--off;
 			break;
 		}