]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - netconn.c
move sv.active = true; up to fix a VM_bprint warning
[xonotic/darkplaces.git] / netconn.c
index 788b877d3bc2110a32304950a47347da3bf6efb4..a82f977470f42546c82d0d0b9358e3cbfe119bd6 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -208,10 +208,10 @@ static qboolean _ServerList_CompareStr( const char *A, serverlist_maskop_t op, c
 {
        int i;
        char bufferA[ 256 ], bufferB[ 256 ]; // should be more than enough
-       for (i = 0;i < sizeof(bufferA)-1 && A[i];i++)
+       for (i = 0;i < (int)sizeof(bufferA)-1 && A[i];i++)
                bufferA[i] = (A[i] >= 'A' && A[i] <= 'Z') ? (A[i] + 'a' - 'A') : A[i];
        bufferA[i] = 0;
-       for (i = 0;i < sizeof(bufferB)-1 && B[i];i++)
+       for (i = 0;i < (int)sizeof(bufferB)-1 && B[i];i++)
                bufferB[i] = (B[i] >= 'A' && B[i] <= 'Z') ? (B[i] + 'a' - 'A') : B[i];
        bufferB[i] = 0;
 
@@ -428,7 +428,7 @@ int NetConn_Write(lhnetsocket_t *mysocket, const void *data, int length, const l
 int NetConn_WriteString(lhnetsocket_t *mysocket, const char *string, const lhnetaddress_t *peeraddress)
 {
        // note this does not include the trailing NULL because we add that in the parser
-       return NetConn_Write(mysocket, string, strlen(string), peeraddress);
+       return NetConn_Write(mysocket, string, (int)strlen(string), peeraddress);
 }
 
 int NetConn_SendReliableMessage(netconn_t *conn, sizebuf_t *data)
@@ -673,6 +673,7 @@ void NetConn_OpenServerPort(const char *addressstring, int defaultport)
                                sv_sockets[sv_numsockets++] = s;
                                LHNETADDRESS_ToString(LHNET_AddressFromSocket(s), addressstring2, sizeof(addressstring2), true);
                                Con_Printf("Server listening on address %s\n", addressstring2);
+                               break;
                        }
                        else
                        {
@@ -680,7 +681,7 @@ void NetConn_OpenServerPort(const char *addressstring, int defaultport)
                                Con_Printf("Server failed to open socket on address %s\n", addressstring2);
                        }
                }
-               else 
+               else
                {
                        Con_Printf("Server unable to parse address %s\n", addressstring);
                        // if it cant parse one address, it wont be able to parse another for sure
@@ -886,7 +887,7 @@ int NetConn_ReceivedMessage(netconn_t *conn, qbyte *data, int length)
                                        conn->lastMessageTime = realtime;
                                        conn->timeout = realtime + net_messagetimeout.value;
                                        conn->receiveSequence++;
-                                       if( conn->receiveMessageLength + length <= sizeof( conn->receiveMessage ) ) {
+                                       if( conn->receiveMessageLength + length <= (int)sizeof( conn->receiveMessage ) ) {
                                                memcpy(conn->receiveMessage + conn->receiveMessageLength, data, length);
                                                conn->receiveMessageLength += length;
                                        } else {
@@ -1398,7 +1399,7 @@ static qboolean NetConn_BuildStatusResponse(const char* challenge, char* out_msg
                int left;
 
                ptr = out_msg + length;
-               left = out_size - length;
+               left = (int)out_size - length;
 
                for (i = 0;i < (unsigned int)svs.maxclients;i++)
                {