Przeglądaj źródła

Warnungen in win32 behoben

Kolja Strohm 5 lat temu
rodzic
commit
68064ceb09
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      Network/WebSocket.cpp

+ 6 - 6
Network/WebSocket.cpp

@@ -14,11 +14,11 @@ __declspec( dllexport ) Frame &Frame::operator+=( const Frame &b ) // baut frame
     dataLength += b.dataLength;
     if( dataLength )
     {
-        char *data = new char[ dataLength ];
+        char *data = new char[ (int)dataLength ];
         if( data )
-            memcpy( data, this->data, dataLength - b.dataLength );
+            memcpy( data, this->data, (int)(dataLength - b.dataLength) );
         if( b.data )
-            memcpy( data + dataLength, b.data, b.dataLength );
+            memcpy( data + dataLength, b.data, (int)b.dataLength );
         delete[] this->data;
         this->data = data;
     }
@@ -137,8 +137,8 @@ __declspec( dllexport ) bool WebSocketClient::send( __int64 size, const char *da
     else
         f.opcode = 2;
     f.dataLength = size;
-    f.data = new char[ f.dataLength ];
-    memcpy( f.data, data, f.dataLength );
+    f.data = new char[ (int)f.dataLength ];
+    memcpy( f.data, data, (int)f.dataLength );
     f.key[ 0 ] = (unsigned char)(gen.rand() * 256);
     f.key[ 1 ] = (unsigned char)(gen.rand() * 256);
     f.key[ 2 ] = (unsigned char)(gen.rand() * 256);
@@ -225,7 +225,7 @@ __declspec( dllexport ) void WebSocketClient::thread()
                     message.dataLength = 1;
                 message.data = 0;
                 if( message.dataLength )
-                    message.data = new char[ message.dataLength ];
+                    message.data = new char[ (int)message.dataLength ];
                 for( int i = 0; i < message.dataLength; i++ )
                 {
                     ok &= klient->getNachricht( (char*)&byte, 1 );