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 /SwifTools
parenta03cedb3942e4c7c90e62fe9a73c6d15e38fbb68 (diff)
downloadswift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.zip
swift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.tar.bz2
Added CppCheck script.
Tweaked the sources to satisfy cppcheck.
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/Linkify.cpp2
-rw-r--r--SwifTools/Notifier/GrowlNotifier.cpp2
-rw-r--r--SwifTools/Notifier/SnarlNotifier.h2
-rw-r--r--SwifTools/TabComplete.cpp4
4 files changed, 5 insertions, 5 deletions
diff --git a/SwifTools/Linkify.cpp b/SwifTools/Linkify.cpp
index 15fd9a5..2ca284d 100644
--- a/SwifTools/Linkify.cpp
+++ b/SwifTools/Linkify.cpp
@@ -42,7 +42,7 @@ std::string Linkify::linkify(const std::string& input) {
}
}
}
- if (currentURL.size() > 0) {
+ if (!currentURL.empty()) {
std::string url(&currentURL[0], currentURL.size());
result << "<a href=\"" << url << "\">" << url << "</a>";
}
diff --git a/SwifTools/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp
index c9397f1..d83634d 100644
--- a/SwifTools/Notifier/GrowlNotifier.cpp
+++ b/SwifTools/Notifier/GrowlNotifier.cpp
@@ -18,7 +18,7 @@
namespace {
struct Context {
- Context() {}
+ Context() : callback(0) {}
Context(const boost::function<void()>& callback) : callback(new boost::function<void()>(callback)) {}
boost::function<void()>* callback;
diff --git a/SwifTools/Notifier/SnarlNotifier.h b/SwifTools/Notifier/SnarlNotifier.h
index 065c9ec..c96dfa6 100644
--- a/SwifTools/Notifier/SnarlNotifier.h
+++ b/SwifTools/Notifier/SnarlNotifier.h
@@ -9,7 +9,7 @@
#include <map>
#include <SwifTools/Notifier/Notifier.h>
-#include "SnarlInterface.h"
+#include <SnarlInterface.h>
namespace Swift {
class Win32NotifierWindow;
diff --git a/SwifTools/TabComplete.cpp b/SwifTools/TabComplete.cpp
index 4c295ab..f4ef837 100644
--- a/SwifTools/TabComplete.cpp
+++ b/SwifTools/TabComplete.cpp
@@ -28,7 +28,7 @@ void TabComplete::removeWord(const std::string& word) {
std::string TabComplete::completeWord(const std::string& word) {
if (word == lastCompletion_) {
- if (lastCompletionCandidates_.size() != 0) {
+ if (!lastCompletionCandidates_.empty()) {
size_t match = 0;
for (match = 0; match < lastCompletionCandidates_.size(); match++) {
if (lastCompletionCandidates_[match] == lastCompletion_) {
@@ -47,7 +47,7 @@ std::string TabComplete::completeWord(const std::string& word) {
lastCompletionCandidates_.push_back(candidate);
}
}
- lastCompletion_ = lastCompletionCandidates_.size() > 0 ? lastCompletionCandidates_[0] : word;
+ lastCompletion_ = !lastCompletionCandidates_.empty() ? lastCompletionCandidates_[0] : word;
}
return lastCompletion_;
}