From ccbabac1c54ecf34dbea215e75ddfe3675e3cb51 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 20 Jun 2010 13:10:52 +0000 Subject: [PATCH] * net_udp.c: Changed myAddr type to in_addr_t. * net_wins.c: Changed myAddr type to u_long. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@199 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/net_udp.c | 12 ++++++------ Quake/net_win.c | 2 ++ Quake/net_wins.c | 16 ++++++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Quake/net_udp.c b/Quake/net_udp.c index bd2515f5..a4740360 100644 --- a/Quake/net_udp.c +++ b/Quake/net_udp.c @@ -39,12 +39,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -static int net_acceptsocket = -1; // socket for fielding new connections -static int net_controlsocket; -static int net_broadcastsocket = 0; -static struct qsockaddr broadcastaddr; +static int net_acceptsocket = -1; // socket for fielding new connections +static int net_controlsocket; +static int net_broadcastsocket = 0; +static struct qsockaddr broadcastaddr; -static unsigned long myAddr; +static in_addr_t myAddr; #include "net_udp.h" @@ -74,7 +74,7 @@ int UDP_Init (void) return -1; } - myAddr = *(int *)local->h_addr_list[0]; + myAddr = *(in_addr_t *)local->h_addr_list[0]; // if the quake hostname isn't set, set it to the machine name if (Q_strcmp(hostname.string, "UNNAMED") == 0) diff --git a/Quake/net_win.c b/Quake/net_win.c index 8b700109..4ba001b3 100644 --- a/Quake/net_win.c +++ b/Quake/net_win.c @@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "quakedef.h" #include "net_loop.h" @@ -119,3 +120,4 @@ net_landriver_t net_landrivers[MAX_NET_DRIVERS] = }; int net_numlandrivers = 2; + diff --git a/Quake/net_wins.c b/Quake/net_wins.c index 041c4fa0..acf524b9 100644 --- a/Quake/net_wins.c +++ b/Quake/net_wins.c @@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MAXHOSTNAMELEN 256 -static int net_acceptsocket = -1; // socket for fielding new connections -static int net_controlsocket; -static int net_broadcastsocket = 0; -static struct qsockaddr broadcastaddr; +static int net_acceptsocket = -1; // socket for fielding new connections +static int net_controlsocket; +static int net_broadcastsocket = 0; +static struct qsockaddr broadcastaddr; -static unsigned long myAddr; +static u_long myAddr; #include "net_wins.h" @@ -70,8 +70,8 @@ static INT_PTR PASCAL FAR BlockingHook (void) static void WINS_GetLocalAddress (void) { struct hostent *local = NULL; - char buff[MAXHOSTNAMELEN]; - unsigned long addr; + char buff[MAXHOSTNAMELEN]; + u_long addr; if (myAddr != INADDR_ANY) return; @@ -86,7 +86,7 @@ static void WINS_GetLocalAddress (void) if (local == NULL) return; - myAddr = *(int *)local->h_addr_list[0]; + myAddr = *(u_long *)local->h_addr_list[0]; addr = ntohl(myAddr); sprintf(my_tcpip_address, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);