aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-04-20 09:05:12 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-04-23 09:32:25 +0200
commit74f7b1273c41892058fb2ff99aab878ccd22082a (patch)
tree03e599adb2e5a70f2d85ff0927fdbe372ec7b7c9 /src
parent04a29373571d44be36bd099c3b3ec3cda89e99d1 (diff)
dbwrapper: Remove throw keywords in function signatures
Using throw() specifications in function signatures is not only not required in C++, it is considered deprecated for [various reasons](https://stackoverflow.com/questions/1055387/throw-keyword-in-functions-signature). It is not implemented by any of the common C++ compilers. The usage is also inconsistent with the rest of the source code.
Diffstat (limited to 'src')
-rw-r--r--src/dbwrapper.cpp4
-rw-r--r--src/dbwrapper.h14
2 files changed, 9 insertions, 9 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp
index 1907e2fa78..16f85a3e65 100644
--- a/src/dbwrapper.cpp
+++ b/src/dbwrapper.cpp
@@ -15,7 +15,7 @@
#include <memenv.h>
#include <stdint.h>
-void HandleError(const leveldb::Status& status) throw(dbwrapper_error)
+void HandleError(const leveldb::Status& status)
{
if (status.ok())
return;
@@ -102,7 +102,7 @@ CDBWrapper::~CDBWrapper()
options.env = NULL;
}
-bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync) throw(dbwrapper_error)
+bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
{
leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch);
HandleError(status);
diff --git a/src/dbwrapper.h b/src/dbwrapper.h
index 5e7313f7eb..96fb42429f 100644
--- a/src/dbwrapper.h
+++ b/src/dbwrapper.h
@@ -23,7 +23,7 @@ public:
dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
};
-void HandleError(const leveldb::Status& status) throw(dbwrapper_error);
+void HandleError(const leveldb::Status& status);
/** Batch of changes queued to be written to a CDBWrapper */
class CDBBatch
@@ -180,7 +180,7 @@ public:
~CDBWrapper();
template <typename K, typename V>
- bool Read(const K& key, V& value) const throw(dbwrapper_error)
+ bool Read(const K& key, V& value) const
{
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(ssKey.GetSerializeSize(key));
@@ -206,7 +206,7 @@ public:
}
template <typename K, typename V>
- bool Write(const K& key, const V& value, bool fSync = false) throw(dbwrapper_error)
+ bool Write(const K& key, const V& value, bool fSync = false)
{
CDBBatch batch(&obfuscate_key);
batch.Write(key, value);
@@ -214,7 +214,7 @@ public:
}
template <typename K>
- bool Exists(const K& key) const throw(dbwrapper_error)
+ bool Exists(const K& key) const
{
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(ssKey.GetSerializeSize(key));
@@ -233,14 +233,14 @@ public:
}
template <typename K>
- bool Erase(const K& key, bool fSync = false) throw(dbwrapper_error)
+ bool Erase(const K& key, bool fSync = false)
{
CDBBatch batch(&obfuscate_key);
batch.Erase(key);
return WriteBatch(batch, fSync);
}
- bool WriteBatch(CDBBatch& batch, bool fSync = false) throw(dbwrapper_error);
+ bool WriteBatch(CDBBatch& batch, bool fSync = false);
// not available for LevelDB; provide for compatibility with BDB
bool Flush()
@@ -248,7 +248,7 @@ public:
return true;
}
- bool Sync() throw(dbwrapper_error)
+ bool Sync()
{
CDBBatch batch(&obfuscate_key);
return WriteBatch(batch, true);