From d2e8643607424cd74616e2e863f5609e7b8458a5 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 24 Aug 2016 21:45:03 +0200 Subject: Fixed type-casting-related warnings. --- Tools/ProtoProxy/Server.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Tools/ProtoProxy/Server.cpp') diff --git a/Tools/ProtoProxy/Server.cpp b/Tools/ProtoProxy/Server.cpp index 98baec8da..60998798c 100644 --- a/Tools/ProtoProxy/Server.cpp +++ b/Tools/ProtoProxy/Server.cpp @@ -20,7 +20,7 @@ cServer::cServer(void) -int cServer::Init(short a_ListenPort, short a_ConnectPort) +int cServer::Init(UInt16 a_ListenPort, UInt16 a_ConnectPort) { m_ConnectPort = a_ConnectPort; @@ -50,7 +50,7 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort) local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; // All interfaces local.sin_port = htons(a_ListenPort); - if (bind(m_ListenSocket, (sockaddr *)&local, sizeof(local)) != 0) + if (bind(m_ListenSocket, reinterpret_cast(&local), sizeof(local)) != 0) { #ifdef _WIN32 int err = WSAGetLastError(); @@ -70,7 +70,7 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort) printf("Failed to listen on socket: %d\n", err); return err; } - LOGINFO("Listening on port %d, connecting to localhost:%d", a_ListenPort, a_ConnectPort); + LOGINFO("Listening for client connections on port %d, connecting to server at localhost:%d", a_ListenPort, a_ConnectPort); LOGINFO("Generating protocol encryption keypair..."); m_PrivateKey.Generate(); @@ -91,7 +91,7 @@ void cServer::Run(void) sockaddr_in Addr; memset(&Addr, 0, sizeof(Addr)); socklen_t AddrSize = sizeof(Addr); - SOCKET client = accept(m_ListenSocket, (sockaddr *)&Addr, &AddrSize); + SOCKET client = accept(m_ListenSocket, reinterpret_cast(&Addr), &AddrSize); if (client == INVALID_SOCKET) { printf("accept returned an error: %d; bailing out.\n", SocketError); -- cgit v1.2.3