From f5028d985b0865b94136a03e05a699629eb5dce3 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Sun, 12 Nov 2023 11:28:21 +0100 Subject: [PATCH 1/2] Fix warning according to #3889 --- .../src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp index 424db156a..dfb1eb651 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp @@ -56,9 +56,6 @@ PYBIND11_MODULE(Simulation, simulation) sofa::simulation::core::init(); sofa::simulation::graph::init(); - if(!sofa::simulation::getSimulation()) - sofa::simulation::setSimulation(new DAGSimulation()); - simulation.doc() =sofapython3::doc::simulation::Class; simulation.def("print", [](Node* n){ sofa::simulation::node::print(n); }, sofapython3::doc::simulation::print); From 925989ba29860e4062c7651b832fd83defb659f4 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Sun, 12 Nov 2023 12:36:13 +0100 Subject: [PATCH 2/2] fix warnings in PythonEnv: strcmp, hidden overload --- Plugin/src/SofaPython3/PythonEnvironment.cpp | 2 +- Plugin/src/SofaPython3/PythonEnvironment.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugin/src/SofaPython3/PythonEnvironment.cpp b/Plugin/src/SofaPython3/PythonEnvironment.cpp index d347e737e..ce7317678 100644 --- a/Plugin/src/SofaPython3/PythonEnvironment.cpp +++ b/Plugin/src/SofaPython3/PythonEnvironment.cpp @@ -289,7 +289,7 @@ void PythonEnvironment::Init() for( const auto& elem : map) { Plugin p = elem.second; - if ( p.getModuleName() == sofa_tostring(SOFA_TARGET) ) + if ( strcmp(p.getModuleName(), sofa_tostring(SOFA_TARGET)) == 0 ) { pluginLibraryPath = elem.first; } diff --git a/Plugin/src/SofaPython3/PythonEnvironment.h b/Plugin/src/SofaPython3/PythonEnvironment.h index 29a4be9e4..6820c6d85 100644 --- a/Plugin/src/SofaPython3/PythonEnvironment.h +++ b/Plugin/src/SofaPython3/PythonEnvironment.h @@ -119,6 +119,7 @@ class SOFAPYTHON3_API PythonEnvironment /// to be able to react when a scene is loaded struct SceneLoaderListerner : public SceneLoader::Listener { + using SceneLoader::Listener::rightBeforeLoadingScene; /// possibly unload python modules to force importing their eventual modifications virtual void rightBeforeLoadingScene(); static SceneLoaderListerner* getInstance() {