diff options
Diffstat (limited to 'Swiften/Parser')
-rw-r--r-- | Swiften/Parser/LibXMLParser.cpp | 3 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/FormParser.h | 2 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.cpp | 2 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/WhiteboardParser.cpp | 8 |
4 files changed, 8 insertions, 7 deletions
diff --git a/Swiften/Parser/LibXMLParser.cpp b/Swiften/Parser/LibXMLParser.cpp index caba716..74ee051 100644 --- a/Swiften/Parser/LibXMLParser.cpp +++ b/Swiften/Parser/LibXMLParser.cpp @@ -7,6 +7,7 @@ #include <Swiften/Parser/LibXMLParser.h> #include <iostream> +#include <boost/numeric/conversion/cast.hpp> #include <cassert> #include <cstring> #include <libxml/parser.h> @@ -86,7 +87,7 @@ LibXMLParser::~LibXMLParser() { } bool LibXMLParser::parse(const std::string& data) { - if (xmlParseChunk(p->context_, data.c_str(), data.size(), false) == XML_ERR_OK) { + if (xmlParseChunk(p->context_, data.c_str(), boost::numeric_cast<unsigned int>(data.size()), false) == XML_ERR_OK) { return true; } xmlError* error = xmlCtxtGetLastError(p->context_); diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h index a3e2524..ec480a5 100644 --- a/Swiften/Parser/PayloadParsers/FormParser.h +++ b/Swiften/Parser/PayloadParsers/FormParser.h @@ -85,7 +85,7 @@ namespace Swift { name##FormFieldParseHelper() : baseParser##FieldParseHelper() { \ field = name##FormField::create(); \ } \ - }; + } SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(Boolean, Bool); SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(Fixed, String); diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.cpp b/Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.cpp index 0a13844..cc69348 100644 --- a/Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.cpp +++ b/Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.cpp @@ -35,7 +35,7 @@ void StreamInitiationFileInfoParser::handleStartElement(const std::string& eleme } else { parseDescription = false; if (element == "range") { - int offset = 0; + boost::uintmax_t offset = 0; try { offset = boost::lexical_cast<boost::uintmax_t>(attributes.getAttributeValue("offset").get_value_or("0")); } catch (boost::bad_lexical_cast &) { diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp index 09d8de9..a480813 100644 --- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp +++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp @@ -83,8 +83,8 @@ namespace Swift { std::string pathData = attributes.getAttributeValue("d").get_value_or(""); std::vector<std::pair<int, int> > points; if (pathData[0] == 'M') { - unsigned int pos = 1; - unsigned int npos; + size_t pos = 1; + size_t npos; int x, y; if (pathData[pos] == ' ') { pos++; @@ -163,8 +163,8 @@ namespace Swift { std::string pointsData = attributes.getAttributeValue("points").get_value_or(""); std::vector<std::pair<int, int> > points; - unsigned int pos = 0; - unsigned int npos; + size_t pos = 0; + size_t npos; int x, y; try { while (pos < pointsData.size()) { |