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

Unified Diff: ppapi/tests/test_udp_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_socket_private.cc ('k') | ppapi/tests/test_udp_socket_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_udp_socket.cc
diff --git a/ppapi/tests/test_udp_socket.cc b/ppapi/tests/test_udp_socket.cc
index 2b0568244e30001b37e5670f41a4799e733e7af6..89ea0363a95be9ff6a4021a00232ccbc8ee1a8bd 100644
--- a/ppapi/tests/test_udp_socket.cc
+++ b/ppapi/tests/test_udp_socket.cc
@@ -156,7 +156,8 @@ std::string TestUDPSocket::ReadSocket(pp::UDPSocket* socket,
TestCompletionCallbackWithOutput<pp::NetAddress> callback(
instance_->pp_instance(), callback_type());
callback.WaitForResult(
- socket->RecvFrom(&buffer[0], size, callback.GetCallback()));
+ socket->RecvFrom(&buffer[0], static_cast<int32_t>(size),
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_FALSE(callback.result() < 0);
ASSERT_EQ(size, static_cast<size_t>(callback.result()));
@@ -171,7 +172,8 @@ std::string TestUDPSocket::PassMessage(pp::UDPSocket* target,
const std::string& message,
pp::NetAddress* recvfrom_address) {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
- int32_t rv = source->SendTo(message.c_str(), message.size(),
+ int32_t rv = source->SendTo(message.c_str(),
+ static_cast<int32_t>(message.size()),
target_address,
callback.GetCallback());
std::string str;
@@ -341,7 +343,7 @@ std::string TestUDPSocket::TestParallelSend() {
new TestCompletionCallback(instance_->pp_instance(), callback_type());
sendto_results[i] =
client_socket.SendTo(message.c_str(),
- message.size(),
+ static_cast<int32_t>(message.size()),
server_address,
sendto_callbacks[i]->GetCallback());
@@ -356,7 +358,7 @@ std::string TestUDPSocket::TestParallelSend() {
// Try to send the message again.
sendto_results[i] =
client_socket.SendTo(message.c_str(),
- message.size(),
+ static_cast<int32_t>(message.size()),
server_address,
sendto_callbacks[i]->GetCallback());
ASSERT_NE(PP_ERROR_INPROGRESS, sendto_results[i]);
« no previous file with comments | « ppapi/tests/test_tcp_socket_private.cc ('k') | ppapi/tests/test_udp_socket_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698