Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added explicit. #6

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions jubatus/mp/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ struct pthread_thread_impl : public pthread_thread {

class pthread_mutex {
public:
pthread_mutex(const pthread_mutexattr_t *attr = NULL)
explicit pthread_mutex(const pthread_mutexattr_t *attr = NULL)
{
pthread_mutex_init(&m_mutex, attr);
}

pthread_mutex(int kind)
explicit pthread_mutex(int kind)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
Expand Down Expand Up @@ -160,7 +160,7 @@ class pthread_recursive_mutex: public pthread_mutex {

class pthread_rwlock {
public:
pthread_rwlock(const pthread_rwlockattr_t *attr = NULL)
explicit pthread_rwlock(const pthread_rwlockattr_t *attr = NULL)
{
pthread_rwlock_init(&m_mutex, attr);
}
Expand Down Expand Up @@ -231,7 +231,7 @@ class pthread_scoped_lock {
public:
pthread_scoped_lock() : m_mutex(NULL) { }

pthread_scoped_lock(pthread_mutex& mutex) : m_mutex(NULL)
explicit pthread_scoped_lock(pthread_mutex& mutex) : m_mutex(NULL)
{
mutex.lock();
m_mutex = &mutex;
Expand Down Expand Up @@ -276,7 +276,7 @@ class pthread_scoped_rdlock {
public:
pthread_scoped_rdlock() : m_mutex(NULL) { }

pthread_scoped_rdlock(pthread_rwlock& mutex) : m_mutex(NULL)
explicit pthread_scoped_rdlock(pthread_rwlock& mutex) : m_mutex(NULL)
{
mutex.rdlock();
m_mutex = &mutex;
Expand Down Expand Up @@ -321,7 +321,7 @@ class pthread_scoped_wrlock {
public:
pthread_scoped_wrlock() : m_mutex(NULL) { }

pthread_scoped_wrlock(pthread_rwlock& mutex) : m_mutex(NULL)
explicit pthread_scoped_wrlock(pthread_rwlock& mutex) : m_mutex(NULL)
{
mutex.wrlock();
m_mutex = &mutex;
Expand Down Expand Up @@ -364,7 +364,7 @@ class pthread_scoped_wrlock {

class pthread_cond {
public:
pthread_cond(const pthread_condattr_t *attr = NULL)
explicit pthread_cond(const pthread_condattr_t *attr = NULL)
{
pthread_cond_init(&m_cond, attr);
}
Expand Down
4 changes: 2 additions & 2 deletions jubatus/mp/shared_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ namespace mp {

class shared_buffer {
public:
shared_buffer(size_t init_size = MP_SHARED_BUFFER_INITIAL_BUFFER_SIZE);
explicit shared_buffer(size_t init_size = MP_SHARED_BUFFER_INITIAL_BUFFER_SIZE);
~shared_buffer();

public:
class ref {
public:
ref();
ref(const ref& o);
explicit ref(const ref& o);
~ref();
void clear();
void swap(ref& x);
Expand Down
6 changes: 3 additions & 3 deletions jubatus/mp/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace mp {

class sigset {
public:
sigset(const sigset_t& set) :
explicit sigset(const sigset_t& set) :
m_set(set) { }

sigset()
Expand Down Expand Up @@ -63,14 +63,14 @@ class sigset {

class scoped_sigprocmask {
public:
scoped_sigprocmask(const sigset& set) : m_set(set)
explicit scoped_sigprocmask(const sigset& set) : m_set(set)
{
if(sigprocmask(SIG_BLOCK, m_set.get(), NULL) < 0) {
throw system_error(errno, "failed to set sigprocmask");
}
}

scoped_sigprocmask(const sigset_t& set) : m_set(set)
explicit scoped_sigprocmask(const sigset_t& set) : m_set(set)
{
if(sigprocmask(SIG_BLOCK, m_set.get(), NULL) < 0) {
throw system_error(errno, "failed to set sigprocmask");
Expand Down
4 changes: 2 additions & 2 deletions jubatus/mp/stream_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace mp {

class stream_buffer {
public:
stream_buffer(size_t initial_buffer_size = MP_STREAM_BUFFER_INITIAL_BUFFER_SIZE);
explicit stream_buffer(size_t initial_buffer_size = MP_STREAM_BUFFER_INITIAL_BUFFER_SIZE);
~stream_buffer();

public:
Expand All @@ -72,7 +72,7 @@ class stream_buffer {
class ref {
public:
ref();
ref(const ref& o);
explicit ref(const ref& o);
~ref();
void clear();
void swap(ref& x);
Expand Down
4 changes: 2 additions & 2 deletions jubatus/mp/tls_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class pthread_scoped_lock_multi {
public:
pthread_scoped_lock_multi() : m_vec(NULL) { }

pthread_scoped_lock_multi(size_t size) :
explicit pthread_scoped_lock_multi(size_t size) :
m_vec(new pthread_scoped_lock[size]) { }

~pthread_scoped_lock_multi() { delete[] m_vec; }
Expand Down Expand Up @@ -162,7 +162,7 @@ class tls_set {

private:
struct element {
element(const T& data) : data(data) { }
explicit element(const T& data) : data(data) { }
~element() { }
T data;
pthread_mutex mutex;
Expand Down
2 changes: 1 addition & 1 deletion mpsrc/wavy_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class out;

class loop_impl {
public:
loop_impl(function<void ()> thread_init_func = function<void ()>());
explicit loop_impl(function<void ()> thread_init_func = function<void ()>());
~loop_impl();

typedef shared_ptr<basic_handler> shared_handler;
Expand Down