From b533ea01dd9f4ef081684d5563647525a0ff002a Mon Sep 17 00:00:00 2001 From: "Bradley C. Kuszmaul" Date: Tue, 18 Dec 2007 20:39:02 +0000 Subject: [PATCH] Move db_cxx.h to include dir, and fix valgrind issues. Fixes #197. git-svn-id: file:///svn/tokudb@1218 c7de825b-a66e-492c-adef-691d508d4ae1 --- cxx/Makefile | 3 +-- cxx/db.cpp | 7 +++---- cxx/dbc.cpp | 2 +- cxx/dbenv.cpp | 2 +- cxx/dbt.cpp | 2 +- cxx/dbtxn.cpp | 2 +- cxx/txn.cpp | 2 +- {cxx => include}/db_cxx.h | 0 8 files changed, 9 insertions(+), 11 deletions(-) rename {cxx => include}/db_cxx.h (100%) diff --git a/cxx/Makefile b/cxx/Makefile index eafb5037334..ee0bdb22b63 100644 --- a/cxx/Makefile +++ b/cxx/Makefile @@ -10,8 +10,7 @@ LIBNAME = libtdb_cxx default: install install: $(LIBNAME).a cp $< ../lib/ - cp db_cxx.h ../include/ -$(OBJS): db_cxx.h +$(OBJS): ../include/db_cxx.h test1: test1.o dbt.o db.o dbenv.o ../lib/libdb.a $(LIBNAME).a: $(OBJS) diff --git a/cxx/db.cpp b/cxx/db.cpp index 73e7408f8c9..e81c23b0df4 100644 --- a/cxx/db.cpp +++ b/cxx/db.cpp @@ -1,16 +1,15 @@ #include #include #include -#include "db_cxx.h" +#include Db::Db(DbEnv *env, u_int32_t flags) : the_Env(env) { the_db = 0; - if (the_Env == 0) { - is_private_env = 1; - } + is_private_env = (the_Env == 0); + DB *tmp_db; int ret = db_create(&tmp_db, the_Env->get_DB_ENV(), flags & !(DB_CXX_NO_EXCEPTIONS)); if (ret!=0) { diff --git a/cxx/dbc.cpp b/cxx/dbc.cpp index f49db31c9f5..10ae3684350 100644 --- a/cxx/dbc.cpp +++ b/cxx/dbc.cpp @@ -1,4 +1,4 @@ -#include "db_cxx.h" +#include int Dbc::close (void) { DBC *dbc = this; diff --git a/cxx/dbenv.cpp b/cxx/dbenv.cpp index eb7a5fc56c3..d5e2ddfc129 100644 --- a/cxx/dbenv.cpp +++ b/cxx/dbenv.cpp @@ -1,5 +1,5 @@ #include -#include "db_cxx.h" +#include DbEnv::DbEnv (u_int32_t flags) { int ret = db_env_create(&the_env, flags & ~DB_CXX_NO_EXCEPTIONS); diff --git a/cxx/dbt.cpp b/cxx/dbt.cpp index 0f140a10df3..293923e3757 100644 --- a/cxx/dbt.cpp +++ b/cxx/dbt.cpp @@ -1,4 +1,4 @@ -#include "db_cxx.h" +#include Dbt::Dbt(void) { DBT *dbt = this; diff --git a/cxx/dbtxn.cpp b/cxx/dbtxn.cpp index 894b05ee767..3b354fce3f9 100644 --- a/cxx/dbtxn.cpp +++ b/cxx/dbtxn.cpp @@ -1,4 +1,4 @@ -#include "db_cxx.h" +#include int DbTxn::commit (u_int32_t flags) { DB_TXN *txn = get_DB_TXN(); diff --git a/cxx/txn.cpp b/cxx/txn.cpp index 8ce192e3fc5..72c59f7c074 100644 --- a/cxx/txn.cpp +++ b/cxx/txn.cpp @@ -1,5 +1,5 @@ #include -#include "db_cxx.h" +#include DbTxn::DbTxn(DB_TXN *txn) : the_txn(txn) diff --git a/cxx/db_cxx.h b/include/db_cxx.h similarity index 100% rename from cxx/db_cxx.h rename to include/db_cxx.h