]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - net_wins.c
cleaned up nearly all of the externs in .c files (moved to appropriate .h files)
[xonotic/darkplaces.git] / net_wins.c
index 3c5a773baad675113f75f9b7e564f4eb8c48dcd9..21eedf8c4e5b69fec73176d0697cc2aacb8a863c 100644 (file)
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "winquake.h"
 
-extern cvar_t hostname;
-
 #define MAXHOSTNAMELEN         256
 
 static int net_acceptsocket = -1;              // socket for fielding new connections
@@ -68,10 +66,10 @@ BOOL PASCAL FAR BlockingHook(void)
     MSG                msg;
     BOOL       ret;
  
-       if ((Sys_FloatTime() - blocktime) > 2.0)
+       if ((Sys_DoubleTime() - blocktime) > 2.0)
        {
                WSACancelBlockingCall();
-               return FALSE;
+               return false;
        }
 
     /* get the next message, if any */ 
@@ -83,12 +81,12 @@ BOOL PASCAL FAR BlockingHook(void)
         DispatchMessage(&msg); 
     } 
  
-    /* TRUE if we got a message */ 
+    /* true if we got a message */ 
     return ret; 
 } 
 
 
-void WINS_GetLocalAddress()
+void WINS_GetLocalAddress(void)
 {
        struct hostent  *local = NULL;
        char                    buff[MAXHOSTNAMELEN];
@@ -100,7 +98,7 @@ void WINS_GetLocalAddress()
        if (pgethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR)
                return;
 
-       blocktime = Sys_FloatTime();
+       blocktime = Sys_DoubleTime();
        WSASetBlockingHook(BlockingHook);
        local = pgethostbyname(buff);
        WSAUnhookBlockingHook();
@@ -129,7 +127,7 @@ int WINS_Init (void)
        
        if (hInst == NULL)
        {
-               Con_SafePrintf ("Failed to load winsock.dll\n");
+               Con_SafePrintf ("Failed to load wsock32.dll\n");
                winsock_lib_initialized = false;
                return -1;
        }
@@ -156,7 +154,7 @@ int WINS_Init (void)
                !pgethostname || !pgethostbyname || !pgethostbyaddr ||
                !pgetsockname)
        {
-               Con_SafePrintf ("Couldn't GetProcAddress from winsock.dll\n");
+               Con_SafePrintf ("Couldn't GetProcAddress from wsock32.dll\n");
                return -1;
        }
 
@@ -385,7 +383,7 @@ int WINS_CheckNewConnections (void)
        if (net_acceptsocket == -1)
                return -1;
 
-       if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) > 0)
+       if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) >= 0)
        {
                return net_acceptsocket;
        }