Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-01-13 12:53:01 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-20 13:26:23 +0300
commitbd302ecf73169a02ba882a1de97e78fee6c01525 (patch)
tree0667b68c2d7c3758ba1b367c1c9eeb60538aac03 /intern
parenta503e7626a636c85ad655e96e4bec9f0c1ae13ab (diff)
Cycles: Avoid shadowing in BVH code
Run into some nasty bugs while trying various things here. Wouldn't mind enabling -Wshadow for Cycles actually..
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/bvh/bvh_build.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 48f1d063fd1..66e9ecae327 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -165,12 +165,13 @@ void BVHBuild::add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh,
/* motion curve */
if(curve_attr_mP) {
- size_t mesh_size = mesh->curve_keys.size();
- size_t steps = mesh->motion_steps - 1;
- float3 *key_steps = curve_attr_mP->data_float3();
+ const size_t mesh_size = mesh->curve_keys.size();
+ const size_t num_steps = mesh->motion_steps - 1;
+ const float3 *key_steps = curve_attr_mP->data_float3();
- for(size_t i = 0; i < steps; i++)
- curve.bounds_grow(k, key_steps + i*mesh_size, &mesh->curve_radius[0], bounds);
+ for(size_t step = 0; step < num_steps; step++) {
+ curve.bounds_grow(k, key_steps + step*mesh_size, &mesh->curve_radius[0], bounds);
+ }
type = PRIMITIVE_MOTION_CURVE;
}