From d6744d73957bb23a57a5d2c1f207eb239d1a6d0d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Sep 2018 21:09:11 +0200 Subject: Clean up includes --- raul/Array.hpp | 5 +++-- raul/Exception.hpp | 1 + raul/Maid.hpp | 6 +++--- raul/Path.hpp | 6 +++--- raul/Process.hpp | 4 ++-- raul/RingBuffer.hpp | 13 +++++++------ raul/Semaphore.hpp | 10 +++++----- raul/Socket.hpp | 14 +++++++------- raul/Symbol.hpp | 4 ++-- raul/TimeSlice.hpp | 6 +++--- raul/TimeStamp.hpp | 5 ++--- test/array_test.cpp | 4 ++-- test/maid_test.cpp | 7 +++++-- test/path_test.cpp | 6 ++++-- test/ringbuffer_test.cpp | 8 ++++---- test/sem_test.cpp | 6 ++---- test/socket_test.cpp | 17 +++++++++++------ test/symbol_test.cpp | 6 +++--- test/thread_test.cpp | 4 ++-- test/time_test.cpp | 2 ++ 20 files changed, 73 insertions(+), 61 deletions(-) diff --git a/raul/Array.hpp b/raul/Array.hpp index 1920b4a..5f1d4e6 100644 --- a/raul/Array.hpp +++ b/raul/Array.hpp @@ -17,11 +17,12 @@ #ifndef RAUL_ARRAY_HPP #define RAUL_ARRAY_HPP +#include "raul/Maid.hpp" + #include #include #include - -#include "raul/Maid.hpp" +#include namespace Raul { diff --git a/raul/Exception.hpp b/raul/Exception.hpp index 78e9f08..a1c5dfd 100644 --- a/raul/Exception.hpp +++ b/raul/Exception.hpp @@ -16,6 +16,7 @@ #include #include +#include #ifndef RAUL_EXCEPTION_HPP #define RAUL_EXCEPTION_HPP diff --git a/raul/Maid.hpp b/raul/Maid.hpp index 73cb82a..26845b6 100644 --- a/raul/Maid.hpp +++ b/raul/Maid.hpp @@ -17,12 +17,12 @@ #ifndef RAUL_MAID_HPP #define RAUL_MAID_HPP -#include -#include - #include "raul/Deletable.hpp" #include "raul/Noncopyable.hpp" +#include +#include + namespace Raul { /** Explicit garbage-collector. diff --git a/raul/Path.hpp b/raul/Path.hpp index 2d0c9c7..d5116d2 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -17,12 +17,12 @@ #ifndef RAUL_PATH_HPP #define RAUL_PATH_HPP -#include -#include - #include "raul/Exception.hpp" #include "raul/Symbol.hpp" +#include +#include + namespace Raul { /** A restricted path of Symbols separated by, and beginning with, "/". diff --git a/raul/Process.hpp b/raul/Process.hpp index 61fb501..0b3a819 100644 --- a/raul/Process.hpp +++ b/raul/Process.hpp @@ -17,14 +17,14 @@ #ifndef RAUL_PROCESS_HPP #define RAUL_PROCESS_HPP +#include "raul/Noncopyable.hpp" + #include #include #include #include -#include "raul/Noncopyable.hpp" - namespace Raul { /** A child process. diff --git a/raul/RingBuffer.hpp b/raul/RingBuffer.hpp index 1ec5e4e..d92c16b 100644 --- a/raul/RingBuffer.hpp +++ b/raul/RingBuffer.hpp @@ -17,14 +17,15 @@ #ifndef RAUL_RING_BUFFER_HPP #define RAUL_RING_BUFFER_HPP -#include -#include -#include -#include -#include - #include "raul/Noncopyable.hpp" +#include +#include +#include +#include +#include +#include + namespace Raul { /** diff --git a/raul/Semaphore.hpp b/raul/Semaphore.hpp index ee79ba7..e0fbf18 100644 --- a/raul/Semaphore.hpp +++ b/raul/Semaphore.hpp @@ -17,19 +17,19 @@ #ifndef RAUL_SEMAPHORE_HPP #define RAUL_SEMAPHORE_HPP -#include -#include - #ifdef __APPLE__ # include #elif defined(_WIN32) # include #else -# include +# include +# include # include -# include #endif +#include +#include + namespace Raul { /** diff --git a/raul/Socket.hpp b/raul/Socket.hpp index fed58dd..7da4388 100644 --- a/raul/Socket.hpp +++ b/raul/Socket.hpp @@ -17,21 +17,21 @@ #ifndef RAUL_SOCKET_HPP #define RAUL_SOCKET_HPP -#include -#include +#include "raul/Noncopyable.hpp" -#include #include #include #include -#include -#include -#include #include #include #include -#include "raul/Noncopyable.hpp" +#include +#include +#include +#include +#include +#include namespace Raul { diff --git a/raul/Symbol.hpp b/raul/Symbol.hpp index 1ec775f..1189b7b 100644 --- a/raul/Symbol.hpp +++ b/raul/Symbol.hpp @@ -17,10 +17,10 @@ #ifndef RAUL_SYMBOL_HPP #define RAUL_SYMBOL_HPP -#include - #include "raul/Exception.hpp" +#include + namespace Raul { /** A restricted string which is a valid C identifier and Path component. diff --git a/raul/TimeSlice.hpp b/raul/TimeSlice.hpp index 5cc1dc2..92979b0 100644 --- a/raul/TimeSlice.hpp +++ b/raul/TimeSlice.hpp @@ -17,12 +17,12 @@ #ifndef RAUL_TIME_SLICE_HPP #define RAUL_TIME_SLICE_HPP -#include -#include - #include "raul/Noncopyable.hpp" #include "raul/TimeStamp.hpp" +#include +#include + namespace Raul { /* FIXME: all the conversion here is wrong now */ diff --git a/raul/TimeStamp.hpp b/raul/TimeStamp.hpp index ef0df5d..dbbc163 100644 --- a/raul/TimeStamp.hpp +++ b/raul/TimeStamp.hpp @@ -17,10 +17,9 @@ #ifndef RAUL_TIME_STAMP_HPP #define RAUL_TIME_STAMP_HPP -#include -#include - #include +#include +#include #include #include diff --git a/test/array_test.cpp b/test/array_test.cpp index ea9eb13..a1a4132 100644 --- a/test/array_test.cpp +++ b/test/array_test.cpp @@ -14,10 +14,10 @@ along with Raul. If not, see . */ -#include - #include "raul/Array.hpp" +#include + int main(int argc, char** argv) { diff --git a/test/maid_test.cpp b/test/maid_test.cpp index e21ba04..a692c1d 100644 --- a/test/maid_test.cpp +++ b/test/maid_test.cpp @@ -16,13 +16,16 @@ #undef NDEBUG +#include "raul/Maid.hpp" + +#include #include +#include #include +#include #include #include -#include "raul/Maid.hpp" - using Raul::Maid; static const size_t n_threads = 8; diff --git a/test/path_test.cpp b/test/path_test.cpp index 01f55c0..3b7b61b 100644 --- a/test/path_test.cpp +++ b/test/path_test.cpp @@ -14,10 +14,12 @@ along with Raul. If not, see . */ +#include "raul/Path.hpp" +#include "raul/Symbol.hpp" + #include #include - -#include "raul/Path.hpp" +#include using namespace std; using namespace Raul; diff --git a/test/ringbuffer_test.cpp b/test/ringbuffer_test.cpp index 7fc4042..1c488be 100644 --- a/test/ringbuffer_test.cpp +++ b/test/ringbuffer_test.cpp @@ -14,16 +14,16 @@ along with Raul. If not, see . */ +#include "raul/RingBuffer.hpp" + #include +#include #include -#include #include -#include +#include #include #include -#include "raul/RingBuffer.hpp" - using namespace std; using namespace Raul; diff --git a/test/sem_test.cpp b/test/sem_test.cpp index f44fc5e..8daf82b 100644 --- a/test/sem_test.cpp +++ b/test/sem_test.cpp @@ -16,14 +16,12 @@ #undef NDEBUG +#include "raul/Semaphore.hpp" + #include #include -#include -#include #include -#include "raul/Semaphore.hpp" - static void wait_for_sem(Raul::Semaphore* sem) { diff --git a/test/socket_test.cpp b/test/socket_test.cpp index 8dd4aff..2472c21 100644 --- a/test/socket_test.cpp +++ b/test/socket_test.cpp @@ -14,19 +14,24 @@ along with Raul. If not, see . */ -#include -#include +#include "raul/Socket.hpp" + +#include #include #include -#include "raul/Socket.hpp" - -using namespace std; -using namespace Raul; +#include +#include +#include +#include +#include +#include int main(int argc, char** argv) { + using Socket = Raul::Socket; + std::string unix_uri("unix:///tmp/raul_test_sock"); std::string tcp_uri("tcp://127.0.0.1:12345"); diff --git a/test/symbol_test.cpp b/test/symbol_test.cpp index 5164998..edc8879 100644 --- a/test/symbol_test.cpp +++ b/test/symbol_test.cpp @@ -14,11 +14,11 @@ along with Raul. If not, see . */ -#include +#include "raul/Symbol.hpp" + #include #include - -#include "raul/Path.hpp" +#include using namespace std; using namespace Raul; diff --git a/test/thread_test.cpp b/test/thread_test.cpp index 9012b4c..78c0ad2 100644 --- a/test/thread_test.cpp +++ b/test/thread_test.cpp @@ -14,12 +14,12 @@ along with Raul. If not, see . */ +#include "raul/Semaphore.hpp" + #include #include #include -#include "raul/Semaphore.hpp" - using namespace std; using namespace Raul; diff --git a/test/time_test.cpp b/test/time_test.cpp index 69416cd..c6f3d77 100644 --- a/test/time_test.cpp +++ b/test/time_test.cpp @@ -16,6 +16,8 @@ #include "raul/TimeStamp.hpp" #include "raul/TimeSlice.hpp" + +#include #include using namespace std; -- cgit v1.2.1