summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/ConnectWindow.cpp12
-rw-r--r--src/gui/NodeMenu.cpp2
-rw-r--r--src/gui/WindowFactory.cpp2
-rw-r--r--src/gui/rgba.hpp2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 7265796a..edafdfa4 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -476,8 +476,8 @@ ConnectWindow::gtk_callback()
// Show if attempted connection goes on for a noticeable amount of time
if (!is_visible()) {
- const float ms_since_start = (now.tv_sec - start.tv_sec) * 1000.0f +
- (now.tv_usec - start.tv_usec) * 0.001f;
+ const float ms_since_start = ((now.tv_sec - start.tv_sec) * 1000.0f) +
+ ((now.tv_usec - start.tv_usec) * 0.001f);
if (ms_since_start > 500) {
present();
set_connecting_widget_states();
@@ -485,8 +485,8 @@ ConnectWindow::gtk_callback()
}
if (_connect_stage == 0) {
- const float ms_since_last = (now.tv_sec - last.tv_sec) * 1000.0f +
- (now.tv_usec - last.tv_usec) * 0.001f;
+ const float ms_since_last = ((now.tv_sec - last.tv_sec) * 1000.0f) +
+ ((now.tv_usec - last.tv_usec) * 0.001f);
if (ms_since_last >= 250) {
last = now;
if (_mode == Mode::INTERNAL) {
@@ -515,8 +515,8 @@ ConnectWindow::gtk_callback()
if (_attached) {
next_stage();
} else {
- const float ms_since_last = (now.tv_sec - last.tv_sec) * 1000.0f +
- (now.tv_usec - last.tv_usec) * 0.001f;
+ const float ms_since_last = ((now.tv_sec - last.tv_sec) * 1000.0f) +
+ ((now.tv_usec - last.tv_usec) * 0.001f);
if (attempts > 10) {
error("Failed to ping engine");
_connect_stage = -1;
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index b18101e3..2815194c 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -207,7 +207,7 @@ NodeMenu::on_menu_randomize()
bm->port_value_range(p, min, max, _app->sample_rate());
const auto r = static_cast<float>(g_random_double_range(0.0, 1.0));
- const float val = r * (max - min) + min;
+ const float val = (r * (max - min)) + min;
_app->set_property(p->uri(),
_app->uris().ingen_value,
_app->forge().make(val));
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index daaadfd3..78acf4fb 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -224,7 +224,7 @@ WindowFactory::present_load_plugin(
int width = 0;
int height = 0;
w->second->get_size(width, height);
- _load_plugin_win->set_default_size(width - width / 8, height / 2);
+ _load_plugin_win->set_default_size(width - (width / 8), height / 2);
}
_load_plugin_win->set_title(
std::string("Load Plugin - ") + graph->path() + " - Ingen");
diff --git a/src/gui/rgba.hpp b/src/gui/rgba.hpp
index bb53205e..e01a069d 100644
--- a/src/gui/rgba.hpp
+++ b/src/gui/rgba.hpp
@@ -34,7 +34,7 @@ rgba_to_uint(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
inline uint8_t
mono_interpolate(uint8_t v1, uint8_t v2, float f)
{
- return static_cast<uint8_t>(rintf((v2) * (f) + (v1) * (1 - (f))));
+ return static_cast<uint8_t>(rintf((v2 * f) + (v1 * (1.0f - f))));
}
#define RGBA_R(x) (static_cast<uint32_t>(x) >> 24)