summaryrefslogtreecommitdiffstats
path: root/raul
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-09-30 08:23:42 +0000
committerDavid Robillard <d@drobilla.net>2010-09-30 08:23:42 +0000
commit692b624398a3b9fbb560f47e13b588a92479a68d (patch)
tree4c41883cfa2cb9e2916cd9c0248a4d7787b39183 /raul
parent9adc660a3144b47ed9a49ea57298631b1c19231a (diff)
downloadraul-692b624398a3b9fbb560f47e13b588a92479a68d.tar.gz
raul-692b624398a3b9fbb560f47e13b588a92479a68d.tar.bz2
raul-692b624398a3b9fbb560f47e13b588a92479a68d.zip
Declare single-argument constructors explicit (except where implicit conversion is actually desired).
See http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2619 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul')
-rw-r--r--raul/Array.hpp2
-rw-r--r--raul/ArrayStack.hpp2
-rw-r--r--raul/Configuration.hpp2
-rw-r--r--raul/EventRingBuffer.hpp2
-rw-r--r--raul/List.hpp8
-rw-r--r--raul/Maid.hpp2
-rw-r--r--raul/RingBuffer.hpp2
-rw-r--r--raul/SMFReader.hpp2
-rw-r--r--raul/SMFWriter.hpp2
-rw-r--r--raul/SRMWQueue.hpp2
-rw-r--r--raul/SRSWQueue.hpp2
-rw-r--r--raul/Thread.hpp2
12 files changed, 15 insertions, 15 deletions
diff --git a/raul/Array.hpp b/raul/Array.hpp
index 2cf22bf..0075c34 100644
--- a/raul/Array.hpp
+++ b/raul/Array.hpp
@@ -36,7 +36,7 @@ template <class T>
class Array : public Deletable
{
public:
- Array(size_t size = 0) : _size(size), _elems(NULL) {
+ explicit Array(size_t size = 0) : _size(size), _elems(NULL) {
if (size > 0)
_elems = new T[size];
}
diff --git a/raul/ArrayStack.hpp b/raul/ArrayStack.hpp
index e4aa33c..2204b69 100644
--- a/raul/ArrayStack.hpp
+++ b/raul/ArrayStack.hpp
@@ -33,7 +33,7 @@ template <class T>
class ArrayStack : public Array<T>
{
public:
- ArrayStack(size_t size = 0) : Array<T>(size), _top(0) {}
+ explicit ArrayStack(size_t size = 0) : Array<T>(size), _top(0) {}
ArrayStack(size_t size, T initial_value) : Array<T>(size, initial_value), _top(0) {}
diff --git a/raul/Configuration.hpp b/raul/Configuration.hpp
index 7780b85..e26de9d 100644
--- a/raul/Configuration.hpp
+++ b/raul/Configuration.hpp
@@ -49,7 +49,7 @@ public:
void print_usage(const std::string& program, std::ostream& os);
struct CommandLineError : public std::exception {
- CommandLineError(const std::string& m) : msg(m) {}
+ explicit CommandLineError(const std::string& m) : msg(m) {}
~CommandLineError() throw() {}
const char* what() const throw() { return msg.c_str(); }
std::string msg;
diff --git a/raul/EventRingBuffer.hpp b/raul/EventRingBuffer.hpp
index 5e37395..418d2af 100644
--- a/raul/EventRingBuffer.hpp
+++ b/raul/EventRingBuffer.hpp
@@ -36,7 +36,7 @@ public:
/** @param capacity Ringbuffer capacity in bytes.
*/
- EventRingBuffer(size_t capacity)
+ explicit EventRingBuffer(size_t capacity)
: RingBuffer<uint8_t>(capacity)
{}
diff --git a/raul/List.hpp b/raul/List.hpp
index 5b55aec..199756f 100644
--- a/raul/List.hpp
+++ b/raul/List.hpp
@@ -47,11 +47,11 @@ public:
*/
class Node : public Raul::Deletable {
public:
- Node(T elem) : _elem(elem) {}
+ explicit Node(T elem) : _elem(elem) {}
virtual ~Node() {}
template <typename Y>
- Node(const typename List<Y>::Node& copy)
+ explicit Node(const typename List<Y>::Node& copy)
: _elem(copy._elem), _prev(copy._prev), _next(copy._next)
{}
@@ -100,7 +100,7 @@ public:
/** Realtime safe const iterator for a List. */
class const_iterator {
public:
- const_iterator(const List<T>* const list);
+ explicit const_iterator(const List<T>* const list);
const_iterator(const iterator& i)
: _list(i._list), _listnode(i._listnode) {}
@@ -126,7 +126,7 @@ public:
/** Realtime safe iterator for a List. */
class iterator {
public:
- iterator(List<T>* const list);
+ explicit iterator(List<T>* const list);
inline T& operator*();
inline T* operator->();
diff --git a/raul/Maid.hpp b/raul/Maid.hpp
index 57b2f73..b1ebcbe 100644
--- a/raul/Maid.hpp
+++ b/raul/Maid.hpp
@@ -46,7 +46,7 @@ namespace Raul {
class Maid : boost::noncopyable
{
public:
- Maid(size_t size);
+ explicit Maid(size_t size);
~Maid();
/** Push a raw pointer to be deleted when cleanup() is called next.
diff --git a/raul/RingBuffer.hpp b/raul/RingBuffer.hpp
index 2972258..31ab222 100644
--- a/raul/RingBuffer.hpp
+++ b/raul/RingBuffer.hpp
@@ -37,7 +37,7 @@ class RingBuffer {
public:
/** @param size Size in bytes.
*/
- RingBuffer(size_t size)
+ explicit RingBuffer(size_t size)
: _size(size)
, _buf(static_cast<char*>(malloc(size)))
{
diff --git a/raul/SMFReader.hpp b/raul/SMFReader.hpp
index a96c6aa..1e1b5e8 100644
--- a/raul/SMFReader.hpp
+++ b/raul/SMFReader.hpp
@@ -42,7 +42,7 @@ public:
const char* what() const throw() { return "Unsupported time stamp type (SMPTE)"; }
};
- SMFReader(const std::string filename="");
+ explicit SMFReader(const std::string filename="");
~SMFReader();
bool open(const std::string& filename) throw (std::logic_error, UnsupportedTime);
diff --git a/raul/SMFWriter.hpp b/raul/SMFWriter.hpp
index 5c0ffef..4643624 100644
--- a/raul/SMFWriter.hpp
+++ b/raul/SMFWriter.hpp
@@ -29,7 +29,7 @@ namespace Raul {
*/
class SMFWriter : public Raul::MIDISink {
public:
- SMFWriter(TimeUnit unit);
+ explicit SMFWriter(TimeUnit unit);
~SMFWriter();
bool start(const std::string& filename,
diff --git a/raul/SRMWQueue.hpp b/raul/SRMWQueue.hpp
index 18b2461..7257ec3 100644
--- a/raul/SRMWQueue.hpp
+++ b/raul/SRMWQueue.hpp
@@ -52,7 +52,7 @@ template <typename T>
class SRMWQueue : boost::noncopyable
{
public:
- SRMWQueue(size_t size);
+ explicit SRMWQueue(size_t size);
~SRMWQueue();
diff --git a/raul/SRSWQueue.hpp b/raul/SRSWQueue.hpp
index b85cc15..e089f07 100644
--- a/raul/SRSWQueue.hpp
+++ b/raul/SRSWQueue.hpp
@@ -42,7 +42,7 @@ class SRSWQueue : boost::noncopyable
{
public:
/** @param size Size in number of elements */
- SRSWQueue(size_t size);
+ explicit SRSWQueue(size_t size);
~SRSWQueue();
// Any thread:
diff --git a/raul/Thread.hpp b/raul/Thread.hpp
index 3c624a7..757b791 100644
--- a/raul/Thread.hpp
+++ b/raul/Thread.hpp
@@ -64,7 +64,7 @@ public:
void set_context(unsigned context) { _contexts.insert(context); }
protected:
- Thread(const std::string& name="");
+ explicit Thread(const std::string& name="");
Thread(pthread_t thread, const std::string& name="");
/** Thread function to execute.