Cleanup: remove foreach macro from .clang-format

The usage of that macro was removed in 60bec183cbfa7ef9c713077347c518d697b65811,
but it was still in our .clang-format file. This lead to worse formatting when other code
used methods named `foreach`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137468
This commit is contained in:
Jacques Lucke 2025-04-14 16:17:00 +02:00
parent 47c7000392
commit 3ae20bf166
5 changed files with 14 additions and 15 deletions

View File

@ -258,7 +258,6 @@ ForEachMacros:
- SEQ_ALL_BEGIN
- SEQ_ITERATOR_FOREACH
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter
- SLOT_PROBING_BEGIN
- SET_SLOT_PROBING_BEGIN

View File

@ -606,7 +606,7 @@ static void merge_scalar_grids_for_velocity(const Scene *scene, Volume *volume)
vecgrid->tree().topologyUnion(vel_z_grid->tree());
MergeScalarGrids op(&vel_x_grid->tree(), &vel_y_grid->tree(), &vel_z_grid->tree());
openvdb::tools::foreach (vecgrid->beginValueOn(), op, true, false);
openvdb::tools::foreach(vecgrid->beginValueOn(), op, true, false);
/* Assume all grids have the same transformation. */
const openvdb::math::Transform::Ptr transform = openvdb::ConstPtrCast<openvdb::math::Transform>(

View File

@ -140,10 +140,10 @@ static openvdb::FloatGrid::Ptr mesh_to_density_grid_impl(
openvdb::tools::sdfToFogVolume(*new_grid);
if (density != 1.0f) {
openvdb::tools::foreach (new_grid->beginValueOn(),
[&](const openvdb::FloatGrid::ValueOnIter &iter) {
iter.modifyValue([&](float &value) { value *= density; });
});
openvdb::tools::foreach(new_grid->beginValueOn(),
[&](const openvdb::FloatGrid::ValueOnIter &iter) {
iter.modifyValue([&](float &value) { value *= density; });
});
}
return new_grid;
}

View File

@ -101,10 +101,10 @@ bke::VolumeGridData *fog_volume_grid_add_from_points(Volume *volume,
openvdb::tools::sdfToFogVolume(*new_grid);
/* Take the desired density into account. */
openvdb::tools::foreach (new_grid->beginValueOn(),
[&](const openvdb::FloatGrid::ValueOnIter &iter) {
iter.modifyValue([&](float &value) { value *= density; });
});
openvdb::tools::foreach(new_grid->beginValueOn(),
[&](const openvdb::FloatGrid::ValueOnIter &iter) {
iter.modifyValue([&](float &value) { value *= density; });
});
return BKE_volume_grid_add_vdb(*volume, name, std::move(new_grid));
}

View File

@ -224,11 +224,11 @@ struct DisplaceGridOp {
/* Run the operator. This is multi-threaded. It is important that the operator is not shared
* between the threads, because it contains a non-thread-safe accessor for the old grid. */
openvdb::tools::foreach (temp_grid->beginValueOn(),
displace_op,
true,
/* Disable sharing of the operator. */
false);
openvdb::tools::foreach(temp_grid->beginValueOn(),
displace_op,
true,
/* Disable sharing of the operator. */
false);
/* It is likely that we produced too many active cells. Those are removed here, to avoid
* slowing down subsequent operations. */