summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AtomForge.cpp2
-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
-rw-r--r--src/server/ControlBindings.cpp4
-rw-r--r--src/server/InputPort.cpp2
-rw-r--r--src/server/Load.hpp4
-rw-r--r--src/server/internals/Controller.cpp2
9 files changed, 16 insertions, 16 deletions
diff --git a/src/AtomForge.cpp b/src/AtomForge.cpp
index 95edb2ea..727bd64e 100644
--- a/src/AtomForge.cpp
+++ b/src/AtomForge.cpp
@@ -107,7 +107,7 @@ AtomForge::deref(const intptr_t ref)
only dereference references to aligned atoms. */
LV2_Atom* const ptr = _buf.get();
assert((ref - 1) % sizeof(LV2_Atom) == 0);
- return static_cast<LV2_Atom*>(ptr + (ref - 1) / sizeof(LV2_Atom));
+ return static_cast<LV2_Atom*>(ptr + ((ref - 1) / sizeof(LV2_Atom)));
// Alternatively:
// return (LV2_Atom*)((uint8_t*)_buf.get() + ref - 1);
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)
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp
index 0d280e43..8b615974 100644
--- a/src/server/ControlBindings.cpp
+++ b/src/server/ControlBindings.cpp
@@ -296,7 +296,7 @@ ControlBindings::control_to_port_value(RunContext& ctx,
float max = 1.0f;
get_range(ctx, port, &min, &max);
- return normal * (max - min) + min;
+ return (normal * (max - min)) + min;
}
int16_t
@@ -325,7 +325,7 @@ ControlBindings::port_value_to_control(RunContext& ctx,
}
if (port->is_logarithmic()) {
- normal = logf(normal * (static_cast<float>(M_E) - 1.0f) + 1.0f);
+ normal = logf((normal * (static_cast<float>(M_E) - 1.0f)) + 1.0f);
}
switch (type) {
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index c22e8510..eac62d34 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -177,7 +177,7 @@ InputPort::pre_run(RunContext& ctx)
{
if ((_user_buffer || !_arcs.empty()) && !direct_connect()) {
const uint32_t src_poly = max_tail_poly(ctx);
- const uint32_t max_n_srcs = _arcs.size() * src_poly + 1;
+ const uint32_t max_n_srcs = (_arcs.size() * src_poly) + 1;
for (uint32_t v = 0; v < _poly; ++v) {
if (!buffer(v)->get<void>()) {
diff --git a/src/server/Load.hpp b/src/server/Load.hpp
index c2f1f3df..a5216f7e 100644
--- a/src/server/Load.hpp
+++ b/src/server/Load.hpp
@@ -38,8 +38,8 @@ struct Load {
mean = load;
changed = true;
} else {
- const float a = mean + (static_cast<float>(load) - mean) /
- static_cast<float>(++n);
+ const float a = mean + ((static_cast<float>(load) - mean) /
+ static_cast<float>(++n));
if (a != mean) {
changed = floorf(a) != floorf(mean);
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index cbc62eea..9103649e 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -172,7 +172,7 @@ ControllerNode::control(RunContext& ctx, uint8_t control_num, uint8_t val, Frame
}
const Sample min = logf(min_port_val + 1 + log_offset);
const Sample max = logf(max_port_val + 1 + log_offset);
- scaled_value = expf(nval * (max - min) + min) - 1 - log_offset;
+ scaled_value = expf((nval * (max - min)) + min) - 1 - log_offset;
} else {
scaled_value = ((nval) * (max_port_val - min_port_val)) + min_port_val;
}