diff options
author | Jarkko Pöyry <jpoyry@google.com> | 2015-05-19 12:24:51 -0700 |
---|---|---|
committer | Jarkko Pöyry <jpoyry@google.com> | 2015-05-20 11:11:21 -0700 |
commit | 745d7c616351405cfb6d2a7133d261eb4989d626 (patch) | |
tree | 97b8dc7b97a326f1ad32eb6a27f799c861ef7702 /execserver/tools | |
parent | 88b1dbc9f0d1ff6454c10a3b7f7f163fe21e95dd (diff) | |
download | VK-GL-CTS-745d7c616351405cfb6d2a7133d261eb4989d626.tar.gz VK-GL-CTS-745d7c616351405cfb6d2a7133d261eb4989d626.tar.bz2 VK-GL-CTS-745d7c616351405cfb6d2a7133d261eb4989d626.zip |
Fix deutil and decpp -Wconversion warnings.
- Updated sockets to use size_t as data size.
- Updated executor and execserver to build on new api and use size_t
for data sizes. Protocol is not modified.
Bug: 21161908
Change-Id: Ic525e05ef9a28ac80d8a6bcf5e239a70a89a5172
Diffstat (limited to 'execserver/tools')
-rw-r--r-- | execserver/tools/xsClient.cpp | 18 | ||||
-rw-r--r-- | execserver/tools/xsTest.cpp | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/execserver/tools/xsClient.cpp b/execserver/tools/xsClient.cpp index eb71fe6bf..e680fc9a6 100644 --- a/execserver/tools/xsClient.cpp +++ b/execserver/tools/xsClient.cpp @@ -67,11 +67,11 @@ void sendMessage (de::Socket& socket, const Message& message) message.write(buf); // Write to socket. - int pos = 0; - while (pos < (int)buf.size()) + size_t pos = 0; + while (pos < buf.size()) { - int numLeft = (int)buf.size() - pos; - int numSent = 0; + size_t numLeft = buf.size() - pos; + size_t numSent = 0; deSocketResult result = socket.send(&buf[pos], numLeft, &numSent); if (result != DE_SOCKETRESULT_SUCCESS) @@ -81,14 +81,14 @@ void sendMessage (de::Socket& socket, const Message& message) } } -void readBytes (de::Socket& socket, vector<deUint8>& dst, int numBytes) +void readBytes (de::Socket& socket, vector<deUint8>& dst, size_t numBytes) { - int numRead = 0; + size_t numRead = 0; dst.resize(numBytes); while (numRead < numBytes) { - int numLeft = numBytes - numRead; - int curNumRead = 0; + size_t numLeft = numBytes - numRead; + size_t curNumRead = 0; deSocketResult result = socket.receive(&dst[numRead], numLeft, &curNumRead); if (result != DE_SOCKETRESULT_SUCCESS) @@ -105,7 +105,7 @@ Message* readMessage (de::Socket& socket) readBytes(socket, header, MESSAGE_HEADER_SIZE); MessageType type; - int messageSize; + size_t messageSize; Message::parseHeader(&header[0], (int)header.size(), type, messageSize); // Simple messages without any data. diff --git a/execserver/tools/xsTest.cpp b/execserver/tools/xsTest.cpp index 38b612041..5e47377c3 100644 --- a/execserver/tools/xsTest.cpp +++ b/execserver/tools/xsTest.cpp @@ -73,11 +73,11 @@ void sendMessage (de::Socket& socket, const Message& message) message.write(buf); // Write to socket. - int pos = 0; - while (pos < (int)buf.size()) + size_t pos = 0; + while (pos < buf.size()) { - int numLeft = (int)buf.size() - pos; - int numSent = 0; + size_t numLeft = buf.size() - pos; + size_t numSent = 0; deSocketResult result = socket.send(&buf[pos], numLeft, &numSent); if (result != DE_SOCKETRESULT_SUCCESS) @@ -87,14 +87,14 @@ void sendMessage (de::Socket& socket, const Message& message) } } -void readBytes (de::Socket& socket, vector<deUint8>& dst, int numBytes) +void readBytes (de::Socket& socket, vector<deUint8>& dst, size_t numBytes) { - int numRead = 0; + size_t numRead = 0; dst.resize(numBytes); while (numRead < numBytes) { - int numLeft = numBytes - numRead; - int curNumRead = 0; + size_t numLeft = numBytes - numRead; + size_t curNumRead = 0; deSocketResult result = socket.receive(&dst[numRead], numLeft, &curNumRead); if (result != DE_SOCKETRESULT_SUCCESS) @@ -111,7 +111,7 @@ Message* readMessage (de::Socket& socket) readBytes(socket, header, MESSAGE_HEADER_SIZE); MessageType type; - int messageSize; + size_t messageSize; Message::parseHeader(&header[0], (int)header.size(), type, messageSize); // Simple messages without any data. |