Skip to content

Commit

Permalink
Merge pull request #739 from hugtalbot/fix_minor_warnings_201807
Browse files Browse the repository at this point in the history
[all] FIX warnings
  • Loading branch information
damienmarchal committed Aug 3, 2018
2 parents 50e0185 + e54bc49 commit 1e25866
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion SofaKernel/framework/sofa/helper/system/PluginManager.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion SofaKernel/framework/sofa/helper/system/PluginManager.h
Expand Up @@ -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<std::string>& getSearchPaths() { return m_searchPaths; }

Expand Down
Expand Up @@ -227,7 +227,7 @@ class MatrixLinearSolver<Matrix,Vector,NoThreadManager> : 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 &currentGroup->matrixAccessor; }
const core::behavior::MultiMatrixAccessor* getSystemMultiMatrixAccessor() const override { return &currentGroup->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; }
Expand Down
2 changes: 1 addition & 1 deletion SofaKernel/modules/SofaBaseMechanics/DiagonalMass.h
Expand Up @@ -336,7 +336,7 @@ class DiagonalMass : public core::behavior::Mass<DataTypes>
}

//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"))
{
Expand Down
2 changes: 1 addition & 1 deletion SofaKernel/modules/SofaBaseMechanics/UniformMass.h
Expand Up @@ -159,7 +159,7 @@ class UniformMass : public core::behavior::Mass<DataTypes>


//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"))
{
Expand Down
2 changes: 1 addition & 1 deletion SofaKernel/modules/SofaBaseVisual/BaseCamera.cpp
Expand Up @@ -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*/)
{
}

Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/MultiThreading/src/TaskScheduler.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/MultiThreading/src/TaskScheduler.h
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions applications/plugins/MultiThreading/src/Tasks.h
Expand Up @@ -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:
Expand Down
Expand Up @@ -220,7 +220,6 @@ SofaPhysicsSimulation::SofaPhysicsSimulation(bool useGUI_, int GUIFramerate_)
{
sofa::gui::initMain();

int argc= 1;
char* argv[]= { const_cast<char*>("a") };

if (sofa::gui::GUIManager::Init(argv[0],"qt"))
Expand Down
2 changes: 1 addition & 1 deletion applications/projects/getDeprecatedComponents/main.cpp
Expand Up @@ -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)
{
Expand Down
10 changes: 6 additions & 4 deletions applications/sofa/gui/headlessRecorder/VideoRecorderFFMpeg.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions applications/sofa/gui/qt/viewer/qt/QtViewer.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/SofaConstraint/LinearSolverConstraintCorrection.h
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion modules/SofaOpenglVisual/Light.cpp
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion modules/SofaOpenglVisual/Light.h
Expand Up @@ -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; }
};
Expand Down
Expand Up @@ -77,8 +77,14 @@ void ShewchukPCGLinearSolver<TMatrix,TVector>::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;
Expand Down

0 comments on commit 1e25866

Please sign in to comment.