From 1950685675909dc7e38c0c68ef1fc6c2a0a94335 Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Thu, 23 Apr 2015 14:52:38 -0700 Subject: [PATCH] Fixed type errors - Some instances of stdint types were reintroduced by a merge conflicgt. They have now been converted back to language types. --- xpcPlugin/MessageHandlers.cpp | 4 ++-- xpcPlugin/UDPSocket.cpp | 3 +-- xpcPlugin/UDPSocket.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/xpcPlugin/MessageHandlers.cpp b/xpcPlugin/MessageHandlers.cpp index 60b43ba..90f0aa8 100644 --- a/xpcPlugin/MessageHandlers.cpp +++ b/xpcPlugin/MessageHandlers.cpp @@ -119,7 +119,7 @@ namespace XPC const unsigned char* buffer = msg.GetBuffer(); // Store new port - std::uint16_t port = *((std::uint16_t*)(buffer + 5)); + unsigned short port = *((unsigned short*)(buffer + 5)); sockaddr* sa = &connection.addr; switch (sa->sa_family) { @@ -604,7 +604,7 @@ namespace XPC loopback.sin_family = AF_INET; loopback.sin_addr.s_addr = htonl(INADDR_LOOPBACK); loopback.sin_port = htons(49000); - sock->SendTo((std::uint8_t*)msg.GetBuffer(), msg.GetSize(), (sockaddr*)&loopback); + sock->SendTo(msg.GetBuffer(), msg.GetSize(), (sockaddr*)&loopback); } void MessageHandlers::HandleUnknown(Message& msg) diff --git a/xpcPlugin/UDPSocket.cpp b/xpcPlugin/UDPSocket.cpp index 9e8c276..a2383e8 100644 --- a/xpcPlugin/UDPSocket.cpp +++ b/xpcPlugin/UDPSocket.cpp @@ -135,9 +135,8 @@ namespace XPC return status; } - void UDPSocket::SendTo(std::uint8_t* buffer, std::size_t len, sockaddr* remote) + void UDPSocket::SendTo(const unsigned char* buffer, std::size_t len, sockaddr* remote) { - buffer[4] = (std::uint8_t)len; if (sendto(sock, (char*)buffer, (int)len, 0, remote, sizeof(*remote)) < 0) { #if LOG_VERBOSITY > 0 diff --git a/xpcPlugin/UDPSocket.h b/xpcPlugin/UDPSocket.h index f2f83f4..b6e8e58 100644 --- a/xpcPlugin/UDPSocket.h +++ b/xpcPlugin/UDPSocket.h @@ -55,7 +55,7 @@ namespace XPC /// \param data The data to be sent. /// \param len The number of bytes to send. /// \param remote The destination socket. - void SendTo(std::uint8_t* buffer, std::size_t len, sockaddr* remote); + void SendTo(const unsigned char* buffer, std::size_t len, sockaddr* remote); /// Gets a string containing the IP address and port contained in the given sockaddr. ///