From 5fdbc54d7613b9d7da75307086fb5bb1c53b4cab Mon Sep 17 00:00:00 2001 From: Hallvard B Furuseth Date: Wed, 29 Jun 2011 20:35:40 +0200 Subject: [PATCH] Warning cleanup: if(rc = mdb_()) & co --- libraries/libmdb/mdb.c | 2 +- libraries/libmdb/mtest.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index f3087230d2..0b04b2826a 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -1203,7 +1203,7 @@ mdb_search_page_root(MDB_db *bt, MDB_val *key, if (modify) { MDB_dhead *dh = ((MDB_dhead *)mp)-1; - if (rc = mdb_touch(bt->md_env->me_txn, mpp)) + if ((rc = mdb_touch(bt->md_env->me_txn, mpp)) != 0) return rc; dh = ((MDB_dhead *)mpp->mp_page)-1; dh->md_parent = mpp->mp_parent; diff --git a/libraries/libmdb/mtest.c b/libraries/libmdb/mtest.c index 55560d5741..6b084f9658 100644 --- a/libraries/libmdb/mtest.c +++ b/libraries/libmdb/mtest.c @@ -47,7 +47,7 @@ int main(int argc,char * argv[]) rc = mdbenv_stat(env, &mst); rc = mdb_cursor_open(db, NULL, &cursor); - while (rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) { + while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) { printf("key: %p %.*s, data: %p %.*s\n", key.mv_data, (int) key.mv_size, (char *) key.mv_data, data.mv_data, (int) data.mv_size, (char *) data.mv_data); @@ -74,7 +74,7 @@ int main(int argc,char * argv[]) rc = mdbenv_stat(env, &mst); rc = mdb_cursor_open(db, NULL, &cursor); - while (rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) { + while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) { printf("key: %.*s, data: %.*s\n", (int) key.mv_size, (char *) key.mv_data, (int) data.mv_size, (char *) data.mv_data); -- 2.39.5