diff --git a/SofaKernel/framework/sofa/helper/system/PluginManager.cpp b/SofaKernel/framework/sofa/helper/system/PluginManager.cpp index ff51901a397..960557a87ca 100644 --- a/SofaKernel/framework/sofa/helper/system/PluginManager.cpp +++ b/SofaKernel/framework/sofa/helper/system/PluginManager.cpp @@ -228,7 +228,7 @@ bool PluginManager::unloadPlugin(const std::string &pluginPath, std::ostream* er } } -Plugin* PluginManager::getPlugin(const std::string& plugin, const std::string& suffix, bool ignoreCase) +Plugin* PluginManager::getPlugin(const std::string& plugin, const std::string& /*suffix*/, bool /*ignoreCase*/) { std::string pluginPath = plugin; diff --git a/SofaKernel/framework/sofa/helper/system/PluginManager.h b/SofaKernel/framework/sofa/helper/system/PluginManager.h index 1983ccbd3d5..f3e7b2e0df2 100644 --- a/SofaKernel/framework/sofa/helper/system/PluginManager.h +++ b/SofaKernel/framework/sofa/helper/system/PluginManager.h @@ -182,7 +182,7 @@ class SOFA_HELPER_API PluginManager PluginMap& getPluginMap() { return m_pluginMap; } - Plugin* getPlugin(const std::string& plugin, const std::string& suffix = getDefaultSuffix(), bool ignoreCase = true); + Plugin* getPlugin(const std::string& plugin, const std::string& = getDefaultSuffix(), bool = true); std::vector& getSearchPaths() { return m_searchPaths; } diff --git a/SofaKernel/modules/SofaBaseLinearSolver/MatrixLinearSolver.h b/SofaKernel/modules/SofaBaseLinearSolver/MatrixLinearSolver.h index fe6e3ad3636..f84346a5eed 100644 --- a/SofaKernel/modules/SofaBaseLinearSolver/MatrixLinearSolver.h +++ b/SofaKernel/modules/SofaBaseLinearSolver/MatrixLinearSolver.h @@ -227,7 +227,7 @@ class MatrixLinearSolver : public BaseMatrixLinea defaulttype::BaseMatrix* getSystemBaseMatrix() override { return currentGroup->systemMatrix; } /// Get the MultiMatrix view of the linear system, or NULL if this solved does not build it - const core::behavior::MultiMatrixAccessor* getSystemMultiMatrixAccessor() const { return ¤tGroup->matrixAccessor; } + const core::behavior::MultiMatrixAccessor* getSystemMultiMatrixAccessor() const override { return ¤tGroup->matrixAccessor; } /// Get the linear system right-hand term vector, or NULL if this solver does not build it defaulttype::BaseVector* getSystemRHBaseVector() override { return currentGroup->systemRHVector; } diff --git a/SofaKernel/modules/SofaBaseMechanics/DiagonalMass.h b/SofaKernel/modules/SofaBaseMechanics/DiagonalMass.h index 8cd0d65a229..7918ef4fd7d 100644 --- a/SofaKernel/modules/SofaBaseMechanics/DiagonalMass.h +++ b/SofaKernel/modules/SofaBaseMechanics/DiagonalMass.h @@ -336,7 +336,7 @@ class DiagonalMass : public core::behavior::Mass } //Temporary function to warn the user when old attribute names are used - void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) + void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) override { if (arg->getAttribute("mass")) { diff --git a/SofaKernel/modules/SofaBaseMechanics/UniformMass.h b/SofaKernel/modules/SofaBaseMechanics/UniformMass.h index b72ba0e135d..2f0afc34060 100644 --- a/SofaKernel/modules/SofaBaseMechanics/UniformMass.h +++ b/SofaKernel/modules/SofaBaseMechanics/UniformMass.h @@ -159,7 +159,7 @@ class UniformMass : public core::behavior::Mass //Temporary function to warn the user when old attribute names are used - void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) + void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) override { if (arg->getAttribute("mass")) { diff --git a/SofaKernel/modules/SofaBaseVisual/BaseCamera.cpp b/SofaKernel/modules/SofaBaseVisual/BaseCamera.cpp index f4fbb27e9c5..0befd3faa59 100644 --- a/SofaKernel/modules/SofaBaseVisual/BaseCamera.cpp +++ b/SofaKernel/modules/SofaBaseVisual/BaseCamera.cpp @@ -832,7 +832,7 @@ void BaseCamera::handleEvent(sofa::core::objectmodel::Event* event) updateOutputData(); } -void BaseCamera::draw(const sofa::core::visual::VisualParams* params) +void BaseCamera::draw(const sofa::core::visual::VisualParams* /*params*/) { } diff --git a/applications/plugins/MultiThreading/src/TaskScheduler.cpp b/applications/plugins/MultiThreading/src/TaskScheduler.cpp index 44fd5e84cc8..7cdbb82d92f 100644 --- a/applications/plugins/MultiThreading/src/TaskScheduler.cpp +++ b/applications/plugins/MultiThreading/src/TaskScheduler.cpp @@ -200,7 +200,7 @@ namespace sofa return true; } - std::thread* WorkerThread::create_and_attach( TaskScheduler* const & taskScheduler) + std::thread* WorkerThread::create_and_attach( TaskScheduler* const & /*taskScheduler*/) { _stdThread = std::thread(std::bind(&WorkerThread::run, this)); return &_stdThread; diff --git a/applications/plugins/MultiThreading/src/TaskScheduler.h b/applications/plugins/MultiThreading/src/TaskScheduler.h index 0105fc8ec04..08e8b1705a5 100644 --- a/applications/plugins/MultiThreading/src/TaskScheduler.h +++ b/applications/plugins/MultiThreading/src/TaskScheduler.h @@ -80,7 +80,7 @@ namespace sofa bool start(TaskScheduler* const& taskScheduler); - std::thread* create_and_attach( TaskScheduler* const& taskScheduler); + std::thread* create_and_attach(TaskScheduler* const&); // queue task if there is space (or do nothing) bool pushTask(Task* pTask); diff --git a/applications/plugins/MultiThreading/src/Tasks.h b/applications/plugins/MultiThreading/src/Tasks.h index ee2cce27796..c2a3a5cd431 100644 --- a/applications/plugins/MultiThreading/src/Tasks.h +++ b/applications/plugins/MultiThreading/src/Tasks.h @@ -89,8 +89,8 @@ namespace sofa private: - Task(const Task& task) {} - Task& operator= (const Task& task) {return *this;} + Task(const Task& /*task*/) {} + Task& operator= (const Task& /*task*/) {return *this;} protected: diff --git a/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp b/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp index c65d302e7a1..e5133403db9 100644 --- a/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp +++ b/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp @@ -220,7 +220,6 @@ SofaPhysicsSimulation::SofaPhysicsSimulation(bool useGUI_, int GUIFramerate_) { sofa::gui::initMain(); - int argc= 1; char* argv[]= { const_cast("a") }; if (sofa::gui::GUIManager::Init(argv[0],"qt")) diff --git a/applications/projects/getDeprecatedComponents/main.cpp b/applications/projects/getDeprecatedComponents/main.cpp index afbf0f0eddc..166015ca4bb 100644 --- a/applications/projects/getDeprecatedComponents/main.cpp +++ b/applications/projects/getDeprecatedComponents/main.cpp @@ -3,7 +3,7 @@ using sofa::helper::lifecycle::deprecatedComponents; -int main(int argc, char **argv) +int main(int /*argc*/, char **/*argv*/) { for (const auto& component : deprecatedComponents) { diff --git a/applications/sofa/gui/headlessRecorder/VideoRecorderFFMpeg.cpp b/applications/sofa/gui/headlessRecorder/VideoRecorderFFMpeg.cpp index cc09aee5355..467e5389813 100644 --- a/applications/sofa/gui/headlessRecorder/VideoRecorderFFMpeg.cpp +++ b/applications/sofa/gui/headlessRecorder/VideoRecorderFFMpeg.cpp @@ -76,8 +76,10 @@ void VideoRecorderFFmpeg::start(void) exit(1); } st->id = oc->nb_streams-1; - //enc = avcodec_alloc_context3(codec); - enc = st->codec; + + AVCodec *pCodec = avcodec_find_decoder(st->codecpar->codec_id); + enc = avcodec_alloc_context3(pCodec); + if (!enc) { msg_error("VideoRecorder") << "Could not allocate video codec context"; exit(1); @@ -192,8 +194,8 @@ void VideoRecorderFFmpeg::stop(void) // Write the file trailer, if any av_write_trailer(oc); - // Close the codec - avcodec_close(st->codec); + // Free the codec context + avcodec_free_context(&enc); //sws_freeContext(sws_context); if (!(oc->oformat->flags & AVFMT_NOFILE)) diff --git a/applications/sofa/gui/qt/viewer/qt/QtViewer.cpp b/applications/sofa/gui/qt/viewer/qt/QtViewer.cpp index f4080d38b16..113ddc96268 100644 --- a/applications/sofa/gui/qt/viewer/qt/QtViewer.cpp +++ b/applications/sofa/gui/qt/viewer/qt/QtViewer.cpp @@ -1709,9 +1709,13 @@ void QtViewer::screenshot(const std::string& filename, int compression_level) screenshot = this->grabFramebuffer(); bool res = screenshot.save(filename.c_str(), nullptr, (compression_level == -1) ? -1 : compression_level*100); // compression_level is either -1 or [0,100] if(res) + { msg_info("QtViewer") << "Saved " << screenshot.width() << "x" << screenshot.height() << " screen image to " << filename; + } else + { msg_error("QtViewer") << "Unknown error while saving screen image to " << filename; + } } }// namespace qt diff --git a/modules/SofaConstraint/LinearSolverConstraintCorrection.h b/modules/SofaConstraint/LinearSolverConstraintCorrection.h index bde1b847d05..30b30237fec 100644 --- a/modules/SofaConstraint/LinearSolverConstraintCorrection.h +++ b/modules/SofaConstraint/LinearSolverConstraintCorrection.h @@ -76,7 +76,7 @@ class LinearSolverConstraintCorrection : public sofa::core::behavior::Constraint virtual void addComplianceInConstraintSpace(const sofa::core::ConstraintParams *cparams, defaulttype::BaseMatrix* W) override; - virtual void getComplianceMatrix(defaulttype::BaseMatrix* ) const; + virtual void getComplianceMatrix(defaulttype::BaseMatrix* ) const override; virtual void computeMotionCorrection(const core::ConstraintParams* cparams, core::MultiVecDerivId dx, core::MultiVecDerivId f) override; diff --git a/modules/SofaOpenglVisual/Light.cpp b/modules/SofaOpenglVisual/Light.cpp index d9cdd7fc5e7..4ac1fa1a9cf 100644 --- a/modules/SofaOpenglVisual/Light.cpp +++ b/modules/SofaOpenglVisual/Light.cpp @@ -677,7 +677,7 @@ void PositionalLight::drawLight() } -void PositionalLight::drawSource(const core::visual::VisualParams* vparams) +void PositionalLight::drawSource(const core::visual::VisualParams* /*vparams*/) { Vector3 sceneMinBBox, sceneMaxBBox; sofa::simulation::getSimulation()->computeBBox((sofa::simulation::Node*)this->getContext(), sceneMinBBox.ptr(), sceneMaxBBox.ptr()); diff --git a/modules/SofaOpenglVisual/Light.h b/modules/SofaOpenglVisual/Light.h index a8a05d75e25..a0db1f00d3f 100644 --- a/modules/SofaOpenglVisual/Light.h +++ b/modules/SofaOpenglVisual/Light.h @@ -175,7 +175,7 @@ class SOFA_OPENGL_VISUAL_API PositionalLight : public Light virtual ~PositionalLight(); virtual void drawLight() override; virtual void draw(const core::visual::VisualParams* vparams) override; - virtual void drawSource(const core::visual::VisualParams* vparams) override; + virtual void drawSource(const core::visual::VisualParams*) override; virtual const sofa::defaulttype::Vector3 getPosition() override { return d_position.getValue(); } LightType getLightType() override { return LightType::POSITIONAL; } }; diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.cpp b/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.cpp index cf1c4d2ca11..4eb08395d36 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.cpp +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.cpp @@ -77,8 +77,14 @@ void ShewchukPCGLinearSolver::init() c->get(m_preconditioners, f_preconditioners.getValue()); - if (m_preconditioners) msg_info() << "Found " << f_preconditioners.getValue(); - else msg_error() << "Solver \"" << f_preconditioners.getValue() << "\" not found."; + if(m_preconditioners) + { + msg_info() << "Found " << f_preconditioners.getValue(); + } + else + { + msg_error() << "Solver \"" << f_preconditioners.getValue() << "\" not found."; + } } first = true;