merge fixes from develop

This commit is contained in:
Guenter Obiltschnig
2017-11-08 11:48:52 +01:00
parent abc4919bfa
commit d90a3da585
7 changed files with 12 additions and 9 deletions

View File

@@ -28,7 +28,7 @@
// from a DLL simpler. All files within this DLL are compiled with the MongoDB_EXPORTS // from a DLL simpler. All files within this DLL are compiled with the MongoDB_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project // symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see // that uses this DLL. This way any other project whose source files include this file see
// MongoDB_API functions as being imported from a DLL, wheras this DLL sees symbols // MongoDB_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported. // defined with this macro as being exported.
// //

View File

@@ -47,7 +47,7 @@ public:
explicit ObjectId(const std::string& id); explicit ObjectId(const std::string& id);
/// Creates an ObjectId from a string. /// Creates an ObjectId from a string.
/// ///
/// The string must contain a hexidecimal representation /// The string must contain a hexadecimal representation
/// of an object ID. This means a string of 24 characters. /// of an object ID. This means a string of 24 characters.
ObjectId(const ObjectId& copy); ObjectId(const ObjectId& copy);

View File

@@ -99,9 +99,12 @@ public:
virtual ~PooledConnection() virtual ~PooledConnection()
{ {
try try
{
if (_connection)
{ {
_pool.returnObject(_connection); _pool.returnObject(_connection);
} }
}
catch (...) catch (...)
{ {
poco_unexpected(); poco_unexpected();

View File

@@ -52,7 +52,7 @@ private:
}; };
#endif // MongoDB_ReplicaSet_INCLUDED
} } // namespace Poco::MongoDB } } // namespace Poco::MongoDB
#endif // MongoDB_ReplicaSet_INCLUDED

View File

@@ -57,7 +57,7 @@ Int64 Document::getInteger(const std::string& name) const
if (ElementTraits<double>::TypeId == element->type()) if (ElementTraits<double>::TypeId == element->type())
{ {
ConcreteElement<double>* concrete = dynamic_cast<ConcreteElement<double>*>(element.get()); ConcreteElement<double>* concrete = dynamic_cast<ConcreteElement<double>*>(element.get());
if (concrete) return concrete->value(); if (concrete) return static_cast<Int64>(concrete->value());
} }
else if (ElementTraits<Int32>::TypeId == element->type()) else if (ElementTraits<Int32>::TypeId == element->type())
{ {

View File

@@ -33,7 +33,7 @@ KillCursorsRequest::~KillCursorsRequest()
void KillCursorsRequest::buildRequest(BinaryWriter& writer) void KillCursorsRequest::buildRequest(BinaryWriter& writer)
{ {
writer << 0; // 0 - reserved for future use writer << 0; // 0 - reserved for future use
writer << _cursors.size(); writer << static_cast<Poco::UInt64>(_cursors.size());
for (std::vector<Int64>::iterator it = _cursors.begin(); it != _cursors.end(); ++it) for (std::vector<Int64>::iterator it = _cursors.begin(); it != _cursors.end(); ++it)
{ {
writer << *it; writer << *it;

View File

@@ -243,7 +243,7 @@ void MongoDBTest::testCursorRequest()
Poco::MongoDB::ResponseMessage& response = cursor.next(*_mongo); Poco::MongoDB::ResponseMessage& response = cursor.next(*_mongo);
while(1) while(1)
{ {
n += response.documents().size(); n += static_cast<int>(response.documents().size());
if ( response.cursorID() == 0 ) if ( response.cursorID() == 0 )
break; break;
response = cursor.next(*_mongo); response = cursor.next(*_mongo);