From 2c1862f941068335333de05dfd0d6914cb98bd28 Mon Sep 17 00:00:00 2001 From: "maf@google.com" Date: Thu, 27 Aug 2009 19:01:39 +0000 Subject: Fix code in effect_helper.cc that does not compile in GCC. Review URL: http://codereview.chromium.org/174597 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24639 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/command_buffer/client/cross/effect_helper.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'o3d') diff --git a/o3d/command_buffer/client/cross/effect_helper.cc b/o3d/command_buffer/client/cross/effect_helper.cc index 8302c14..1f05dd8 100644 --- a/o3d/command_buffer/client/cross/effect_helper.cc +++ b/o3d/command_buffer/client/cross/effect_helper.cc @@ -88,7 +88,8 @@ bool EffectHelper::CreateEffectParameters(ResourceID effect_id, // Read param descriptions in batches. We use as much shared memory as // possible so that we only call Finish as little as possible. unsigned int max_param_per_batch = - std::min(param_count, max_buffer_size / sizeof(Desc)); // NOLINT + std::min(static_cast(param_count), + static_cast(max_buffer_size / sizeof(Desc))); // NOLINT Desc *raw_descs = shm_allocator_->AllocTyped(max_param_per_batch); DCHECK(raw_descs); for (unsigned int i = 0; i < param_count; i += max_param_per_batch) { @@ -125,7 +126,8 @@ bool EffectHelper::GetParamStrings(EffectParamDesc *desc) { DCHECK_NE(desc->id, kInvalidResource); // desc may not have come directly from CreateEffectParameters, so it may be // less than the minimum required size. - unsigned int size = std::max(desc->cmd_desc_size, sizeof(Desc)); // NOLINT + unsigned int size = std::max(static_cast(desc->cmd_desc_size), + static_cast(sizeof(Desc))); // NOLINT Desc *raw_desc = static_cast(shm_allocator_->Alloc(size)); if (!raw_desc) { // Not enough memory to get the param desc. @@ -242,7 +244,8 @@ bool EffectHelper::GetEffectStreams(ResourceID effect_id, // Read stream descriptions in batches. We use as much shared memory as // possible so that we only call Finish as little as possible. unsigned int max_stream_per_batch = - std::min(stream_count, max_buffer_size / sizeof(Desc)); // NOLINT + std::min(static_cast(stream_count), + static_cast(max_buffer_size / sizeof(Desc))); // NOLINT Desc *raw_descs = shm_allocator_->AllocTyped(max_stream_per_batch); DCHECK(raw_descs); for (unsigned int i = 0; i < stream_count; i += max_stream_per_batch) { -- cgit v1.1