diff --git a/MongoDB/include/Poco/MongoDB/MongoDB.h b/MongoDB/include/Poco/MongoDB/MongoDB.h index 9ccaca185..8e2126f12 100644 --- a/MongoDB/include/Poco/MongoDB/MongoDB.h +++ b/MongoDB/include/Poco/MongoDB/MongoDB.h @@ -28,7 +28,7 @@ // 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 // 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. // diff --git a/MongoDB/include/Poco/MongoDB/ObjectId.h b/MongoDB/include/Poco/MongoDB/ObjectId.h index 8c58d80a4..659047c95 100644 --- a/MongoDB/include/Poco/MongoDB/ObjectId.h +++ b/MongoDB/include/Poco/MongoDB/ObjectId.h @@ -47,7 +47,7 @@ public: explicit ObjectId(const std::string& id); /// 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. ObjectId(const ObjectId& copy); diff --git a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h index 60115b188..a723eb13b 100644 --- a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h +++ b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h @@ -100,7 +100,10 @@ public: { try { - _pool.returnObject(_connection); + if (_connection) + { + _pool.returnObject(_connection); + } } catch (...) { diff --git a/MongoDB/include/Poco/MongoDB/ReplicaSet.h b/MongoDB/include/Poco/MongoDB/ReplicaSet.h index e4fb5741b..1f7cd93d6 100644 --- a/MongoDB/include/Poco/MongoDB/ReplicaSet.h +++ b/MongoDB/include/Poco/MongoDB/ReplicaSet.h @@ -52,7 +52,7 @@ private: }; -#endif // MongoDB_ReplicaSet_INCLUDED - - } } // namespace Poco::MongoDB + + +#endif // MongoDB_ReplicaSet_INCLUDED diff --git a/MongoDB/src/Document.cpp b/MongoDB/src/Document.cpp index 6e7bc065c..114fc9938 100644 --- a/MongoDB/src/Document.cpp +++ b/MongoDB/src/Document.cpp @@ -57,7 +57,7 @@ Int64 Document::getInteger(const std::string& name) const if (ElementTraits::TypeId == element->type()) { ConcreteElement* concrete = dynamic_cast*>(element.get()); - if (concrete) return concrete->value(); + if (concrete) return static_cast(concrete->value()); } else if (ElementTraits::TypeId == element->type()) { diff --git a/MongoDB/src/KillCursorsRequest.cpp b/MongoDB/src/KillCursorsRequest.cpp index 7bf133a9c..6baa0e0be 100644 --- a/MongoDB/src/KillCursorsRequest.cpp +++ b/MongoDB/src/KillCursorsRequest.cpp @@ -33,7 +33,7 @@ KillCursorsRequest::~KillCursorsRequest() void KillCursorsRequest::buildRequest(BinaryWriter& writer) { writer << 0; // 0 - reserved for future use - writer << _cursors.size(); + writer << static_cast(_cursors.size()); for (std::vector::iterator it = _cursors.begin(); it != _cursors.end(); ++it) { writer << *it; diff --git a/MongoDB/testsuite/src/MongoDBTest.cpp b/MongoDB/testsuite/src/MongoDBTest.cpp index 6703f2764..334c8f118 100644 --- a/MongoDB/testsuite/src/MongoDBTest.cpp +++ b/MongoDB/testsuite/src/MongoDBTest.cpp @@ -243,7 +243,7 @@ void MongoDBTest::testCursorRequest() Poco::MongoDB::ResponseMessage& response = cursor.next(*_mongo); while(1) { - n += response.documents().size(); + n += static_cast(response.documents().size()); if ( response.cursorID() == 0 ) break; response = cursor.next(*_mongo);