From 7de0bb85068470301aa42ffad399bcec1f007a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Tue, 17 Dec 2024 20:26:04 +0100 Subject: [PATCH] Fix some warnings --- src/PowderToySDLEmscripten.cpp | 2 +- src/gui/options/OptionsView.cpp | 2 +- src/gui/render/RenderView.cpp | 2 +- src/lua/CommandInterface.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PowderToySDLEmscripten.cpp b/src/PowderToySDLEmscripten.cpp index 591c32d2d..42b84f504 100644 --- a/src/PowderToySDLEmscripten.cpp +++ b/src/PowderToySDLEmscripten.cpp @@ -22,7 +22,7 @@ void SetFpsLimit(FpsLimit newFpsLimit) emscripten_set_main_loop(MainLoopBody, 0, 0); mainLoopSet = true; } - if (auto *fpsLimitVsync = std::get_if(&newFpsLimit)) + if (std::get_if(&newFpsLimit)) { emscripten_set_main_loop_timing(EM_TIMING_RAF, 1); std::cerr << "implicit fps limit via vsync" << std::endl; diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index 3c53d9772..b1fe5bfaa 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -359,7 +359,7 @@ OptionsView::OptionsView() : ui::Window(ui::Point(-1, -1), ui::Point(320, 340)) addSeparator(); auto *creditsButton = new ui::Button(ui::Point(10, currentY), ui::Point(90, 16), "Credits"); - creditsButton->SetActionCallback({ [this] { + creditsButton->SetActionCallback({ [] { auto *credits = new Credits(); ui::Engine::Ref().ShowWindow(credits); } }); diff --git a/src/gui/render/RenderView.cpp b/src/gui/render/RenderView.cpp index 5a59fcea9..e4d84e5d3 100644 --- a/src/gui/render/RenderView.cpp +++ b/src/gui/render/RenderView.cpp @@ -49,7 +49,7 @@ RenderView::RenderView(): renderModes.push_back(renderModeCheckbox); renderModeCheckbox->mode = mode; renderModeCheckbox->SetIcon(icon); - renderModeCheckbox->SetActionCallback({ [this, renderModeCheckbox] { + renderModeCheckbox->SetActionCallback({ [this] { auto renderMode = CalculateRenderMode(); c->SetRenderMode(renderMode); } }); diff --git a/src/lua/CommandInterface.cpp b/src/lua/CommandInterface.cpp index ee9b2f085..e6adbe066 100644 --- a/src/lua/CommandInterface.cpp +++ b/src/lua/CommandInterface.cpp @@ -364,11 +364,11 @@ AnyType CommandInterface::tptS_set(std::deque * words) // assume that value can be anything if (value.GetType() == TypeNumber && propInfo.Type == StructProperty::Float) { - value = FloatType(NumberType(value).Value()); + value = FloatType(float(NumberType(value).Value())); } if (value.GetType() == TypeFloat && propInfo.Type != StructProperty::Float) { - value = NumberType(FloatType(value).Value()); + value = NumberType(int(FloatType(value).Value())); } // value can still be almost anything, but if it was NumberType or FloatType, // at least it now matches the float-ness, if not the signedness, of prop