Fix some warnings

This commit is contained in:
Tamás Bálint Misius
2024-12-17 20:26:04 +01:00
parent 6762744afa
commit 7de0bb8506
4 changed files with 5 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ void SetFpsLimit(FpsLimit newFpsLimit)
emscripten_set_main_loop(MainLoopBody, 0, 0);
mainLoopSet = true;
}
if (auto *fpsLimitVsync = std::get_if<FpsLimitVsync>(&newFpsLimit))
if (std::get_if<FpsLimitVsync>(&newFpsLimit))
{
emscripten_set_main_loop_timing(EM_TIMING_RAF, 1);
std::cerr << "implicit fps limit via vsync" << std::endl;

View File

@@ -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);
} });

View File

@@ -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);
} });

View File

@@ -364,11 +364,11 @@ AnyType CommandInterface::tptS_set(std::deque<String> * 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