Skip to content

Commit

Permalink
OpenSubdiv: Cleanup, use C++ range based loop
Browse files Browse the repository at this point in the history
Avoid indirection via define.
  • Loading branch information
sergeyvfx committed May 27, 2020
1 parent be03a75 commit 9819734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions intern/opensubdiv/internal/evaluator/evaluator_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions intern/opensubdiv/internal/opensubdiv_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9819734

Please sign in to comment.