[Bf-blender-cvs] [37419bb3f68] master: Cleanup: avoid setting float values by bit-pattern

Campbell Barton noreply at git.blender.org
Sun Mar 15 12:06:07 CET 2020


Commit: 37419bb3f688caca9c292d7c3d5680eb5594bd98
Author: Campbell Barton
Date:   Sun Mar 15 21:51:02 2020 +1100
Branches: master
https://developer.blender.org/rB37419bb3f688caca9c292d7c3d5680eb5594bd98

Cleanup: avoid setting float values by bit-pattern

Replace memset with copy_vn_fl, note that the exact values are slightly
different in this case. The value being set was close to FLT_MAX.

===================================================================

M	source/blender/blenkernel/intern/fluid.c

===================================================================

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 934dc47cf81..56dc671a909 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -705,8 +705,7 @@ static void bb_allocateData(FluidObjectBB *bb, bool use_velocity, bool use_influ
   }
 
   bb->distances = MEM_malloc_arrayN(bb->total_cells, sizeof(float), "fluid_bb_distances");
-  /* Initialize to infinity. */
-  memset(bb->distances, 0x7f7f7f7f, sizeof(float) * bb->total_cells);
+  copy_vn_fl(bb->distances, bb->total_cells, FLT_MAX);
 
   bb->valid = true;
 }



More information about the Bf-blender-cvs mailing list