Blender Git Commit Log

Git Commits -> Revision 598ab52

Revision 598ab52 by Sergey Sharybin (master)
March 9, 2020, 13:47 (GMT)
Cleanup: Replace ABS/SQUARE/CUBE with function calls

While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.

There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).

For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.

Differential Revision: https://developer.blender.org/D7051

Commit Details:

Full Hash: 598ab525da3df3fef2033c159c570688c7282a8f
Parent Commit: ee5d7bc
Lines Changed: +256, -186

67 Modified Paths:

/source/blender/blenkernel/intern/brush.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/bvhutils.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/collision.c (+7, -7) (Diff)
/source/blender/blenkernel/intern/constraint.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/dynamicpaint.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/effect.c (+2, -2) (Diff)
/source/blender/blenkernel/intern/fcurve.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/mask.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/mesh.c (+2, -2) (Diff)
/source/blender/blenkernel/intern/multires.c (+4, -4) (Diff)
/source/blender/blenkernel/intern/pbvh_bmesh.c (+2, -2) (Diff)
/source/blender/blenkernel/intern/softbody.c (+3, -3) (Diff)
/source/blender/blenkernel/intern/studiolight.c (+16, -13) (Diff)
/source/blender/blenlib/BLI_math_base.h (+17, -0) (Diff)
/source/blender/blenlib/BLI_utildefines.h (+0, -27) (Diff)
/source/blender/blenlib/intern/kdtree_impl.h (+2, -2) (Diff)
/source/blender/blenlib/intern/listbase.c (+2, -1) (Diff)
/source/blender/blenlib/intern/math_base_inline.c (+66, -0) (Diff)
/source/blender/blenlib/intern/math_color_inline.c (+3, -3) (Diff)
/source/blender/blenlib/intern/math_geom.c (+2, -2) (Diff)
/source/blender/blenlib/intern/math_rotation.c (+1, -1) (Diff)
/source/blender/blenlib/intern/string.c (+2, -1) (Diff)
/source/blender/bmesh/intern/bmesh_edgeloop.c (+2, -2) (Diff)
/source/blender/bmesh/operators/bmo_planar_faces.c (+1, -1) (Diff)
/source/blender/bmesh/tools/bmesh_decimate_collapse.c (+1, -1) (Diff)
/source/blender/bmesh/tools/bmesh_intersect_edges.c (+5, -5) (Diff)
/source/blender/bmesh/tools/bmesh_region_match.c (+7, -2) (Diff)
/source/blender/compositor/operations/COM_VectorBlurOperation.cpp (+3, -3) (Diff)
/source/blender/draw/engines/eevee/eevee_lightprobes.c (+1, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+1, -1) (Diff)
/source/blender/draw/engines/workbench/workbench_data.c (+2, -2) (Diff)
/source/blender/draw/engines/workbench/workbench_effect_dof.c (+3, -2) (Diff)
/source/blender/draw/engines/workbench/workbench_effect_taa.c (+3, -3) (Diff)
/source/blender/draw/intern/draw_manager_exec.c (+1, -1) (Diff)
/source/blender/editors/armature/armature_utils.c (+2, -1) (Diff)
/source/blender/editors/curve/editcurve_paint.c (+3, -3) (Diff)
/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c (+2, -2) (Diff)
/source/blender/editors/gpencil/gpencil_primitive.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_handlers.c (+8, -8) (Diff)
/source/blender/editors/interface/interface_utils.c (+1, -1) (Diff)
/source/blender/editors/mask/mask_ops.c (+2, -2) (Diff)
/source/blender/editors/mesh/editmesh_utils.c (+1, -1) (Diff)
/source/blender/editors/render/render_preview.c (+2, -2) (Diff)
/source/blender/editors/screen/area.c (+5, -5) (Diff)
/source/blender/editors/screen/area_utils.c (+1, -1) (Diff)
/source/blender/editors/screen/screen_edit.c (+8, -8) (Diff)
/source/blender/editors/screen/screen_ops.c (+10, -10) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+2, -2) (Diff)
/source/blender/editors/sculpt_paint/paint_stroke.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/sculpt.c (+6, -5) (Diff)
/source/blender/editors/space_clip/tracking_ops.c (+1, -1) (Diff)
/source/blender/editors/space_clip/tracking_ops_plane.c (+1, -1) (Diff)
/source/blender/editors/space_image/image_undo.c (+5, -5) (Diff)
/source/blender/editors/space_node/drawnode.c (+3, -3) (Diff)
/source/blender/editors/space_view3d/view3d_edit.c (+2, -2) (Diff)
/source/blender/editors/transform/transform_snap_object.c (+8, -8) (Diff)
/source/blender/editors/uvedit/uvedit_ops.c (+1, -1) (Diff)
/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c (+1, -1) (Diff)
/source/blender/gpu/intern/gpu_buffers.c (+3, -3) (Diff)
/source/blender/ikplugin/intern/iksolver_plugin.c (+1, -1) (Diff)
/source/blender/makesrna/intern/makesrna.c (+2, -1) (Diff)
/source/blender/modifiers/intern/MOD_hook.c (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_screw.c (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_warp.c (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_weld.c (+1, -1) (Diff)
/source/blender/python/mathutils/mathutils_bvhtree.c (+1, -1) (Diff)
/source/blender/render/intern/source/initrender.c (+1, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021