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>2020-05-19 11:53:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-05-27 13:07:16 +0300
commit98197343e81e1fb67c60b4bff1e35c04378bea6a (patch)
tree91d1eb5d771d9b9025021a51adc6c045303164de /intern
parentbe03a756e5f8b691c8b25e52fed63816ca02add1 (diff)
OpenSubdiv: Cleanup, use C++ range based loop
Avoid indirection via define.
Diffstat (limited to 'intern')
-rw-r--r--intern/opensubdiv/internal/evaluator/evaluator_impl.cc8
-rw-r--r--intern/opensubdiv/internal/opensubdiv_util.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/intern/opensubdiv/internal/evaluator/evaluator_impl.cc b/intern/opensubdiv/internal/evaluator/evaluator_impl.cc
index 7c80fceb51e..5216903a169 100644
--- a/intern/opensubdiv/internal/evaluator/evaluator_impl.cc
+++ b/intern/opensubdiv/internal/evaluator/evaluator_impl.cc
@@ -327,7 +327,7 @@ class VolatileEvalOutput {
// Create evaluators for every face varying channel.
face_varying_evaluators.reserve(all_face_varying_stencils.size());
int face_varying_channel = 0;
- foreach (const StencilTable *face_varying_stencils, all_face_varying_stencils) {
+ for (const StencilTable *face_varying_stencils : all_face_varying_stencils) {
face_varying_evaluators.push_back(new FaceVaryingEval(face_varying_channel,
face_varying_stencils,
face_varying_width,
@@ -345,7 +345,7 @@ class VolatileEvalOutput {
delete patch_table_;
delete vertex_stencils_;
delete varying_stencils_;
- foreach (FaceVaryingEval *face_varying_evaluator, face_varying_evaluators) {
+ for (FaceVaryingEval *face_varying_evaluator : face_varying_evaluators) {
delete face_varying_evaluator;
}
}
@@ -414,7 +414,7 @@ class VolatileEvalOutput {
}
// Evaluate face-varying data.
if (hasFaceVaryingData()) {
- foreach (FaceVaryingEval *face_varying_evaluator, face_varying_evaluators) {
+ for (FaceVaryingEval *face_varying_evaluator : face_varying_evaluators) {
face_varying_evaluator->refine();
}
}
@@ -865,7 +865,7 @@ OpenSubdiv_EvaluatorImpl *openSubdiv_createEvaluatorInternal(
// TOOD(sergey): Look into whether we've got duplicated stencils arrays.
delete vertex_stencils;
delete varying_stencils;
- foreach (const StencilTable *table, all_face_varying_stencils) {
+ for (const StencilTable *table : all_face_varying_stencils) {
delete table;
}
return evaluator_descr;
diff --git a/intern/opensubdiv/internal/opensubdiv_util.h b/intern/opensubdiv/internal/opensubdiv_util.h
index 3fcfdd4c32b..379ce20c479 100644
--- a/intern/opensubdiv/internal/opensubdiv_util.h
+++ b/intern/opensubdiv/internal/opensubdiv_util.h
@@ -41,8 +41,6 @@ using std::swap;
using std::unordered_map;
using std::vector;
-#define foreach(x, y) for (x : y)
-
#define STRINGIFY_ARG(x) "" #x
#define STRINGIFY_APPEND(a, b) "" a #b
#define STRINGIFY(x) STRINGIFY_APPEND("", x)