Suppress some warnings.

This commit is contained in:
JoelKatz
2013-04-02 12:24:05 -07:00
parent d73995e695
commit 2e28179217
4 changed files with 8 additions and 8 deletions

View File

@@ -419,12 +419,12 @@ void Application::loadOldLedger(const std::string& l)
mLedgerMaster.switchLedgers(loadLedger, openLedger);
mNetOps.setLastCloseTime(loadLedger->getCloseTimeNC());
}
catch (SHAMapMissingNode& mn)
catch (SHAMapMissingNode&)
{
cLog(lsFATAL) << "Data is missing for selected ledger";
exit(-1);
}
catch (boost::bad_lexical_cast& blc)
catch (boost::bad_lexical_cast&)
{
cLog(lsFATAL) << "Ledger specified '" << l << "' is not valid";
exit(-1);

View File

@@ -81,7 +81,7 @@ void SNTPClient::resolveComplete(const boost::system::error_code& error, boost::
query.mReceivedReply = false;
query.mLocalTimeSent = now;
getRand(reinterpret_cast<unsigned char *>(&query.mQueryNonce), sizeof(query.mQueryNonce));
reinterpret_cast<uint32*>(SNTPQueryData)[NTP_OFF_XMITTS_INT] = time(NULL) + NTP_UNIX_OFFSET;
reinterpret_cast<uint32*>(SNTPQueryData)[NTP_OFF_XMITTS_INT] = static_cast<uint32>(time(NULL)) + NTP_UNIX_OFFSET;
reinterpret_cast<uint32*>(SNTPQueryData)[NTP_OFF_XMITTS_FRAC] = query.mQueryNonce;
mSocket.async_send_to(boost::asio::buffer(SNTPQueryData, 48), *sel,
boost::bind(&SNTPClient::sendComplete, this,
@@ -148,7 +148,7 @@ void SNTPClient::processReply()
return;
}
time_t now = time(NULL);
int64 now = static_cast<int>(time(NULL));
timev -= now;
timev -= NTP_UNIX_OFFSET;

View File

@@ -99,7 +99,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::setTa
boost::recursive_mutex::scoped_lock sl(mLock);
mTargetSize = s;
if (s > 0)
mCache.rehash((s + (s >> 2)) / mCache.max_load_factor() + 1);
mCache.rehash(static_cast<std::size_t>((s + (s >> 2)) / mCache.max_load_factor() + 1));
Log(lsDEBUG, TaggedCachePartition) << mName << " target size set to " << s;
}
@@ -136,7 +136,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
int target = mLastSweep - mTargetAge;
int cacheRemovals = 0, mapRemovals = 0, cc = 0;
if ((mTargetSize != 0) && (mCache.size() > mTargetSize))
if ((mTargetSize != 0) && (static_cast<int>(mCache.size()) > mTargetSize))
{
target = mLastSweep - (mTargetAge * mTargetSize / mCache.size());
if (target > (mLastSweep - 2))

View File

@@ -22,7 +22,7 @@ static std::vector<std::string> getSchema(DatabaseCon* dbc, const std::string& d
static bool schemaHas(DatabaseCon* dbc, const std::string& dbName, int line, const std::string& content)
{
std::vector<std::string> schema = getSchema(dbc, dbName);
if (schema.size() <= line)
if (static_cast<int>(schema.size()) <= line)
{
Log(lsFATAL) << "Schema for " << dbName << " has too few lines";
throw std::runtime_error("bad schema");
@@ -50,7 +50,7 @@ static void addTxnSeqField()
int metaSize = 2048;
rawMeta.resize(metaSize);
metaSize = db->getBinary("TxnMeta", &*rawMeta.begin(), rawMeta.size());
if (metaSize > rawMeta.size())
if (metaSize > static_cast<int>(rawMeta.size()))
{
rawMeta.resize(metaSize);
db->getBinary("TxnMeta", &*rawMeta.begin(), rawMeta.size());