diff options
author | David Robillard <d@drobilla.net> | 2012-05-13 19:21:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-13 19:21:44 +0000 |
commit | ae250db884dba00df5cca72599b44333cb11e8ac (patch) | |
tree | 36080ce6891c832a9d2cad72ef7391e2f32ea7c5 | |
parent | ea09cab085bcdf91f8e47195a9997a36a305c471 (diff) | |
download | raul-ae250db884dba00df5cca72599b44333cb11e8ac.tar.gz raul-ae250db884dba00df5cca72599b44333cb11e8ac.tar.bz2 raul-ae250db884dba00df5cca72599b44333cb11e8ac.zip |
Lint.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4388 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | raul/List.hpp | 2 | ||||
-rw-r--r-- | raul/Path.hpp | 2 | ||||
-rw-r--r-- | raul/URI.hpp | 10 | ||||
-rw-r--r-- | raul/log.hpp | 5 | ||||
-rw-r--r-- | test/queue_test.cpp | 6 | ||||
-rw-r--r-- | test/sem_test.cpp | 2 | ||||
-rw-r--r-- | wscript | 4 |
7 files changed, 20 insertions, 11 deletions
diff --git a/raul/List.hpp b/raul/List.hpp index 62f3f1c..3e1d49e 100644 --- a/raul/List.hpp +++ b/raul/List.hpp @@ -105,7 +105,7 @@ public: , _listnode(NULL) {} - const_iterator(const iterator& i) + explicit const_iterator(const iterator& i) : _list(i._list) , _listnode(i._listnode) {} diff --git a/raul/Path.hpp b/raul/Path.hpp index dd53ee5..960a8e1 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -45,7 +45,7 @@ class Path : public URI { public: class BadPath : public std::exception { public: - BadPath(const std::string& path) : _path(path) {} + explicit BadPath(const std::string& path) : _path(path) {} ~BadPath() throw() {} const char* what() const throw() { return _path.c_str(); } private: diff --git a/raul/URI.hpp b/raul/URI.hpp index 6a6b532..1a1c9e6 100644 --- a/raul/URI.hpp +++ b/raul/URI.hpp @@ -36,7 +36,7 @@ class URI { public: class BadURI : public std::exception { public: - BadURI(const std::string& uri) : _uri(uri) {} + explicit BadURI(const std::string& uri) : _uri(uri) {} ~BadURI() throw() {} const char* what() const throw() { return _uri.c_str(); } private: @@ -48,7 +48,9 @@ public: * It is a fatal error to construct a URI from an invalid string, * use is_valid first to check. */ - URI(const std::basic_string<char>& uri="nil:0") : _str(g_intern_string(uri.c_str())) { + URI(const std::basic_string<char>& uri="nil:0") + : _str(g_intern_string(uri.c_str())) + { if (!is_valid(uri)) throw BadURI(uri); } @@ -58,7 +60,9 @@ public: * It is a fatal error to construct a URI from an invalid string, * use is_valid first to check. */ - URI(const char* uri) : _str(g_intern_string(uri)) { + URI(const char* uri) + : _str(g_intern_string(uri)) + { if (!is_valid(uri)) throw BadURI(uri); } diff --git a/raul/log.hpp b/raul/log.hpp index 4dbf069..dbbe345 100644 --- a/raul/log.hpp +++ b/raul/log.hpp @@ -90,9 +90,10 @@ protected: class Log : public std::ostream { public: - Log(std::streambuf* buf) : std::ostream(buf) {} + explicit Log(std::streambuf* buf) : std::ostream(buf) {} template<typename T> Log& operator()(const T& o) { - *this << o; return *this; + *this << o; + return *this; } }; diff --git a/test/queue_test.cpp b/test/queue_test.cpp index 0d1a95b..42e314e 100644 --- a/test/queue_test.cpp +++ b/test/queue_test.cpp @@ -95,10 +95,10 @@ dump_data() int main() { - unsigned long total_processed = 0; + size_t total_processed = 0; cout << "Testing size" << endl; - for (unsigned i=0; i < queue.capacity(); ++i) { + for (size_t i=0; i < queue.capacity(); ++i) { queue.push(i); if (i == queue.capacity()-1) { if (!queue.full()) { @@ -115,7 +115,7 @@ main() } } - for (unsigned i = 0; i < queue.capacity(); ++i) + for (size_t i = 0; i < queue.capacity(); ++i) queue.pop(); if (!queue.empty()) { diff --git a/test/sem_test.cpp b/test/sem_test.cpp index b3e8b5b..dda6ca2 100644 --- a/test/sem_test.cpp +++ b/test/sem_test.cpp @@ -39,7 +39,7 @@ main() waiter.start(); sleep(1); - + cout << "[Main] Signalling..." << endl; sem.post(); @@ -1,5 +1,6 @@ #!/usr/bin/env python import os +import subprocess from waflib.extras import autowaf as autowaf import waflib.Options as Options @@ -189,3 +190,6 @@ def test(ctx): autowaf.pre_test(ctx, APPNAME) autowaf.run_tests(ctx, APPNAME, tests.split(), dirs=['./src','./test']) autowaf.post_test(ctx, APPNAME) + +def lint(ctx): + subprocess.call('cpplint.py --filter=-whitespace/comments,-whitespace/tab,-whitespace/braces,-whitespace/labels,-build/header_guard,-readability/casting,-readability/todo,-build/namespaces,-whitespace/line_length,-runtime/rtti,-runtime/references,-whitespace/blank_line,-runtime/sizeof,-readability/streams,-whitespace/operators,-whitespace/parens,-build/include,-whitespace/comma,-whitespace/newline `find -name *.cpp -or -name *.hpp`', shell=True) |