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

Unified Diff: ppapi/tests/test_udp_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_udp_socket.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_udp_socket_private.cc
diff --git a/ppapi/tests/test_udp_socket_private.cc b/ppapi/tests/test_udp_socket_private.cc
index ae1b978c298f5d48c8d782792a2ece06f39fadfd..74dd8ba8cea55520d5920796bb4b42028b2887d9 100644
--- a/ppapi/tests/test_udp_socket_private.cc
+++ b/ppapi/tests/test_udp_socket_private.cc
@@ -138,7 +138,8 @@ std::string TestUDPSocketPrivate::ReadSocket(pp::UDPSocketPrivate* socket,
std::vector<char> buffer(size);
TestCompletionCallback 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()));
@@ -151,7 +152,8 @@ std::string TestUDPSocketPrivate::PassMessage(pp::UDPSocketPrivate* target,
PP_NetAddress_Private* address,
const std::string& message) {
TestCompletionCallback callback(instance_->pp_instance(), callback_type());
- int32_t rv = source->SendTo(message.c_str(), message.size(), address,
+ int32_t rv = source->SendTo(message.c_str(),
+ static_cast<int32_t>(message.size()), address,
callback.GetCallback());
std::string str;
ASSERT_SUBTEST_SUCCESS(ReadSocket(target, address, message.size(), &str));
« no previous file with comments | « ppapi/tests/test_udp_socket.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698