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

Unified Diff: ppapi/tests/test_tcp_server_socket_private.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_post_message.cc ('k') | ppapi/tests/test_tcp_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_tcp_server_socket_private.cc
diff --git a/ppapi/tests/test_tcp_server_socket_private.cc b/ppapi/tests/test_tcp_server_socket_private.cc
index 2465d5172e66a8b323ff63ee7254bb2610f503f1..64b5402abe0f09ec5cd896350636da653929641a 100644
--- a/ppapi/tests/test_tcp_server_socket_private.cc
+++ b/ppapi/tests/test_tcp_server_socket_private.cc
@@ -77,7 +77,8 @@ std::string TestTCPServerSocketPrivate::SyncRead(TCPSocketPrivate* 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_TRUE(callback.result() >= 0);
buffer += callback.result();
@@ -92,7 +93,8 @@ std::string TestTCPServerSocketPrivate::SyncWrite(TCPSocketPrivate* socket,
while (num_bytes > 0) {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
callback.WaitForResult(
- socket->Write(buffer, num_bytes, callback.GetCallback()));
+ socket->Write(buffer, static_cast<int32_t>(num_bytes),
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_TRUE(callback.result() >= 0);
buffer += callback.result();
@@ -236,7 +238,7 @@ std::string TestTCPServerSocketPrivate::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(SyncWrite(client_sockets[i], &byte, sizeof(byte)));
}
« no previous file with comments | « ppapi/tests/test_post_message.cc ('k') | ppapi/tests/test_tcp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698