Browse Source

merge fixes from develop

Guenter Obiltschnig 8 years ago
parent
commit
d90a3da585

+ 1 - 1
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.
 //
 

+ 1 - 1
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);

+ 4 - 1
MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h

@@ -100,7 +100,10 @@ public:
 	{
 		try
 		{
-			_pool.returnObject(_connection);
+			if (_connection)
+			{
+				_pool.returnObject(_connection);
+			}
 		}
 		catch (...)
 		{

+ 2 - 2
MongoDB/include/Poco/MongoDB/ReplicaSet.h

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

+ 1 - 1
MongoDB/src/Document.cpp

@@ -57,7 +57,7 @@ Int64 Document::getInteger(const std::string& name) const
 	if (ElementTraits<double>::TypeId == element->type())
 	{
 		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())
 	{

+ 1 - 1
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<Poco::UInt64>(_cursors.size());
 	for (std::vector<Int64>::iterator it = _cursors.begin(); it != _cursors.end(); ++it)
 	{
 		writer << *it;

+ 1 - 1
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<int>(response.documents().size());
 		if ( response.cursorID() == 0 )
 			break;
 		response = cursor.next(*_mongo);