mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
* 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
This commit is contained in:
parent
79154d12ca
commit
56d6aa3899
3 changed files with 16 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
Loading…
Reference in a new issue