diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-08-29 23:19:09 -0700 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2012-08-29 23:48:58 -0700 |
commit | 38833205e4011a8a318b8dc6809621a89ad9f446 (patch) | |
tree | eb1c8c8a4b9b6a9718b87df5cf13832ba0fecf68 /includes | |
parent | 3f1b0920d697afff0f3e938cb7eca0aacfd75a91 (diff) |
Using true C++11 initializers in classes.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/BStream.h | 6 | ||||
-rw-r--r-- | includes/Input.h | 6 | ||||
-rw-r--r-- | includes/Output.h | 6 | ||||
-rw-r--r-- | includes/Printer.h | 4 | ||||
-rw-r--r-- | includes/SimpleMustache.h | 6 | ||||
-rw-r--r-- | includes/Socket.h | 6 | ||||
-rw-r--r-- | includes/TaskMan.h | 6 | ||||
-rw-r--r-- | includes/Threads.h | 6 | ||||
-rw-r--r-- | includes/ZHandle.h | 4 |
9 files changed, 25 insertions, 25 deletions
diff --git a/includes/BStream.h b/includes/BStream.h index 86b0e0f..d412782 100644 --- a/includes/BStream.h +++ b/includes/BStream.h @@ -21,10 +21,10 @@ class BStream : public Handle { private: IO<Handle> m_h; uint8_t * m_buffer; - size_t m_availBytes; - size_t m_cursor; + size_t m_availBytes = 0; + size_t m_cursor = 0; String m_name; - bool m_passThru; + bool m_passThru = false; bool m_detached; bool m_closed; }; diff --git a/includes/Input.h b/includes/Input.h index 9d45baa..e0ad329 100644 --- a/includes/Input.h +++ b/includes/Input.h @@ -16,11 +16,11 @@ class Input : public SeekableHandle { virtual time_t getMTime(); const char * getFName() { return m_fname.to_charp(); } private: - int m_fd; + int m_fd = -1; String m_name; String m_fname; - off_t m_size; - time_t m_mtime; + off_t m_size = -1; + time_t m_mtime = -1; }; }; diff --git a/includes/Output.h b/includes/Output.h index 59d9d67..d771227 100644 --- a/includes/Output.h +++ b/includes/Output.h @@ -16,11 +16,11 @@ class Output : public SeekableHandle { virtual time_t getMTime(); const char * getFName() { return m_fname.to_charp(); } private: - int m_fd; + int m_fd = -1; String m_name; String m_fname; - off_t m_size; - time_t m_mtime; + off_t m_size = -1; + time_t m_mtime = -1; }; }; diff --git a/includes/Printer.h b/includes/Printer.h index b4001f1..e215fc1 100644 --- a/includes/Printer.h +++ b/includes/Printer.h @@ -74,8 +74,8 @@ class Printer { static void setDetailled(bool enable) { getPrinter()->m_detailledLogs = enable; } private: - uint32_t m_verbosity; - bool m_detailledLogs; + uint32_t m_verbosity = M_STATUS | M_WARNING | M_ERROR | M_ENGINE_DEBUG; + bool m_detailledLogs = false; }; }; diff --git a/includes/SimpleMustache.h b/includes/SimpleMustache.h index 2bb0cb1..9d16377 100644 --- a/includes/SimpleMustache.h +++ b/includes/SimpleMustache.h @@ -22,7 +22,7 @@ class SimpleMustache { friend class Context; }; - Context() : m_type(CONTEXTLIST), m_root(true) { } + Context() { } ~Context() { empty(); } Proxy operator[](ssize_t idx) { ensureList(); return Proxy(this, idx); } Context & operator[](const char * str); @@ -55,7 +55,7 @@ class SimpleMustache { BOOLSEC, CONTEXTLIST, LAMBDA, - } m_type; + } m_type = CONTEXTLIST; Context(ContextType type) : m_type(type), m_root(false) { } Context(Context & c) { Failure("You can't copy a Context; use references"); } Context & operator=(Context & c) { Failure("You can't assign a Context; use references"); return *this; } @@ -64,7 +64,7 @@ class SimpleMustache { typedef std::map<String, Context *> SubContext; typedef std::vector<SubContext> ContextList; ContextList m_contextList; - bool m_root; + bool m_root = true; void empty(bool skipFirst = false); void ensureList(bool single = false); diff --git a/includes/Socket.h b/includes/Socket.h index 4a73277..981a385 100644 --- a/includes/Socket.h +++ b/includes/Socket.h @@ -50,9 +50,9 @@ class Socket : public Handle { int m_fd; String m_name; - bool m_connected; - bool m_connecting; - bool m_listening; + bool m_connected = false; + bool m_connecting = false; + bool m_listening = false; sockaddr_in6 m_localAddr, m_remoteAddr; SocketEvent * m_evtR, * m_evtW; }; diff --git a/includes/TaskMan.h b/includes/TaskMan.h index 6a50491..d675d75 100644 --- a/includes/TaskMan.h +++ b/includes/TaskMan.h @@ -53,13 +53,13 @@ class TaskMan { typedef gnu::hash_set<Task *, taskHasher> taskHash_t; taskHash_t m_tasks, m_signaledTasks; Queue<Task> m_pendingAdd; - bool m_stopped; + bool m_stopped = false; struct ev_loop * m_loop; - bool m_allowedToSignal; + bool m_allowedToSignal = false; ev::async m_evt; std::queue<void *> m_stacks; int m_nStacks; - int m_stopCode; + int m_stopCode = 0; }; template<class T> diff --git a/includes/Threads.h b/includes/Threads.h index 46ea365..13527d5 100644 --- a/includes/Threads.h +++ b/includes/Threads.h @@ -98,7 +98,7 @@ class GlobalThread : public Thread, public AtStart, public AtExit { template<class T> class Queue { public: - Queue() : m_front(NULL), m_back(NULL) { pthread_cond_init(&m_cond, NULL); } + Queue() { pthread_cond_init(&m_cond, NULL); } ~Queue() { while (!isEmpty()) pop(); pthread_cond_destroy(&m_cond); } void push(T * t) { ScopeLock sl(m_lock); @@ -142,8 +142,8 @@ class Queue { Cell * m_next, * m_prev; T * m_elem; }; - Cell * volatile m_front; - Cell * volatile m_back; + Cell * volatile m_front = NULL; + Cell * volatile m_back = NULL; pthread_cond_t m_cond; }; diff --git a/includes/ZHandle.h b/includes/ZHandle.h index 048e0cb..e972466 100644 --- a/includes/ZHandle.h +++ b/includes/ZHandle.h @@ -28,9 +28,9 @@ class ZStream : public Handle { void doFlush(bool finish); IO<Handle> m_h; z_stream m_zin, m_zout; - bool m_detached, m_closed, m_eof; + bool m_detached = false, m_closed = false, m_eof = false; String m_name; - uint8_t * m_in; + uint8_t * m_in = NULL; }; }; |