summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-01-06 14:56:17 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-01-13 10:06:37 (GMT)
commit188fc285c6555eadd3c9d50ab8a94adcade78d89 (patch)
treef02f5e249f8b511300d55a826d3b727f9d8d844f /Swiften/Elements
parentd5cab0388f6a40db6156a993e5f00acf9e63b577 (diff)
downloadswift-contrib-188fc285c6555eadd3c9d50ab8a94adcade78d89.zip
swift-contrib-188fc285c6555eadd3c9d50ab8a94adcade78d89.tar.bz2
Fix more warnings.
Fix sign conversion warnings. Removing heavy unnecessary includes. Change-Id: I992f43065498823098a875badb020c7c84fc4797
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/JingleIBBTransportPayload.h8
-rw-r--r--Swiften/Elements/JinglePayload.h2
-rw-r--r--Swiften/Elements/StanzaAck.cpp19
-rw-r--r--Swiften/Elements/StanzaAck.h11
-rw-r--r--Swiften/Elements/StreamInitiationFileInfo.h16
5 files changed, 36 insertions, 20 deletions
diff --git a/Swiften/Elements/JingleIBBTransportPayload.h b/Swiften/Elements/JingleIBBTransportPayload.h
index 8c174f0..7633f6b 100644
--- a/Swiften/Elements/JingleIBBTransportPayload.h
+++ b/Swiften/Elements/JingleIBBTransportPayload.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Remko Tronçon
+ * Copyright (c) 2011-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -29,16 +29,16 @@ namespace Swift {
return stanzaType;
}
- int getBlockSize() const {
+ unsigned int getBlockSize() const {
return blockSize;
}
- void setBlockSize(int blockSize) {
+ void setBlockSize(unsigned int blockSize) {
this->blockSize = blockSize;
}
private:
- int blockSize;
+ unsigned int blockSize;
StanzaType stanzaType;
};
}
diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h
index 31d4448..5f12e90 100644
--- a/Swiften/Elements/JinglePayload.h
+++ b/Swiften/Elements/JinglePayload.h
@@ -15,8 +15,6 @@
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/JingleContentPayload.h>
-#include <Swiften/Base/Log.h>
-
namespace Swift {
class JinglePayload : public Payload {
public:
diff --git a/Swiften/Elements/StanzaAck.cpp b/Swiften/Elements/StanzaAck.cpp
new file mode 100644
index 0000000..5bcab73
--- /dev/null
+++ b/Swiften/Elements/StanzaAck.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2013 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <Swiften/Elements/StanzaAck.h>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+using namespace Swift;
+
+StanzaAck::~StanzaAck() {
+}
+
+void StanzaAck::setHandledStanzasCount(int i) {
+ handledStanzasCount = boost::numeric_cast<unsigned int>(i);
+ valid = true;
+}
diff --git a/Swiften/Elements/StanzaAck.h b/Swiften/Elements/StanzaAck.h
index 3aa2dfd..8fe64e0 100644
--- a/Swiften/Elements/StanzaAck.h
+++ b/Swiften/Elements/StanzaAck.h
@@ -1,13 +1,14 @@
/*
- * Copyright (c) 2010 Remko Tronçon
+ * Copyright (c) 2010-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <boost/shared_ptr.hpp>
+#include <Swiften/Elements/Element.h>
namespace Swift {
class StanzaAck : public Element {
@@ -16,15 +17,13 @@ namespace Swift {
StanzaAck() : valid(false), handledStanzasCount(0) {}
StanzaAck(unsigned int handledStanzasCount) : valid(true), handledStanzasCount(handledStanzasCount) {}
+ virtual ~StanzaAck();
unsigned int getHandledStanzasCount() const {
return handledStanzasCount;
}
- void setHandledStanzasCount(int i) {
- handledStanzasCount = i;
- valid = true;
- }
+ void setHandledStanzasCount(int i);
bool isValid() const {
return valid;
diff --git a/Swiften/Elements/StreamInitiationFileInfo.h b/Swiften/Elements/StreamInitiationFileInfo.h
index 4265a19..d7907b9 100644
--- a/Swiften/Elements/StreamInitiationFileInfo.h
+++ b/Swiften/Elements/StreamInitiationFileInfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Remko Tronçon
+ * Copyright (c) 2011-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -19,7 +19,7 @@ public:
typedef boost::shared_ptr<StreamInitiationFileInfo> ref;
public:
- StreamInitiationFileInfo(const std::string& name = "", const std::string& description = "", int size = 0,
+ StreamInitiationFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0,
const std::string& hash = "", const boost::posix_time::ptime &date = boost::posix_time::ptime(), const std::string& algo="md5") :
name(name), description(description), size(size), hash(hash), date(date), algo(algo), supportsRangeRequests(false), rangeOffset(0) {}
@@ -39,11 +39,11 @@ public:
return this->description;
}
- void setSize(const boost::uintmax_t size) {
+ void setSize(const unsigned long long size) {
this->size = size;
}
- boost::uintmax_t getSize() const {
+ unsigned long long getSize() const {
return this->size;
}
@@ -79,24 +79,24 @@ public:
return supportsRangeRequests;
}
- void setRangeOffset(boost::uintmax_t offset) {
+ void setRangeOffset(unsigned long long offset) {
supportsRangeRequests = true;
rangeOffset = offset;
}
- boost::uintmax_t getRangeOffset() const {
+ unsigned long long getRangeOffset() const {
return rangeOffset;
}
private:
std::string name;
std::string description;
- boost::uintmax_t size;
+ unsigned long long size;
std::string hash;
boost::posix_time::ptime date;
std::string algo;
bool supportsRangeRequests;
- boost::uintmax_t rangeOffset;
+ unsigned long long rangeOffset;
};
}