summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2017-06-20 20:15:25 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-06-21 08:29:48 (GMT)
commit83fb5ae3da2e5e690a3eafae99f6cd0cb59a2496 (patch)
treeb2924f4079410642885681d53b1295e5d6125347
parenta507a88a189bb603c9f2d686c9c8dafca49c053d (diff)
downloadswift-83fb5ae3da2e5e690a3eafae99f6cd0cb59a2496.zip
swift-83fb5ae3da2e5e690a3eafae99f6cd0cb59a2496.tar.bz2
Fix compiler warnings
Both catching polymorphic base classes by value and explicitly moving things preventing return value optimization. Test-Information: Compiles on macOS with latest xcode with allow_warnings=False and unit tests pass Change-Id: Ibdc67f4f2019f85f14635df2a3ff06bddbb8e2b6
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.cpp2
-rw-r--r--Swift/Controllers/Chat/ChatMessageParser.cpp4
-rw-r--r--Swiften/Parser/BOSHBodyExtractor.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Sluift/ElementConvertors/DOMElementConvertor.cpp b/Sluift/ElementConvertors/DOMElementConvertor.cpp
index 72474bb..b957686 100644
--- a/Sluift/ElementConvertors/DOMElementConvertor.cpp
+++ b/Sluift/ElementConvertors/DOMElementConvertor.cpp
@@ -187,3 +187,3 @@ boost::optional<std::string> DOMElementConvertor::convertToLua(
ParserClient parserClient(L);
- std::shared_ptr<XMLParser> parser(std::move(parsers.createXMLParser(&parserClient)));
+ std::shared_ptr<XMLParser> parser(parsers.createXMLParser(&parserClient));
bool result = parser->parse(serializedPayload);
diff --git a/Swift/Controllers/Chat/ChatMessageParser.cpp b/Swift/Controllers/Chat/ChatMessageParser.cpp
index 1a822a1..31be451 100644
--- a/Swift/Controllers/Chat/ChatMessageParser.cpp
+++ b/Swift/Controllers/Chat/ChatMessageParser.cpp
@@ -134,3 +134,3 @@ namespace Swift {
}
- catch (std::runtime_error) {
+ catch (const std::runtime_error&) {
/* Basically too expensive to compute the regex results and it gave up, so pass through as text */
@@ -187,3 +187,3 @@ namespace Swift {
}
- catch (std::runtime_error) {
+ catch (const std::runtime_error&) {
/* Basically too expensive to compute the regex results and it gave up, so pass through as text */
diff --git a/Swiften/Parser/BOSHBodyExtractor.cpp b/Swiften/Parser/BOSHBodyExtractor.cpp
index 803f16a..c45d338 100644
--- a/Swiften/Parser/BOSHBodyExtractor.cpp
+++ b/Swiften/Parser/BOSHBodyExtractor.cpp
@@ -128,3 +128,3 @@ BOSHBodyExtractor::BOSHBodyExtractor(XMLParserFactory* parserFactory, const Byte
BOSHBodyParserClient parserClient(this);
- std::shared_ptr<XMLParser> parser(std::move(parserFactory->createXMLParser(&parserClient)));
+ std::shared_ptr<XMLParser> parser(parserFactory->createXMLParser(&parserClient));
if (!parser->parse(std::string(