Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: ppapi/tests/test_tcp_socket.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_tcp_server_socket_private.cc ('k') | ppapi/tests/test_tcp_socket_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_tcp_socket.cc
diff --git a/ppapi/tests/test_tcp_socket.cc b/ppapi/tests/test_tcp_socket.cc
index a3164deb6b6c2b2a42f9337ea0278f71eb7b1222..877b469ea4a40b3eef25d1894cb586483a23a82a 100644
--- a/ppapi/tests/test_tcp_socket.cc
+++ b/ppapi/tests/test_tcp_socket.cc
@@ -285,7 +285,7 @@ std::string TestTCPSocket::TestBacklog() {
}
for (size_t i = 0; i < kBacklog; ++i) {
- const char byte = 'a' + i;
+ const char byte = static_cast<char>('a' + i);
ASSERT_SUBTEST_SUCCESS(WriteToSocket(client_sockets[i],
std::string(1, byte)));
}
@@ -384,7 +384,8 @@ std::string TestTCPSocket::ReadFromSocket(pp::TCPSocket* socket,
while (num_bytes > 0) {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
callback.WaitForResult(
- socket->Read(buffer, num_bytes, callback.GetCallback()));
+ socket->Read(buffer, static_cast<int32_t>(num_bytes),
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_GT(callback.result(), 0);
buffer += callback.result();
@@ -401,7 +402,9 @@ std::string TestTCPSocket::WriteToSocket(pp::TCPSocket* socket,
while (written < s.size()) {
TestCompletionCallback cb(instance_->pp_instance(), callback_type());
cb.WaitForResult(
- socket->Write(buffer + written, s.size() - written, cb.GetCallback()));
+ socket->Write(buffer + written,
+ static_cast<int32_t>(s.size() - written),
+ cb.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(cb);
ASSERT_GT(cb.result(), 0);
written += cb.result();
@@ -418,7 +421,8 @@ std::string TestTCPSocket::WriteToSocket_1_0(
while (written < s.size()) {
TestCompletionCallback cb(instance_->pp_instance(), callback_type());
cb.WaitForResult(socket_interface_1_0_->Write(
- socket, buffer + written, s.size() - written,
+ socket, buffer + written,
+ static_cast<int32_t>(s.size() - written),
cb.GetCallback().pp_completion_callback()));
CHECK_CALLBACK_BEHAVIOR(cb);
ASSERT_GT(cb.result(), 0);
« no previous file with comments | « ppapi/tests/test_tcp_server_socket_private.cc ('k') | ppapi/tests/test_tcp_socket_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698