summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-03-20 00:05:55 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-03-20 19:13:43 (GMT)
commit3d6694b0c698fff63d11f8bb4aa995c1df882315 (patch)
treea46ccace647f23a65100cf69c951345aa6dea7ab /Swiften/Session
parent3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9 (diff)
downloadswift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.zip
swift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.tar.bz2
boost::shared_ptr<?>(new ?(...)) -> boost::make_shared<?>(...) transformation where possible.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BOSHSessionStream.cpp2
-rw-r--r--Swiften/Session/BasicSessionStream.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp
index d706d43..ce5df35 100644
--- a/Swiften/Session/BOSHSessionStream.cpp
+++ b/Swiften/Session/BOSHSessionStream.cpp
@@ -163,7 +163,7 @@ void BOSHSessionStream::handleElementReceived(boost::shared_ptr<Element> element
void BOSHSessionStream::handleXMPPError() {
available = false;
- onClosed(boost::shared_ptr<Error>(new Error(Error::ParseError)));
+ onClosed(boost::make_shared<Error>(Error::ParseError));
}
void BOSHSessionStream::handlePoolSessionStarted() {
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp
index 70bbeea..f50c5d5 100644
--- a/Swiften/Session/BasicSessionStream.cpp
+++ b/Swiften/Session/BasicSessionStream.cpp
@@ -7,6 +7,7 @@
#include <Swiften/Session/BasicSessionStream.h>
#include <boost/bind.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/StreamStack/XMPPLayer.h>
#include <Swiften/StreamStack/StreamStack.h>
@@ -110,7 +111,7 @@ void BasicSessionStream::addTLSEncryption() {
assert(available);
tlsLayer = new TLSLayer(tlsContextFactory);
if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) {
- onClosed(boost::shared_ptr<Error>(new Error(Error::InvalidTLSCertificateError)));
+ onClosed(boost::make_shared<Error>(Error::InvalidTLSCertificateError));
}
else {
streamStack->addLayer(tlsLayer);
@@ -172,7 +173,7 @@ void BasicSessionStream::handleElementReceived(boost::shared_ptr<Element> elemen
void BasicSessionStream::handleXMPPError() {
available = false;
- onClosed(boost::shared_ptr<Error>(new Error(Error::ParseError)));
+ onClosed(boost::make_shared<Error>(Error::ParseError));
}
void BasicSessionStream::handleTLSConnected() {
@@ -181,16 +182,16 @@ void BasicSessionStream::handleTLSConnected() {
void BasicSessionStream::handleTLSError() {
available = false;
- onClosed(boost::shared_ptr<Error>(new Error(Error::TLSError)));
+ onClosed(boost::make_shared<Error>(Error::TLSError));
}
void BasicSessionStream::handleConnectionFinished(const boost::optional<Connection::Error>& error) {
available = false;
if (error == Connection::ReadError) {
- onClosed(boost::shared_ptr<Error>(new Error(Error::ConnectionReadError)));
+ onClosed(boost::make_shared<Error>(Error::ConnectionReadError));
}
else if (error) {
- onClosed(boost::shared_ptr<Error>(new Error(Error::ConnectionWriteError)));
+ onClosed(boost::make_shared<Error>(Error::ConnectionWriteError));
}
else {
onClosed(boost::shared_ptr<Error>());