From 9b5da6b16fb7dacada67db377beaa46a61fe0c22 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Jan 2013 17:55:50 +0000 Subject: Lint. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4960 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/Action.hpp | 3 +-- src/engine/Problem.hpp | 7 ++++++- src/engine/Slave.hpp | 8 +++++--- src/engine/Stateful.hpp | 7 +++---- src/engine/machina/Controller.hpp | 3 ++- src/engine/machina/Machine.hpp | 2 +- src/engine/machina/types.hpp | 6 +++--- 7 files changed, 21 insertions(+), 15 deletions(-) (limited to 'src/engine') 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; template void NullDeleter(T* ptr) {} -template +template SPtr static_ptr_cast(const SPtr& r) { return std::static_pointer_cast(r); } -template +template SPtr dynamic_ptr_cast(const SPtr& r) { return std::dynamic_pointer_cast(r); } -template +template SPtr const_ptr_cast(const SPtr& r) { return std::const_pointer_cast(r); } -- cgit v1.2.1