summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-03 14:03:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-03 14:03:37 (GMT)
commit00200cfc0df5b616eb2eb48e5bb252f970808d15 (patch)
tree38388cd3c2c7dc9cacf725a8253f521cc090afc5
parent21fda3308975201eeebeacd98e2b587ef4448862 (diff)
downloadswift-contrib-00200cfc0df5b616eb2eb48e5bb252f970808d15.zip
swift-contrib-00200cfc0df5b616eb2eb48e5bb252f970808d15.tar.bz2
Make StreamResume(d) element use unsigned int for stanza count.
-rw-r--r--Swiften/Elements/StreamResume.h6
-rw-r--r--Swiften/Elements/StreamResumed.h6
-rw-r--r--Swiften/Parser/StreamResumeParser.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Elements/StreamResume.h b/Swiften/Elements/StreamResume.h
index 652182a..aec0909 100644
--- a/Swiften/Elements/StreamResume.h
+++ b/Swiften/Elements/StreamResume.h
@@ -25,16 +25,16 @@ namespace Swift {
return resumeID;
}
- const boost::optional<int> getHandledStanzasCount() const {
+ const boost::optional<unsigned int> getHandledStanzasCount() const {
return handledStanzasCount;
}
- void setHandledStanzasCount(int i) {
+ void setHandledStanzasCount(unsigned int i) {
handledStanzasCount = i;
}
private:
std::string resumeID;
- boost::optional<int> handledStanzasCount;
+ boost::optional<unsigned int> handledStanzasCount;
};
}
diff --git a/Swiften/Elements/StreamResumed.h b/Swiften/Elements/StreamResumed.h
index cc42895..cf9a755 100644
--- a/Swiften/Elements/StreamResumed.h
+++ b/Swiften/Elements/StreamResumed.h
@@ -25,16 +25,16 @@ namespace Swift {
return resumeID;
}
- const boost::optional<int> getHandledStanzasCount() const {
+ const boost::optional<unsigned int> getHandledStanzasCount() const {
return handledStanzasCount;
}
- void setHandledStanzasCount(int i) {
+ void setHandledStanzasCount(unsigned int i) {
handledStanzasCount = i;
}
private:
std::string resumeID;
- boost::optional<int> handledStanzasCount;
+ boost::optional<unsigned int> handledStanzasCount;
};
}
diff --git a/Swiften/Parser/StreamResumeParser.cpp b/Swiften/Parser/StreamResumeParser.cpp
index f54dcf0..cb1a61d 100644
--- a/Swiften/Parser/StreamResumeParser.cpp
+++ b/Swiften/Parser/StreamResumeParser.cpp
@@ -21,7 +21,7 @@ void StreamResumeParser::handleStartElement(const std::string&, const std::strin
boost::optional<std::string> handledStanzasCount = attributes.getAttributeValue("h");
if (handledStanzasCount) {
try {
- getElementGeneric()->setHandledStanzasCount(boost::lexical_cast<int>(*handledStanzasCount));
+ getElementGeneric()->setHandledStanzasCount(boost::lexical_cast<unsigned int>(*handledStanzasCount));
}
catch (const boost::bad_lexical_cast &) {
}