From d4891f187fc3606472f0a63b5807d815f843762b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 3 Sep 2019 00:08:01 -0400 Subject: [PATCH] General: Amend includes where applicable --- include/jbus/Endpoint.hpp | 11 +++++++---- include/jbus/Listener.hpp | 12 ++++++++---- include/jbus/Socket.hpp | 9 +++------ lib/Endpoint.cpp | 6 ++++++ lib/Listener.cpp | 8 ++++++++ lib/Socket.cpp | 14 ++++++++++---- 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/include/jbus/Endpoint.hpp b/include/jbus/Endpoint.hpp index f614a57..0c26606 100644 --- a/include/jbus/Endpoint.hpp +++ b/include/jbus/Endpoint.hpp @@ -1,10 +1,13 @@ #pragma once -#include "Common.hpp" -#include "Socket.hpp" -#include -#include #include +#include +#include +#include +#include + +#include "jbus/Common.hpp" +#include "jbus/Socket.hpp" namespace jbus { diff --git a/include/jbus/Listener.hpp b/include/jbus/Listener.hpp index 74efba1..bf62b3a 100644 --- a/include/jbus/Listener.hpp +++ b/include/jbus/Listener.hpp @@ -1,12 +1,15 @@ #pragma once -#include "Common.hpp" -#include "Socket.hpp" -#include -#include +#include +#include #include +#include +#include + +#include "jbus/Socket.hpp" namespace jbus { +class Endpoint; /** Server interface for accepting incoming connections from GBA emulator instances. */ class Listener { @@ -33,6 +36,7 @@ public: * @return Endpoint instance, ready to issue commands. */ std::unique_ptr accept(); + Listener(); ~Listener(); }; diff --git a/include/jbus/Socket.hpp b/include/jbus/Socket.hpp index bf789aa..4371cc8 100644 --- a/include/jbus/Socket.hpp +++ b/include/jbus/Socket.hpp @@ -1,17 +1,14 @@ #pragma once -#include -#include +#include +#include #include -#include #ifdef _WIN32 #include -typedef UINT_PTR SOCKET; +using SOCKET = UINT_PTR; #endif -#include "Common.hpp" - struct sockaddr_in; namespace jbus::net { diff --git a/lib/Endpoint.cpp b/lib/Endpoint.cpp index 3b2bbde..ad431fe 100644 --- a/lib/Endpoint.cpp +++ b/lib/Endpoint.cpp @@ -1,7 +1,13 @@ #include "jbus/Endpoint.hpp" +#include + #define LOG_TRANSFER 0 +#if LOG_TRANSFER +#include +#endif + namespace jbus { #define ROUND_UP_8(val) (((val) + 7) & ~7) diff --git a/lib/Listener.cpp b/lib/Listener.cpp index d2c9562..24be0a4 100644 --- a/lib/Listener.cpp +++ b/lib/Listener.cpp @@ -1,8 +1,14 @@ #include "jbus/Listener.hpp" + +#include "jbus/Common.hpp" #include "jbus/Endpoint.hpp" #define LOG_LISTENER 0 +#if LOG_LISTENER +#include +#endif + namespace jbus { void Listener::listenerProc() { @@ -94,6 +100,8 @@ std::unique_ptr Listener::accept() { return {}; } +Listener::Listener() = default; + Listener::~Listener() { stop(); } } // namespace jbus diff --git a/lib/Socket.cpp b/lib/Socket.cpp index cf64cb3..70263dc 100644 --- a/lib/Socket.cpp +++ b/lib/Socket.cpp @@ -1,13 +1,19 @@ #include "jbus/Socket.hpp" +#include +#include + #ifndef _WIN32 -#include +#include + +#include +#include +#include #include #include -#include -#include +#include +#include #include -#include #else #include #include