- removed needless 'struct's

Sun, 14 Dec 2014 19:51:23 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 14 Dec 2014 19:51:23 +0200
changeset 19
2046a1651c0b
parent 18
56a1ac7d931b
child 20
5f8cdc8febbb

- removed needless 'struct's

sources/network/ipaddress.cpp file | annotate | diff | comparison | revisions
sources/network/udpsocket.cpp file | annotate | diff | comparison | revisions
--- a/sources/network/ipaddress.cpp	Sun Dec 14 19:42:43 2014 +0200
+++ b/sources/network/ipaddress.cpp	Sun Dec 14 19:51:23 2014 +0200
@@ -173,8 +173,8 @@
 STATIC METHOD
 IPAddress::resolve (String node, bool* ok) -> IPAddress
 {
-	struct addrinfo hints;
-	struct addrinfo* lookup;
+	addrinfo hints;
+	addrinfo* lookup;
 	memset (&hints, 0, sizeof hints);
 	hints.ai_family = AF_INET;
 
@@ -186,7 +186,7 @@
 
 	IPAddress result;
 	assert (lookup != nullptr);
-	sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*> (lookup[0].ai_addr);
+	sockaddr_in* addr = reinterpret_cast<sockaddr_in*> (lookup[0].ai_addr);
 	result.host = ntohl (addr->sin_addr.s_addr);
 	result.port = ntohs (addr->sin_port);
 	freeaddrinfo (lookup);
--- a/sources/network/udpsocket.cpp	Sun Dec 14 19:42:43 2014 +0200
+++ b/sources/network/udpsocket.cpp	Sun Dec 14 19:51:23 2014 +0200
@@ -70,13 +70,13 @@
 METHOD
 UDPSocket::bind (unsigned short port) -> bool
 {
-	struct sockaddr_in svaddr;
+	sockaddr_in svaddr;
 	memset (&svaddr, 0, sizeof svaddr);
 	svaddr.sin_family = AF_INET;
 	svaddr.sin_port = htons (port);
 	svaddr.sin_addr.s_addr = htonl (INADDR_ANY);
 
-	if (::bind (m_socket, reinterpret_cast<struct sockaddr*> (&svaddr), sizeof svaddr) == -1)
+	if (::bind (m_socket, reinterpret_cast<sockaddr*> (&svaddr), sizeof svaddr) == -1)
 	{
 		m_error = String ("Couldn't bind to port ") + String::from_number (port);
 		return false;
@@ -93,7 +93,7 @@
 	sockaddr_in claddr;
 	socklen_t socklen = sizeof claddr;
 	int length = ::recvfrom (m_socket, g_huffmanBuffer, sizeof g_huffmanBuffer, 0,
-		reinterpret_cast<struct sockaddr*> (&claddr), &socklen);
+		reinterpret_cast<sockaddr*> (&claddr), &socklen);
 
 	if (length == -1)
 	{

mercurial