Skip to content

Commit e1601bf

Browse files
hugtalbothugtalbot
andauthored
Remove some compilation warnings (#271)
Co-authored-by: hugtalbot <hugo.talbot@inria.fr>
1 parent 2905295 commit e1601bf

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

SofaGLFW/src/SofaGLFW/BaseGUIEngine.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ class BaseGUIEngine
4848
virtual bool dispatchMouseEvents() = 0;
4949
virtual void resetCounter() = 0;
5050
virtual sofa::type::Vec2i getFrameBufferPixels(std::vector<uint8_t>& pixels) = 0;
51-
virtual void openFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot) {};
52-
virtual void loadFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot, std::string filePathName, bool reload = false) {};
53-
virtual void contentScaleChanged(float xscale, float yscale) {}
51+
virtual void openFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot) { SOFA_UNUSED(baseGUI); SOFA_UNUSED(groot); };
52+
virtual void loadFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot, std::string filePathName, bool reload = false)
53+
{ SOFA_UNUSED(baseGUI); SOFA_UNUSED(groot); SOFA_UNUSED(filePathName); SOFA_UNUSED(reload); };
54+
virtual void contentScaleChanged(float xscale, float yscale) { SOFA_UNUSED(xscale); SOFA_UNUSED(yscale); };
5455
};
5556

5657
} // namespace sofaglfw

SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void ImGuiGUIEngine::openFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sp
298298
void ImGuiGUIEngine::saveScreenshot(sofaglfw::SofaGLFWBaseGUI* baseGUI)
299299
{
300300
nfdchar_t *outPath;
301-
std::array<nfdfilteritem_t, 1> filterItem{ {"Image", "jpg,png"} };
301+
std::array<nfdfilteritem_t, 1> filterItem{ { {"Image", "jpg,png"} } };
302302
const auto sceneFilename = baseGUI->getSceneFileName();
303303
std::string baseFilename{};
304304
if (!sceneFilename.empty())
@@ -922,6 +922,7 @@ bool ImGuiGUIEngine::dispatchMouseEvents()
922922

923923
void ImGuiGUIEngine::contentScaleChanged(float xscale, float yscale)
924924
{
925+
SOFA_UNUSED(xscale);
925926
loadFont(yscale);
926927
}
927928

SofaImGui/src/SofaImGui/windows/Profiler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace windows {
8080
sofa::type::vector<sofa::helper::Record> _records = sofa::helper::AdvancedTimer::getRecords("Animate");
8181
allRecords.emplace_back(std::move(_records));
8282

83-
while (allRecords.size() >= bufferSize)
83+
while ((int)allRecords.size() >= bufferSize)
8484
{
8585
allRecords.pop_front();
8686
}
@@ -126,7 +126,7 @@ namespace windows {
126126
sofa::helper::system::thread::ctime_t t0;
127127
for (const auto& rec : records)
128128
{
129-
if (timerId == rec.id)
129+
if (timerId == (int)rec.id)
130130
{
131131
chart.label = rec.label;
132132
if (rec.type == sofa::helper::Record::RBEGIN || rec.type == sofa::helper::Record::RSTEP_BEGIN || rec.type == sofa::helper::Record::RSTEP)
@@ -168,7 +168,7 @@ namespace windows {
168168
ImGui::SliderInt("Frame", &selectedFrame, 0, allRecords.size());
169169

170170

171-
if (selectedFrame >= 0 && selectedFrame < allRecords.size())
171+
if (selectedFrame >= 0 && selectedFrame < (int)allRecords.size())
172172
{
173173
const auto records = allRecords[selectedFrame];
174174
if (!records.empty())

SofaImGui/src/SofaImGui/windows/ViewPort.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace windows
6969
* @param threshold The precision threshold to determine significant movement.
7070
* @return True if the viewport has moved beyond the threshold, false otherwise.
7171
*/
72-
static bool hasViewportMoved(float currentX,
72+
[[maybe_unused]] static bool hasViewportMoved(float currentX,
7373
float currentY,
7474
float lastX,
7575
float lastY,

0 commit comments

Comments
 (0)