From d53644f6820206f9aaf7c415e5f381f80c505c4a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 2 Aug 2012 15:56:13 -0700 Subject: [PATCH] Minor cleanup --- libraries/libmdb/mdb.c | 13 +++++++------ libraries/libmdb/mdb.h | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 2db10eab34..d1184d11a1 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -1604,7 +1604,8 @@ mdb_txn_renew0(MDB_txn *txn) for (i=2; imt_numdbs; i++) txn->mt_dbs[i].md_flags = env->me_dbflags[i]; txn->mt_dbflags[0] = txn->mt_dbflags[1] = 0; - memset(txn->mt_dbflags+2, DB_STALE, env->me_numdbs-2); + if (txn->mt_numdbs > 2) + memset(txn->mt_dbflags+2, DB_STALE, txn->mt_numdbs-2); return MDB_SUCCESS; } @@ -1906,7 +1907,7 @@ mdb_txn_commit(MDB_txn *txn) /* Update DB root pointers. Their pages have already been * touched so this is all in-place and cannot fail. */ - { + if (txn->mt_numdbs > 2) { MDB_dbi i; MDB_val data; data.mv_size = sizeof(MDB_db); @@ -3357,10 +3358,10 @@ mdb_cursor_adjust(MDB_cursor *mc, func) static void mdb_cursor_pop(MDB_cursor *mc) { - MDB_page *top; - if (mc->mc_snum) { - top = mc->mc_pg[mc->mc_top]; +#if MDB_DEBUG + MDB_page *top = mc->mc_pg[mc->mc_top]; +#endif mc->mc_snum--; if (mc->mc_snum) mc->mc_top--; @@ -3835,7 +3836,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, { int rc; MDB_page *mp; - MDB_node *leaf; + MDB_node *leaf = NULL; DKBUF; assert(mc); diff --git a/libraries/libmdb/mdb.h b/libraries/libmdb/mdb.h index 21b84a593d..ea857a0107 100644 --- a/libraries/libmdb/mdb.h +++ b/libraries/libmdb/mdb.h @@ -80,7 +80,7 @@ extern "C" { /** Library minor version */ #define MDB_VERSION_MINOR 9 /** Library patch version */ -#define MDB_VERSION_PATCH 0 +#define MDB_VERSION_PATCH 2 /** Combine args a,b,c into a single integer for easy version comparisons */ #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) @@ -90,10 +90,10 @@ extern "C" { MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH) /** The release date of this library version */ -#define MDB_VERSION_DATE "September 1, 2011" +#define MDB_VERSION_DATE "August 2, 2012" /** A stringifier for the version info */ -#define MDB_VERSTR(a,b,c,d) "MDB " #a "." #b "." #c ": (" #d ")" +#define MDB_VERSTR(a,b,c,d) "MDB " #a "." #b "." #c ": (" d ")" /** A helper for the stringifier macro */ #define MDB_VERFOO(a,b,c,d) MDB_VERSTR(a,b,c,d) -- 2.39.5