From c50e5fcc344d00b03eb4a3141b5b45944c3570fd Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 7 Aug 2020 18:24:59 +0200 Subject: Cleanup: use C++ style casts in various places --- source/blender/blenkernel/intern/simulation.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/simulation.cc') diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc index c0fc8fcb464..6b03721cab8 100644 --- a/source/blender/blenkernel/intern/simulation.cc +++ b/source/blender/blenkernel/intern/simulation.cc @@ -295,21 +295,20 @@ using StateTypeMap = blender::Map static void add_state_type(StateTypeMap &map, - const char *name, void (*init)(T *state), void (*reset)(T *state), void (*remove)(T *state), void (*copy)(const T *src, T *dst)) { SimulationStateType state_type{ - name, - (int)sizeof(T), + BKE_simulation_get_state_type_name(), + static_cast(sizeof(T)), (StateInitFunction)init, (StateResetFunction)reset, (StateRemoveFunction)remove, (StateCopyFunction)copy, }; - map.add_new(name, std::make_unique(state_type)); + map.add_new(state_type.name, std::make_unique(state_type)); } static StateTypeMap init_state_types() @@ -317,7 +316,6 @@ static StateTypeMap init_state_types() StateTypeMap map; add_state_type( map, - SIM_TYPE_NAME_PARTICLE_SIMULATION, [](ParticleSimulationState *state) { CustomData_reset(&state->attributes); }, [](ParticleSimulationState *state) { CustomData_free(&state->attributes, state->tot_particles); @@ -337,7 +335,6 @@ static StateTypeMap init_state_types() add_state_type( map, - SIM_TYPE_NAME_PARTICLE_MESH_EMITTER, [](ParticleMeshEmitterSimulationState *UNUSED(state)) {}, [](ParticleMeshEmitterSimulationState *state) { state->last_birth_time = 0.0f; }, [](ParticleMeshEmitterSimulationState *UNUSED(state)) {}, -- cgit v1.2.3