[quake3-commits] r1771 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jan 10 13:28:32 EST 2010


Author: tma
Date: 2010-01-10 13:28:32 -0500 (Sun, 10 Jan 2010)
New Revision: 1771

Modified:
   trunk/code/qcommon/net_ip.c
Log:
* Clean-up whitespace in net_ip.c

Modified: trunk/code/qcommon/net_ip.c
===================================================================
--- trunk/code/qcommon/net_ip.c	2010-01-07 19:53:52 UTC (rev 1770)
+++ trunk/code/qcommon/net_ip.c	2010-01-10 18:28:32 UTC (rev 1771)
@@ -856,9 +856,6 @@
 	// make it broadcast capable
 	if( setsockopt( newsocket, SOL_SOCKET, SO_BROADCAST, (char *) &i, sizeof(i) ) == SOCKET_ERROR ) {
 		Com_Printf( "WARNING: NET_IPSocket: setsockopt SO_BROADCAST: %s\n", NET_ErrorString() );
-
-		// it is not that bad if this one fails.
-//		return newsocket;
 	}
 
 	if( !net_interface || !net_interface[0]) {
@@ -1038,28 +1035,28 @@
 	if(curgroup.ipv6mr_interface)
 	{
 		if (setsockopt(multicast6_socket, IPPROTO_IPV6, IPV6_MULTICAST_IF,
-			       (char *) &curgroup.ipv6mr_interface, sizeof(curgroup.ipv6mr_interface)) < 0)
+					(char *) &curgroup.ipv6mr_interface, sizeof(curgroup.ipv6mr_interface)) < 0)
 		{
-        	        Com_Printf("NET_JoinMulticast6: Couldn't set scope on multicast socket: %s\n", NET_ErrorString());
+			Com_Printf("NET_JoinMulticast6: Couldn't set scope on multicast socket: %s\n", NET_ErrorString());
 
-        	        if(multicast6_socket != ip6_socket)
-        	        {
-        	        	closesocket(multicast6_socket);
-        	        	multicast6_socket = INVALID_SOCKET;
-        	        	return;
+			if(multicast6_socket != ip6_socket)
+			{
+				closesocket(multicast6_socket);
+				multicast6_socket = INVALID_SOCKET;
+				return;
 			}
 		}
-        }
+	}
 
-        if (setsockopt(multicast6_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *) &curgroup, sizeof(curgroup)))
-        {
-        	Com_Printf("NET_JoinMulticast6: Couldn't join multicast group: %s\n", NET_ErrorString());
-        	
-       	        if(multicast6_socket != ip6_socket)
-       	        {
-       	        	closesocket(multicast6_socket);
-       	        	multicast6_socket = INVALID_SOCKET;
-       	        	return;
+	if (setsockopt(multicast6_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *) &curgroup, sizeof(curgroup)))
+	{
+		Com_Printf("NET_JoinMulticast6: Couldn't join multicast group: %s\n", NET_ErrorString());
+
+		if(multicast6_socket != ip6_socket)
+		{
+			closesocket(multicast6_socket);
+			multicast6_socket = INVALID_SOCKET;
+			return;
 		}
 	}
 }
@@ -1256,10 +1253,10 @@
 
 /*
 =====================
-NET_GetLocalAddress
+NET_AddLocalAddress
 =====================
 */
-void NET_AddLocalAddress(char *ifname, struct sockaddr *addr, struct sockaddr *netmask)
+static void NET_AddLocalAddress(char *ifname, struct sockaddr *addr, struct sockaddr *netmask)
 {
 	int addrlen;
 	sa_family_t family;
@@ -1297,7 +1294,7 @@
 }
 
 #if defined(__linux__) || defined(MACOSX) || defined(__BSD__)
-void NET_GetLocalAddress(void)
+static void NET_GetLocalAddress(void)
 {
 	struct ifaddrs *ifap, *search;
 
@@ -1318,10 +1315,10 @@
 	}
 }
 #else
-void NET_GetLocalAddress( void ) {
+static void NET_GetLocalAddress( void ) {
 	char				hostname[256];
-	struct addrinfo		hint;
-	struct addrinfo 	*res = NULL;
+	struct addrinfo	hint;
+	struct addrinfo	*res = NULL;
 
 	if(gethostname( hostname, 256 ) == SOCKET_ERROR)
 		return;
@@ -1337,7 +1334,7 @@
 	{
 		struct sockaddr_in mask4;
 		struct sockaddr_in6 mask6;
-		struct addrinfo 	*search;
+		struct addrinfo *search;
 	
 		/* On operating systems where it's more difficult to find out the configured interfaces, we'll just assume a
 		 * netmask with all bits set. */
@@ -1479,27 +1476,27 @@
 #else
 	net_mcast6iface = Cvar_Get( "net_mcast6iface", "", CVAR_LATCH | CVAR_ARCHIVE );
 #endif
-	modified += net_mcast6iface->modified; 
+	modified += net_mcast6iface->modified;
 	net_mcast6iface->modified = qfalse;
 
 	net_socksEnabled = Cvar_Get( "net_socksEnabled", "0", CVAR_LATCH | CVAR_ARCHIVE );
-	modified += net_socksEnabled->modified; 
+	modified += net_socksEnabled->modified;
 	net_socksEnabled->modified = qfalse;
 
 	net_socksServer = Cvar_Get( "net_socksServer", "", CVAR_LATCH | CVAR_ARCHIVE );
-	modified += net_socksServer->modified; 
+	modified += net_socksServer->modified;
 	net_socksServer->modified = qfalse;
 
 	net_socksPort = Cvar_Get( "net_socksPort", "1080", CVAR_LATCH | CVAR_ARCHIVE );
-	modified += net_socksPort->modified; 
+	modified += net_socksPort->modified;
 	net_socksPort->modified = qfalse;
 
 	net_socksUsername = Cvar_Get( "net_socksUsername", "", CVAR_LATCH | CVAR_ARCHIVE );
-	modified += net_socksUsername->modified; 
+	modified += net_socksUsername->modified;
 	net_socksUsername->modified = qfalse;
 
 	net_socksPassword = Cvar_Get( "net_socksPassword", "", CVAR_LATCH | CVAR_ARCHIVE );
-	modified += net_socksPassword->modified; 
+	modified += net_socksPassword->modified;
 	net_socksPassword->modified = qfalse;
 
 	return modified ? qtrue : qfalse;



More information about the quake3-commits mailing list