diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-04 17:52:25 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-04 17:52:25 +0100 |
commit | 3ff320c9f11a4c51164adeb8a2b098aec22742c3 (patch) | |
tree | 7d32f883a5b39d8e192d7341dbe516b92aaa5049 | |
parent | b53bdc29418d946e6b479a153fc5714746c87283 (diff) | |
download | sink-3ff320c9f11a4c51164adeb8a2b098aec22742c3.tar.gz sink-3ff320c9f11a4c51164adeb8a2b098aec22742c3.zip |
spaces in debug
-rw-r--r-- | store/database.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/store/database.cpp b/store/database.cpp index 22d0693..71ec47d 100644 --- a/store/database.cpp +++ b/store/database.cpp | |||
@@ -37,11 +37,11 @@ Database::Private::Private(const QString &path) | |||
37 | int rc = mdb_env_open(env, path.toStdString().data(), 0, 0664); | 37 | int rc = mdb_env_open(env, path.toStdString().data(), 0, 0664); |
38 | 38 | ||
39 | if (rc) { | 39 | if (rc) { |
40 | std::cerr << "mdb_env_open: " << rc << mdb_strerror(rc) << std::endl; | 40 | std::cerr << "mdb_env_open: " << rc << " " << mdb_strerror(rc) << std::endl; |
41 | mdb_env_close(env); | 41 | mdb_env_close(env); |
42 | env = 0; | 42 | env = 0; |
43 | } else { | 43 | } else { |
44 | const int dbSize = 10485760*100; //10MB * 100 | 44 | const size_t dbSize = 10485760 * 100; //10MB * 100 |
45 | mdb_env_set_mapsize(env, dbSize); | 45 | mdb_env_set_mapsize(env, dbSize); |
46 | } | 46 | } |
47 | } | 47 | } |
@@ -114,7 +114,7 @@ bool Database::commitTransaction() | |||
114 | d->transaction = 0; | 114 | d->transaction = 0; |
115 | 115 | ||
116 | if (rc) { | 116 | if (rc) { |
117 | std::cerr << "mdb_txn_commit: " << rc << mdb_strerror(rc) << std::endl; | 117 | std::cerr << "mdb_txn_commit: " << rc << " " << mdb_strerror(rc) << std::endl; |
118 | } | 118 | } |
119 | 119 | ||
120 | return !rc; | 120 | return !rc; |
@@ -153,7 +153,7 @@ bool Database::write(const std::string &sKey, const std::string &sValue) | |||
153 | rc = mdb_put(d->transaction, d->dbi, &key, &data, 0); | 153 | rc = mdb_put(d->transaction, d->dbi, &key, &data, 0); |
154 | 154 | ||
155 | if (rc) { | 155 | if (rc) { |
156 | std::cerr << "mdb_put: " << rc << mdb_strerror(rc) << std::endl; | 156 | std::cerr << "mdb_put: " << rc << " " << mdb_strerror(rc) << std::endl; |
157 | } | 157 | } |
158 | 158 | ||
159 | if (implicitTransaction) { | 159 | if (implicitTransaction) { |
@@ -212,7 +212,7 @@ TODO: do we need a write transaction before a read transaction? only relevant fo | |||
212 | 212 | ||
213 | rc = mdb_cursor_open(d->transaction, d->dbi, &cursor); | 213 | rc = mdb_cursor_open(d->transaction, d->dbi, &cursor); |
214 | if (rc) { | 214 | if (rc) { |
215 | std::cerr << "mdb_cursor_get: " << rc << mdb_strerror(rc) << std::endl; | 215 | std::cerr << "mdb_cursor_get: " << rc << " " << mdb_strerror(rc) << std::endl; |
216 | return; | 216 | return; |
217 | } | 217 | } |
218 | 218 | ||
@@ -230,12 +230,12 @@ TODO: do we need a write transaction before a read transaction? only relevant fo | |||
230 | if ((rc = mdb_cursor_get(cursor, &key, &data, MDB_SET)) == 0) { | 230 | if ((rc = mdb_cursor_get(cursor, &key, &data, MDB_SET)) == 0) { |
231 | resultHandler(data.mv_data, data.mv_size); | 231 | resultHandler(data.mv_data, data.mv_size); |
232 | } else { | 232 | } else { |
233 | std::cout << "couldn't find value " << sKey << std::endl; | 233 | std::cout << "couldn't find value " << sKey << " " << std::endl; |
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
237 | if (rc) { | 237 | if (rc) { |
238 | std::cerr << "mdb_cursor_get: " << rc << mdb_strerror(rc) << std::endl; | 238 | std::cerr << "mdb_cursor_get: " << rc << " " << mdb_strerror(rc) << std::endl; |
239 | } | 239 | } |
240 | 240 | ||
241 | mdb_cursor_close(cursor); | 241 | mdb_cursor_close(cursor); |