1
0
Fork 0

fix Visual Studio complaints

This commit is contained in:
jsteemann 2016-10-31 09:59:18 +01:00
parent 3ea6999a36
commit cfc9ecd198
19 changed files with 32 additions and 28 deletions

View File

@ -867,7 +867,7 @@ BOOST_AUTO_TEST_CASE (tst_geo200) {
{
for(i=0;i<5;i++)
{
j=( (char *) list1->coordinates[i].data) - ix;
j=(int) (( (char *) list1->coordinates[i].data) - ix);
if(j==1)
{
dcheck(230, 89.97989055,list1->coordinates[i].latitude,0.0);
@ -907,7 +907,7 @@ BOOST_AUTO_TEST_CASE (tst_geo200) {
{
for(i=0;i<5;i++)
{
j=( (char *) list1->coordinates[i].data) - ix;
j=(int) (( (char *) list1->coordinates[i].data) - ix);
if(j==1)
{
dcheck(250, 89.97989055,list1->coordinates[i].latitude,0.0);

View File

@ -96,7 +96,7 @@ void Supervision::upgradeAgency() {
builder.close();
transact(_agent, builder);
}
} catch (std::exception const& e) {
} catch (std::exception const&) {
Builder builder;
builder.openArray();
builder.openObject();

View File

@ -64,7 +64,7 @@ static AstNode* createGlobalCondition(Ast* ast, AstNode const* condition) {
}
auto quantifier = condition->getMemberUnchecked(2);
TRI_ASSERT(quantifier->type == NODE_TYPE_QUANTIFIER);
int val = quantifier->getIntValue(true);
int64_t val = quantifier->getIntValue(true);
TRI_ASSERT(val != Quantifier::ANY);
if (val == Quantifier::NONE) {
auto it = Ast::NegatedOperators.find(type);

View File

@ -1057,7 +1057,11 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
// is in flight, this is possible, since we might have scheduled
// a retry later than now and simply wait till then
if (now < actionNeeded) {
usleep((actionNeeded - now) * 1000000);
#ifdef _WIN32
usleep((unsigned long) ((actionNeeded - now) * 1000000));
#else
usleep((useconds_t) ((actionNeeded - now) * 1000000));
#endif
}
continue;
}

View File

@ -276,7 +276,7 @@ bool VppCommTask::processRead() {
// get type of request
int type = meta::underlyingValue(rest::RequestType::ILLEGAL);
try {
type = header.at(1).getInt();
type = header.at(1).getNumber<int>();
} catch (std::exception const& e) {
handleSimpleError(rest::ResponseCode::BAD, chunkHeader._messageID);
LOG_TOPIC(DEBUG, Logger::COMMUNICATION)

View File

@ -28,7 +28,7 @@
using namespace arangodb;
HashIndexElement::HashIndexElement(TRI_voc_rid_t revisionId, std::vector<std::pair<VPackSlice, uint32_t>> const& values)
: _revisionId(revisionId), _hash(hash(values)) {
: _revisionId(revisionId), _hash(static_cast<uint32_t>(hash(values))) {
for (size_t i = 0; i < values.size(); ++i) {
subObject(i)->fill(values[i].first, values[i].second);

View File

@ -83,10 +83,10 @@ void RevisionCacheFeature::validateOptions(std::shared_ptr<ProgramOptions> optio
} else if (_targetSize < 32 * 1024 * 1024 || _targetSize / _chunkSize < 16) {
LOG(WARN) << "value for '--database.revision-cache-target-size' is very low";
}
if (_chunkSize >= _targetSize) {
LOG(WARN) << "value for '--database.revision-cache-target-size' should be higher than value of '--database.revision-cache-chunk-size'";
_chunkSize = _targetSize;
_chunkSize = static_cast<uint32_t>(_targetSize);
}
}

View File

@ -61,7 +61,7 @@ void SocketTcp::shutdownSend(boost::system::error_code& ec) {
}
int SocketTcp::available(boost::system::error_code& ec) {
return _socket.available(ec);
return static_cast<int>(_socket.available(ec));
}
void SocketTcp::asyncRead(boost::asio::mutable_buffers_1 const& buffer, AsyncHandler const& handler) {

View File

@ -938,7 +938,7 @@ std::vector<MMFilesCollection::DatafileDescription> MMFilesCollection::datafiles
return result;
}
int MMFilesCollection::applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
bool MMFilesCollection::applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) {
LOG(TRACE) << "getting datafiles in data range " << dataMin << " - " << dataMax;

View File

@ -104,8 +104,8 @@ class MMFilesCollection final : public PhysicalCollection {
void figures(std::shared_ptr<arangodb::velocypack::Builder>&) override;
// datafile management
int applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) override;
bool applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) override;
/// @brief closes an open collection
int close() override;

View File

@ -1298,7 +1298,7 @@ static void JS_PropertiesVocbaseCol(
result->Set(IsVolatileKey,
v8::Boolean::New(isolate, collection->isVolatile()));
result->Set(JournalSizeKey,
v8::Number::New(isolate, collection->journalSize()));
v8::Number::New(isolate, (double) collection->journalSize()));
result->Set(TRI_V8_ASCII_STRING("indexBuckets"),
v8::Number::New(isolate, collection->indexBuckets()));

View File

@ -434,14 +434,14 @@ AuthResult AuthInfo::checkAuthenticationJWT(std::string const& jwt) {
if (result._expires && now >= result._expireTime) {
try {
_authJwtCache.remove(jwt);
} catch (std::range_error const& e) {
} catch (std::range_error const&) {
}
}
return AuthResult();
}
}
return (AuthResult) result;
} catch (std::range_error const& e) {
} catch (std::range_error const&) {
// mop: not found
}

View File

@ -100,7 +100,7 @@ bool CollectionRevisionsCache::lookupRevision(Transaction* trx, ManagedDocumentR
TRI_ASSERT(revisionId != 0);
if (result.lastRevisionId() == revisionId) {
return result.lastVPack();
return true;
}
READ_LOCKER(locker, _lock);

View File

@ -311,7 +311,7 @@ LogicalCollection::LogicalCollection(
_isSystem(other.isSystem()),
_isVolatile(other.isVolatile()),
_waitForSync(other.waitForSync()),
_journalSize(other.journalSize()),
_journalSize(static_cast<TRI_voc_size_t>(other.journalSize())),
_keyOptions(other._keyOptions),
_version(other._version),
_indexBuckets(other.indexBuckets()),
@ -878,7 +878,7 @@ int LogicalCollection::replicationFactor() const {
// SECTION: Sharding
int LogicalCollection::numberOfShards() const {
return _numberOfShards;
return static_cast<int>(_numberOfShards);
}
bool LogicalCollection::allowUserKeys() const {

View File

@ -288,8 +288,8 @@ class LogicalCollection {
return getPhysical()->updateStats(fid, values);
}
int applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) {
bool applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) {
return getPhysical()->applyForTickRange(dataMin, dataMax, callback);
}

View File

@ -63,8 +63,8 @@ class PhysicalCollection {
/// @brief rotate the active journal - will do nothing if there is no journal
virtual int rotateActiveJournal() = 0;
virtual int applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) = 0;
virtual bool applyForTickRange(TRI_voc_tick_t dataMin, TRI_voc_tick_t dataMax,
std::function<bool(TRI_voc_tick_t foundTick, TRI_df_marker_t const* marker)> const& callback) = 0;
/// @brief increase dead stats for a datafile, if it exists
virtual void updateStats(TRI_voc_fid_t fid, DatafileStatisticsContainer const& values) = 0;

View File

@ -1280,7 +1280,7 @@ bool TRI_datafile_t::check(bool ignoreFailures) {
if (lastGood != nullptr) {
LOG(INFO) << "last good marker found at: " << hexValue(static_cast<uint64_t>(static_cast<uintptr_t>(lastGood - _data)));
}
printMarker(marker, end - ptr, _data, end);
printMarker(marker, static_cast<TRI_voc_size_t>(end - ptr), _data, end);
return false;
}

View File

@ -2257,7 +2257,7 @@ bool gzipUncompress(char const* compressed, size_t compressedLength, std::string
z_stream strm;
memset(&strm, 0, sizeof(strm));
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(compressed));
strm.avail_in = compressedLength;
strm.avail_in = (uInt) compressedLength;
if (inflateInit2(&strm, (16 + MAX_WBITS)) != Z_OK) {
return false;
@ -2292,7 +2292,7 @@ bool gzipDeflate(char const* compressed, size_t compressedLength, std::string& u
z_stream strm;
memset(&strm, 0, sizeof(strm));
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(compressed));
strm.avail_in = compressedLength;
strm.avail_in = (uInt) compressedLength;
if (inflateInit(&strm) != Z_OK) {
return false;

View File

@ -283,7 +283,7 @@ WorkDescription* WorkMonitor::createWorkDescription(WorkType type) {
void WorkMonitor::deleteWorkDescription(WorkDescription* desc, bool stopped) {
switch (desc->_type) {
case WorkType::THREAD:
desc->_data._thread._canceled.std::atomic<bool>::~atomic<bool>();
desc->_data._thread._canceled.std::atomic<bool>::~atomic();
break;
case WorkType::HANDLER:
@ -292,7 +292,7 @@ void WorkMonitor::deleteWorkDescription(WorkDescription* desc, bool stopped) {
case WorkType::AQL_ID:
case WorkType::AQL_STRING:
desc->_data._aql._canceled.std::atomic<bool>::~atomic<bool>();
desc->_data._aql._canceled.std::atomic<bool>::~atomic();
break;
case WorkType::CUSTOM: