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

Unified Diff: ppapi/examples/video_decode/video_decode_dev.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/examples/video_decode/video_decode.cc ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/examples/video_decode/video_decode_dev.cc
diff --git a/ppapi/examples/video_decode/video_decode_dev.cc b/ppapi/examples/video_decode/video_decode_dev.cc
index d054e36dbf64b2bbd1e740146923f4495aa0c6c8..1cacb1b37e468cd6847e0e81b97eb1ef2ea7e25a 100644
--- a/ppapi/examples/video_decode/video_decode_dev.cc
+++ b/ppapi/examples/video_decode/video_decode_dev.cc
@@ -341,11 +341,12 @@ void VideoDecodeDemoInstance::DecoderClient::DecodeNextNALU() {
size_t start_pos = encoded_data_next_pos_to_decode_;
size_t end_pos;
GetNextNALUBoundary(start_pos, &end_pos);
- pp::Buffer_Dev* buffer = new pp::Buffer_Dev(gles2_, end_pos - start_pos);
+ pp::Buffer_Dev* buffer = new pp::Buffer_Dev(
+ gles2_, static_cast<uint32_t>(end_pos - start_pos));
PP_VideoBitstreamBuffer_Dev bitstream_buffer;
int id = ++next_bitstream_buffer_id_;
bitstream_buffer.id = id;
- bitstream_buffer.size = end_pos - start_pos;
+ bitstream_buffer.size = static_cast<uint32_t>(end_pos - start_pos);
bitstream_buffer.data = buffer->pp_resource();
memcpy(buffer->data(), kData + start_pos, end_pos - start_pos);
assert(bitstream_buffers_by_id_.insert(std::make_pair(id, buffer)).second);
@@ -637,9 +638,9 @@ Shader VideoDecodeDemoInstance::CreateProgram(const char* vertex_shader,
// Create shader program.
shader.program = gles2_if_->CreateProgram(context_->pp_resource());
CreateShader(shader.program, GL_VERTEX_SHADER, vertex_shader,
- strlen(vertex_shader));
+ static_cast<int>(strlen(vertex_shader)));
CreateShader(shader.program, GL_FRAGMENT_SHADER, fragment_shader,
- strlen(fragment_shader));
+ static_cast<int>(strlen(fragment_shader)));
gles2_if_->LinkProgram(context_->pp_resource(), shader.program);
gles2_if_->UseProgram(context_->pp_resource(), shader.program);
gles2_if_->Uniform1i(
« no previous file with comments | « ppapi/examples/video_decode/video_decode.cc ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698