diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 07:06:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 07:08:37 +0300 |
commit | a1d57e3f05f1602a07698e19f97f861d41f14775 (patch) | |
tree | 09d993cceed4d37c6d6a89ecd8aa764424aa0966 /source/blender/blenkernel/intern/fluid.c | |
parent | 171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 (diff) |
Cleanup: replace sizeof division with ARRAY_SIZE macro
Diffstat (limited to 'source/blender/blenkernel/intern/fluid.c')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index eb22c2a1462..ee7d85ba3fb 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1757,14 +1757,13 @@ static void update_distances(int index, {0.0f, -1.0f, 1.0f}, {0.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {1.0f, -1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f}, {-1.0f, -1.0f, 1.0f}, {1.0f, 1.0f, -1.0f}, {1.0f, -1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f}, {-1.0f, -1.0f, -1.0f}}; - size_t ray_cnt = sizeof ray_dirs / sizeof ray_dirs[0]; /* Count ray mesh misses (i.e. no face hit) and cases where the ray direction matches the face * normal direction. From this information it can be derived whether a cell is inside or * outside the mesh. */ int miss_cnt = 0, dir_cnt = 0; - for (int i = 0; i < ray_cnt; i++) { + for (int i = 0; i < ARRAY_SIZE(ray_dirs); i++) { BVHTreeRayHit hit_tree = {0}; hit_tree.index = -1; hit_tree.dist = PHI_MAX; @@ -1798,7 +1797,7 @@ static void update_distances(int index, /* Point lies inside mesh. Use negative sign for distance value. * This "if statement" has 2 conditions that can be true for points outside mesh. */ - if (!(miss_cnt > 0 || dir_cnt == ray_cnt)) { + if (!(miss_cnt > 0 || dir_cnt == ARRAY_SIZE(ray_dirs))) { min_dist = (-1.0f) * fabsf(min_dist); } |