From 56d6aa389937be5e43c442c9498e38c70da44d13 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 21 Jun 2010 09:00:56 +0000 Subject: [PATCH] * net_udp.c: Changed broadcastaddr type to struct sockaddr_in. * net_wins.c: Likewise. * net_wipx.c: Changed broadcastaddr type to struct sockaddr_ipx. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@206 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/net_udp.c | 10 +++++----- Quake/net_wins.c | 10 +++++----- Quake/net_wipx.c | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Quake/net_udp.c b/Quake/net_udp.c index 6651ab0b..e9cd99d2 100644 --- a/Quake/net_udp.c +++ b/Quake/net_udp.c @@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int net_acceptsocket = -1; // socket for fielding new connections static int net_controlsocket; static int net_broadcastsocket = 0; -static struct qsockaddr broadcastaddr; +static struct sockaddr_in broadcastaddr; static in_addr_t myAddr; @@ -87,9 +87,9 @@ int UDP_Init (void) if ((net_controlsocket = UDP_OpenSocket (0)) == -1) Sys_Error("UDP_Init: Unable to open control socket\n"); - ((struct sockaddr_in *)&broadcastaddr)->sin_family = AF_INET; - ((struct sockaddr_in *)&broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST; - ((struct sockaddr_in *)&broadcastaddr)->sin_port = htons(net_hostport); + broadcastaddr.sin_family = AF_INET; + broadcastaddr.sin_addr.s_addr = INADDR_BROADCAST; + broadcastaddr.sin_port = htons((unsigned short)net_hostport); if (UDP_GetSocketAddr (net_controlsocket, &addr) != 0) { @@ -310,7 +310,7 @@ int UDP_Broadcast (int socketid, byte *buf, int len) } } - return UDP_Write (socketid, buf, len, &broadcastaddr); + return UDP_Write (socketid, buf, len, (struct qsockaddr *)&broadcastaddr); } //============================================================================= diff --git a/Quake/net_wins.c b/Quake/net_wins.c index 3c92cf6a..2ee0e3ad 100644 --- a/Quake/net_wins.c +++ b/Quake/net_wins.c @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int net_acceptsocket = -1; // socket for fielding new connections static int net_controlsocket; static int net_broadcastsocket = 0; -static struct qsockaddr broadcastaddr; +static struct sockaddr_in broadcastaddr; static u_long myAddr; @@ -171,9 +171,9 @@ int WINS_Init (void) return -1; } - ((struct sockaddr_in *)&broadcastaddr)->sin_family = AF_INET; - ((struct sockaddr_in *)&broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST; - ((struct sockaddr_in *)&broadcastaddr)->sin_port = htons((unsigned short)net_hostport); + broadcastaddr.sin_family = AF_INET; + broadcastaddr.sin_addr.s_addr = INADDR_BROADCAST; + broadcastaddr.sin_port = htons((unsigned short)net_hostport); Con_Printf("Winsock TCP/IP Initialized\n"); tcpipAvailable = true; @@ -380,7 +380,7 @@ int WINS_Broadcast (int socketid, byte *buf, int len) } } - return WINS_Write (socketid, buf, len, &broadcastaddr); + return WINS_Write (socketid, buf, len, (struct qsockaddr *)&broadcastaddr); } //============================================================================= diff --git a/Quake/net_wipx.c b/Quake/net_wipx.c index b172df85..9678549d 100644 --- a/Quake/net_wipx.c +++ b/Quake/net_wipx.c @@ -32,7 +32,7 @@ extern cvar_t hostname; static int net_acceptsocket = -1; // socket for fielding new connections static int net_controlsocket; -static struct qsockaddr broadcastaddr; +static struct sockaddr_ipx broadcastaddr; extern qboolean winsock_initialized; extern WSADATA winsockdata; @@ -98,10 +98,10 @@ int WIPX_Init (void) return -1; } - ((struct sockaddr_ipx *)&broadcastaddr)->sa_family = AF_IPX; - memset(((struct sockaddr_ipx *)&broadcastaddr)->sa_netnum, 0, 4); - memset(((struct sockaddr_ipx *)&broadcastaddr)->sa_nodenum, 0xff, 6); - ((struct sockaddr_ipx *)&broadcastaddr)->sa_socket = htons((unsigned short)net_hostport); + broadcastaddr.sa_family = AF_IPX; + memset(broadcastaddr.sa_netnum, 0, 4); + memset(broadcastaddr.sa_nodenum, 0xff, 6); + broadcastaddr.sa_socket = htons((unsigned short)net_hostport); WIPX_GetSocketAddr (net_controlsocket, &addr); Q_strcpy(my_ipx_address, WIPX_AddrToString (&addr)); @@ -256,7 +256,7 @@ int WIPX_Read (int handle, byte *buf, int len, struct qsockaddr *addr) int WIPX_Broadcast (int handle, byte *buf, int len) { - return WIPX_Write (handle, buf, len, &broadcastaddr); + return WIPX_Write (handle, buf, len, (struct qsockaddr *)&broadcastaddr); } //=============================================================================