Fix clang warnings

This commit is contained in:
Howard Hinnant
2014-02-25 15:49:27 -05:00
committed by Vinnie Falco
parent 9bf1a76e91
commit cd30e552a7
28 changed files with 115 additions and 66 deletions

View File

@@ -195,14 +195,19 @@ Data::pointer Interpreter::getUint160Data ()
bool Interpreter::jumpTo (int offset)
{
mInstructionPointer += offset;
if ( (mInstructionPointer < 0) || (mInstructionPointer > mCode->size ()) )
if (offset < 0)
{
mInstructionPointer -= offset;
return (false);
if (-offset > mInstructionPointer)
return false;
}
else
{
if (offset > mCode->size () ||
mInstructionPointer > mCode->size () - offset)
return false;
}
mInstructionPointer += offset;
return (true);
}

View File

@@ -891,7 +891,7 @@ public:
// PropertyStream
//
void onWrite (PropertyStream& stream)
void onWrite (PropertyStream::Map& stream)
{
}

View File

@@ -235,6 +235,13 @@ void SerializedTransaction::setSourceAccount (const RippleAddress& naSource)
setFieldAccount (sfAccount, naSource);
}
Json::Value SerializedTransaction::getJson (int) const
{
Json::Value ret = STObject::getJson (0);
ret["hash"] = getTransactionID ().GetHex ();
return ret;
}
Json::Value SerializedTransaction::getJson (int options, bool binary) const
{
if (binary)
@@ -245,10 +252,7 @@ Json::Value SerializedTransaction::getJson (int options, bool binary) const
ret["hash"] = getTransactionID ().GetHex ();
return ret;
}
Json::Value ret = STObject::getJson (0);
ret["hash"] = getTransactionID ().GetHex ();
return ret;
return getJson(options);
}
std::string SerializedTransaction::getSQLValueHeader ()

View File

@@ -101,7 +101,8 @@ public:
uint256 getTransactionID () const;
virtual Json::Value getJson (int options, bool binary = false) const;
virtual Json::Value getJson (int options) const;
virtual Json::Value getJson (int options, bool binary) const;
void sign (const RippleAddress & naAccountPrivate);
bool checkSign (const RippleAddress & naAccountPublic) const;

View File

@@ -48,11 +48,9 @@ static int s_nodeStoreDBCount = NUMBER (s_nodeStoreDBInit);
class SqliteBackend : public NodeStore::Backend
{
public:
SqliteBackend (size_t keyBytes, std::string const& path, NodeStore::Scheduler& scheduler)
: m_keyBytes (keyBytes)
, m_name (path)
explicit SqliteBackend (std::string const& path)
: m_name (path)
, m_db (new DatabaseCon(path, s_nodeStoreDBInit, s_nodeStoreDBCount))
, m_scheduler (scheduler)
{
String s;
@@ -218,10 +216,8 @@ public:
}
private:
size_t const m_keyBytes;
std::string const m_name;
std::unique_ptr <DatabaseCon> m_db;
NodeStore::Scheduler& m_scheduler;
};
//------------------------------------------------------------------------------
@@ -235,11 +231,10 @@ public:
}
std::unique_ptr <NodeStore::Backend> createInstance (
size_t keyBytes, NodeStore::Parameters const& keyValues,
NodeStore::Scheduler& scheduler, Journal)
size_t, NodeStore::Parameters const& keyValues,
NodeStore::Scheduler&, Journal)
{
return std::make_unique <SqliteBackend> (
keyBytes, keyValues ["path"].toStdString (), scheduler);
return std::make_unique <SqliteBackend> (keyValues ["path"].toStdString ());
}
};

View File

@@ -437,11 +437,11 @@ public:
{
int iDomains = 0;
int iNodes = 0;
Database* db = getApp().getWalletDB ()->getDB ();
#if 0
{
DeprecatedScopedLock sl (getApp().getWalletDB ()->getDBLock ());
Database* db = getApp().getWalletDB ()->getDB ();
if (db->executeSQL (str (boost::format ("SELECT COUNT(*) AS Count FROM SeedDomains WHERE Source='%s' OR Source='%c';") % vsManual % vsValidator)) && db->startIterRows ())
iDomains = db->getInt ("Count");