summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-26 22:42:29 -0400
committerDavid Robillard <d@drobilla.net>2022-05-26 23:06:12 -0400
commit6553f2f2340df4ae0de26d2145c4dcbf66d4536a (patch)
tree5582bef5d1158693b3614f26c5a03accf3553832 /src
parent77171e1e17c8a852acb7ce20479e7dd5ec4567be (diff)
downloadpatchage-6553f2f2340df4ae0de26d2145c4dcbf66d4536a.tar.gz
patchage-6553f2f2340df4ae0de26d2145c4dcbf66d4536a.tar.bz2
patchage-6553f2f2340df4ae0de26d2145c4dcbf66d4536a.zip
Fix implicit floating point conversion
GCC 12 warns about this with Wdouble-promotion.
Diffstat (limited to 'src')
-rw-r--r--src/Patchage.cpp4
-rw-r--r--src/Reactor.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index 2636066..86d5dbf 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -540,7 +540,7 @@ Patchage::operator()(const setting::JackAttached& setting)
void
Patchage::operator()(const setting::FontSize& setting)
{
- if (_canvas->get_font_size() != setting.value) {
+ if (static_cast<float>(_canvas->get_font_size()) != setting.value) {
_canvas->set_font_size(setting.value);
}
}
@@ -715,7 +715,7 @@ Patchage::operator()(const setting::WindowSize& setting)
void
Patchage::operator()(const setting::Zoom& setting)
{
- if (_canvas->get_zoom() != setting.value) {
+ if (static_cast<float>(_canvas->get_zoom()) != setting.value) {
_canvas->set_zoom(setting.value);
}
}
diff --git a/src/Reactor.cpp b/src/Reactor.cpp
index c79fee0..6b141f8 100644
--- a/src/Reactor.cpp
+++ b/src/Reactor.cpp
@@ -81,7 +81,7 @@ Reactor::operator()(const action::ConnectPorts& action)
void
Reactor::operator()(const action::DecreaseFontSize&)
{
- _conf.set<setting::FontSize>(_conf.get<setting::FontSize>() - 1.0);
+ _conf.set<setting::FontSize>(_conf.get<setting::FontSize>() - 1.0f);
}
void
@@ -119,7 +119,7 @@ Reactor::operator()(const action::DisconnectPorts& action)
void
Reactor::operator()(const action::IncreaseFontSize&)
{
- _conf.set<setting::FontSize>(_conf.get<setting::FontSize>() + 1.0);
+ _conf.set<setting::FontSize>(_conf.get<setting::FontSize>() + 1.0f);
}
void
@@ -165,7 +165,7 @@ Reactor::operator()(const action::ZoomFull&)
void
Reactor::operator()(const action::ZoomIn&)
{
- _conf.set<setting::Zoom>(_conf.get<setting::Zoom>() * 1.25);
+ _conf.set<setting::Zoom>(_conf.get<setting::Zoom>() * 1.25f);
}
void
@@ -177,7 +177,7 @@ Reactor::operator()(const action::ZoomNormal&)
void
Reactor::operator()(const action::ZoomOut&)
{
- _conf.set<setting::Zoom>(_conf.get<setting::Zoom>() * 0.75);
+ _conf.set<setting::Zoom>(_conf.get<setting::Zoom>() * 0.75f);
}
void