diff --git a/libraries/osyncstream.h b/libraries/osyncstream.h index e7c5454..4547742 100755 --- a/libraries/osyncstream.h +++ b/libraries/osyncstream.h @@ -60,5 +60,5 @@ struct streams inline std::ostream& streams::cout = std::cout; inline std::ostream& streams::cerr = std::cerr; -inline osyncstream sscout(streams::cout); -inline osyncstream sscerr(streams::cerr); \ No newline at end of file +[[maybe_unused]] inline osyncstream sscout(streams::cout); // NOLINT(cert-err58-cpp) +[[maybe_unused]] inline osyncstream sscerr(streams::cerr); // NOLINT(cert-err58-cpp) \ No newline at end of file diff --git a/libraries/user_input.h b/libraries/user_input.h index a4c7b1c..25ebc7e 100755 --- a/libraries/user_input.h +++ b/libraries/user_input.h @@ -10,13 +10,13 @@ constexpr auto all = std::numeric_limits::max(); namespace math { - template::value, bool> = true> + template [[maybe_unused]] constexpr auto is_between(typeof(lb) x) -> bool { return (ub > x) && (x > lb); } - template::value, bool> = true> + template [[maybe_unused]] constexpr auto is_larger(typeof(lb) x) -> bool { return (x > lb); } - template::value, bool> = true> + template [[maybe_unused]] constexpr auto is_smaller(typeof(ub) x) -> bool { return (ub > x); } - template::value, bool> = true> + template [[maybe_unused]] auto numerical_suffix(T value) -> std::string { std::string suffixes[4] = {"th", "st", "nd", "rd"}; @@ -30,7 +30,7 @@ namespace math } } -template +template [[maybe_unused]] T get_input(const std::string& prompt, const std::string& on_error, std::function validator) noexcept { T user_input{}; @@ -54,5 +54,5 @@ T get_input(const std::string& prompt, const std::string& on_error, std::functio catch (std::exception&) { return user_input; } /* This should not happen ..... cin/cout are not configured to throw...*/ } struct always_true_validator { template bool operator()(T) const { return true; }}; -template +template [[maybe_unused]] T get_input(const std::string& prompt) { return get_input(prompt, "", always_true_validator()); } \ No newline at end of file diff --git a/main.cpp b/main.cpp index 6050eef..805b554 100644 --- a/main.cpp +++ b/main.cpp @@ -1,14 +1,11 @@ -#if WIN32 -#define NOMINMAX -#endif #include "modernize/sockets.h" #include "libraries/user_input.h" #include "libraries/osyncstream.h" #include "libraries/terminal.h" #include "libraries/json.hpp" -#include #include "project/server.h" #include "project/client.h" +#include #include #include diff --git a/modernize/sockets.h b/modernize/sockets.h index fd52999..02eba5f 100755 --- a/modernize/sockets.h +++ b/modernize/sockets.h @@ -40,7 +40,7 @@ public: hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; hints.ai_flags = AI_PASSIVE; - ::getaddrinfo(address.c_str(), port.c_str(), &hints, &result); + ::getaddrinfo(address.c_str(), port.c_str(), &hints, &result); // NOLINT(bugprone-unused-return-value) return addrinfo_up(result); } static auto listen(const SOCKET socket) noexcept -> int { return ::listen(socket, SOMAXCONN); } @@ -52,7 +52,7 @@ public: /* extern functions */ static void prologue() noexcept; static void epilogue() noexcept; - static auto closesocket(const SOCKET socket) noexcept -> unsigned; + static auto closesocket(SOCKET socket) noexcept -> unsigned; static auto recv(SOCKET socket) noexcept -> std::string; static auto system(const std::string& command) noexcept -> std::string; diff --git a/os/linux.h b/os/linux.h index 058ecf2..3db207b 100755 --- a/os/linux.h +++ b/os/linux.h @@ -3,6 +3,5 @@ #include #include #include -#define SOCKET_ERROR -1 #define INVALID_SOCKET 0 typedef int SOCKET; \ No newline at end of file