From 30796e6219a6d04070601633f5f00ec6a4f1c657 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Wed, 5 Jun 2019 17:30:45 +0300
Subject: [PATCH] Correct warning fixes

---
 components/net/cpp/include/ftl/net/ws_internal.hpp | 4 +++-
 components/net/cpp/src/ws_internal.cpp             | 2 --
 components/net/cpp/test/peer_unit.cpp              | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/components/net/cpp/include/ftl/net/ws_internal.hpp b/components/net/cpp/include/ftl/net/ws_internal.hpp
index 5390f1028..ea0471a88 100644
--- a/components/net/cpp/include/ftl/net/ws_internal.hpp
+++ b/components/net/cpp/include/ftl/net/ws_internal.hpp
@@ -6,6 +6,8 @@
 #include <functional>
 #include <ftl/uri.hpp>
 
+#include <ftl/net/common.hpp>
+
 using std::size_t;
 
 namespace ftl {
@@ -44,7 +46,7 @@ int ws_dispatch(const char *data, size_t len, std::function<void(const wsheader_
  */
 int ws_prepare(wsheader_type::opcode_type, bool useMask, size_t len, char *buffer, size_t maxlen);
 
-bool ws_connect(int sockfd, const ftl::URI &uri);
+bool ws_connect(SOCKET sockfd, const ftl::URI &uri);
 
 };
 };
diff --git a/components/net/cpp/src/ws_internal.cpp b/components/net/cpp/src/ws_internal.cpp
index e8387d939..a58a47d77 100644
--- a/components/net/cpp/src/ws_internal.cpp
+++ b/components/net/cpp/src/ws_internal.cpp
@@ -5,8 +5,6 @@
 //#define GLOG_NO_ABBREVIATED_SEVERITIES
 #include <loguru.hpp>
 
-#include <ftl/net/common.hpp>
-
 #include <cstring>
 #include <ftl/net/ws_internal.hpp>
 #include <memory>
diff --git a/components/net/cpp/test/peer_unit.cpp b/components/net/cpp/test/peer_unit.cpp
index 583f615d4..dd780cbc4 100644
--- a/components/net/cpp/test/peer_unit.cpp
+++ b/components/net/cpp/test/peer_unit.cpp
@@ -34,7 +34,7 @@ using std::chrono::milliseconds;
 
 class MockPeer : public Peer {
 	public:
-	MockPeer() : Peer(0) {}
+	MockPeer() : Peer(INVALID_SOCKET) {}
 	void mock_data() { data(); }
 };
 
@@ -45,7 +45,7 @@ static std::map<int, std::string> fakedata;
 #ifdef WIN32
 int ftl::net::internal::recv(SOCKET sd, char *buf, int n, int f) {
 #else
-ssize_t ftl::net::internal::recv(int sd, void *buf, size_t n, int f) {
+ssize_t ftl::net::internal::recv(SOCKET sd, void *buf, size_t n, int f) {
 #endif
 	if (fakedata.count(sd) == 0) {
 		std::cout << "Unrecognised socket" << std::endl;
-- 
GitLab