diff options
-rw-r--r-- | src/client/ClientObject.hpp | 4 | ||||
-rw-r--r-- | src/engine/Action.hpp | 3 | ||||
-rw-r--r-- | src/engine/Problem.hpp | 7 | ||||
-rw-r--r-- | src/engine/Slave.hpp | 8 | ||||
-rw-r--r-- | src/engine/Stateful.hpp | 7 | ||||
-rw-r--r-- | src/engine/machina/Controller.hpp | 3 | ||||
-rw-r--r-- | src/engine/machina/Machine.hpp | 2 | ||||
-rw-r--r-- | src/engine/machina/types.hpp | 6 | ||||
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 4 | ||||
-rw-r--r-- | src/gui/MachinaGUI.hpp | 2 | ||||
-rw-r--r-- | wscript | 4 |
11 files changed, 30 insertions, 20 deletions
diff --git a/src/client/ClientObject.hpp b/src/client/ClientObject.hpp index 557e23a..4ad2e0e 100644 --- a/src/client/ClientObject.hpp +++ b/src/client/ClientObject.hpp @@ -31,7 +31,7 @@ namespace client { class ClientObject { public: - ClientObject(uint64_t id); + explicit ClientObject(uint64_t id); ClientObject(const ClientObject& copy, uint64_t id); inline uint64_t id() const { return _id; } @@ -63,7 +63,7 @@ private: /** Stub client object to use as a search key. */ struct ClientObjectKey : public ClientObject { - ClientObjectKey(uint64_t id) : ClientObject(id) {} + explicit ClientObjectKey(uint64_t id) : ClientObject(id) {} }; } diff --git a/src/engine/Action.hpp b/src/engine/Action.hpp index 1dc13fc..0201380 100644 --- a/src/engine/Action.hpp +++ b/src/engine/Action.hpp @@ -43,8 +43,7 @@ struct Action class PrintAction : public Action { public: - PrintAction(const std::string& msg) - : _msg(msg) {} + explicit PrintAction(const std::string& msg) : _msg(msg) {} void execute(MIDISink* sink, Raul::TimeStamp time) { std::cout << "t=" << time << ": " << _msg << std::endl; } diff --git a/src/engine/Problem.hpp b/src/engine/Problem.hpp index 6e5c69b..ced3675 100644 --- a/src/engine/Problem.hpp +++ b/src/engine/Problem.hpp @@ -84,7 +84,12 @@ private: };*/ struct Evaluator : public Raul::MIDISink { - Evaluator(const Problem& problem) : _problem(problem), _order(4), _n_notes(0), _first_note(0) { + explicit Evaluator(const Problem& problem) + : _problem(problem) + , _order(4) + , _n_notes(0) + , _first_note(0) + { for (uint8_t i=0; i < 128; ++i) _counts[i] = 0; } diff --git a/src/engine/Slave.hpp b/src/engine/Slave.hpp index e08fb71..55701a7 100644 --- a/src/engine/Slave.hpp +++ b/src/engine/Slave.hpp @@ -27,12 +27,14 @@ namespace machina { * Use this to perform some task in a separate thread you want to 'drive' * from a realtime (or otherwise) thread. */ -class Slave - : public Raul::Thread +class Slave : public Raul::Thread { public: Slave() : _whip(0) {} - ~Slave() { _exit_flag = true; _whip.post(); } + ~Slave() { + _exit_flag = true; + _whip.post(); + } virtual void join() { _exit_flag = true; diff --git a/src/engine/Stateful.hpp b/src/engine/Stateful.hpp index 4294221..6657aff 100644 --- a/src/engine/Stateful.hpp +++ b/src/engine/Stateful.hpp @@ -47,7 +47,7 @@ public: static uint64_t next_id() { return _next_id++; } protected: - Stateful(uint64_t id) : _id(id) {} + explicit Stateful(uint64_t id) : _id(id) {} private: static uint64_t _next_id; @@ -56,11 +56,10 @@ private: mutable Sord::Node _rdf_id; }; -class StatefulKey - : public Stateful +class StatefulKey : public Stateful { public: - StatefulKey(uint64_t id) : Stateful(id) {} + explicit StatefulKey(uint64_t id) : Stateful(id) {} void write_state(Sord::Model& model) {} }; diff --git a/src/engine/machina/Controller.hpp b/src/engine/machina/Controller.hpp index 56ac93b..7738f22 100644 --- a/src/engine/machina/Controller.hpp +++ b/src/engine/machina/Controller.hpp @@ -40,7 +40,8 @@ class Machine; class Stateful; namespace client { -class ClientModel; class ClientObject; +class ClientModel; +class ClientObject; } class Controller diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp index a068f02..a4d0262 100644 --- a/src/engine/machina/Machine.hpp +++ b/src/engine/machina/Machine.hpp @@ -41,7 +41,7 @@ class Machine : public Stateful { public: - Machine(TimeUnit unit); + explicit Machine(TimeUnit unit); /** Copy a Machine. * diff --git a/src/engine/machina/types.hpp b/src/engine/machina/types.hpp index 632e138..38cd29c 100644 --- a/src/engine/machina/types.hpp +++ b/src/engine/machina/types.hpp @@ -36,17 +36,17 @@ using WPtr = std::weak_ptr<T>; template <class T> void NullDeleter(T* ptr) {} -template<class T, class U> +template<class T, class U> SPtr<T> static_ptr_cast(const SPtr<U>& r) { return std::static_pointer_cast<T>(r); } -template<class T, class U> +template<class T, class U> SPtr<T> dynamic_ptr_cast(const SPtr<U>& r) { return std::dynamic_pointer_cast<T>(r); } -template<class T, class U> +template<class T, class U> SPtr<T> const_ptr_cast(const SPtr<U>& r) { return std::const_pointer_cast<T>(r); } diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index d4b57a1..1a95b1c 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -85,8 +85,8 @@ MachinaCanvas::node_clicked(NodeView* node, GdkEventButton* event) bool MachinaCanvas::on_event(GdkEvent* event) { - if (( event->type == GDK_BUTTON_RELEASE) - && ( event->button.button == 3) + if (event->type == GDK_BUTTON_RELEASE + && event->button.button == 3 && !(event->button.state & (GDK_CONTROL_MASK))) { action_create_node(event->button.x, event->button.y); diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index c5326d9..d71c556 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -47,7 +47,7 @@ class MachinaCanvas; class MachinaGUI { public: - MachinaGUI(SPtr<machina::Engine> engine); + explicit MachinaGUI(SPtr<machina::Engine> engine); ~MachinaGUI(); SPtr<MachinaCanvas> canvas() { return _canvas; } @@ -1,5 +1,6 @@ #!/usr/bin/env python import os +import subprocess from waflib.extras import autowaf as autowaf @@ -72,3 +73,6 @@ def build(bld): if bld.is_defined('MACHINA_BUILD_GUI'): bld.recurse('src/gui') + +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,-build/storage_class `find -name *.cpp -or -name *.hpp`', shell=True) |