summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-13 15:33:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-13 16:57:09 (GMT)
commit790134ceb34ab6047fe204517d263f343dbeb920 (patch)
treed8002133de67108f380248a0ec7d063c8f1956b7 /Swiften/Elements
parenta03cedb3942e4c7c90e62fe9a73c6d15e38fbb68 (diff)
downloadswift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.zip
swift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.tar.bz2
Added CppCheck script.
Tweaked the sources to satisfy cppcheck.
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/Last.h3
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.cpp2
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.h2
-rw-r--r--Swiften/Elements/VCard.cpp2
4 files changed, 4 insertions, 5 deletions
diff --git a/Swiften/Elements/Last.h b/Swiften/Elements/Last.h
index ba302e3..fe0323a 100644
--- a/Swiften/Elements/Last.h
+++ b/Swiften/Elements/Last.h
@@ -11,8 +11,7 @@
namespace Swift {
class Last : public Payload {
public:
- Last() {};
- Last(int seconds) : seconds_(seconds) {};
+ Last(int seconds = 0) : seconds_(seconds) {};
int getSeconds() const {return seconds_;}
void setSeconds(int seconds) {seconds_ = seconds;}
diff --git a/Swiften/Elements/RosterItemExchangePayload.cpp b/Swiften/Elements/RosterItemExchangePayload.cpp
index a425551..abd5296 100644
--- a/Swiften/Elements/RosterItemExchangePayload.cpp
+++ b/Swiften/Elements/RosterItemExchangePayload.cpp
@@ -9,7 +9,7 @@
namespace Swift {
-RosterItemExchangePayload::Item::Item() {
+RosterItemExchangePayload::Item::Item(Action action) : action(action) {
}
RosterItemExchangePayload::RosterItemExchangePayload() {
diff --git a/Swiften/Elements/RosterItemExchangePayload.h b/Swiften/Elements/RosterItemExchangePayload.h
index cbe9ffa..c39c084 100644
--- a/Swiften/Elements/RosterItemExchangePayload.h
+++ b/Swiften/Elements/RosterItemExchangePayload.h
@@ -23,7 +23,7 @@ namespace Swift {
public:
enum Action { Add, Modify, Delete };
- Item();
+ Item(Action action = Add);
Action getAction() const {
return action;
diff --git a/Swiften/Elements/VCard.cpp b/Swiften/Elements/VCard.cpp
index 4f7700e..8bf3eb9 100644
--- a/Swiften/Elements/VCard.cpp
+++ b/Swiften/Elements/VCard.cpp
@@ -16,7 +16,7 @@ VCard::EMailAddress VCard::getPreferredEMailAddress() const {
return address;
}
}
- if (emailAddresses_.size() > 0) {
+ if (!emailAddresses_.empty()) {
return emailAddresses_[0];
}
return EMailAddress();