summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Port.cpp2
-rw-r--r--src/color.h5
-rw-r--r--src/ganv_bench.cpp8
3 files changed, 6 insertions, 9 deletions
diff --git a/src/Port.cpp b/src/Port.cpp
index 3f0d02b..73b04ce 100644
--- a/src/Port.cpp
+++ b/src/Port.cpp
@@ -28,7 +28,7 @@ namespace Ganv {
static void
on_value_changed(GanvPort* port, double value, void* portmm)
{
- ((Port*)portmm)->signal_value_changed.emit(value);
+ static_cast<Port*>(portmm)->signal_value_changed.emit(value);
}
/* Construct a Port on an existing module. */
diff --git a/src/color.h b/src/color.h
index ca52d98..97381fb 100644
--- a/src/color.h
+++ b/src/color.h
@@ -54,10 +54,7 @@ highlight_color(guint c, guint delta)
const guint b = MIN(((c >> 8) & 0xFF) + delta, max_char);
const guint a = c & 0xFF;
- return ((((guint)(r)) << 24) |
- (((guint)(g)) << 16) |
- (((guint)(b)) << 8) |
- (((guint)(a))));
+ return ((r << 24) | (g << 16) | (b << 8) | a);
}
#endif // GANV_UTIL_H
diff --git a/src/ganv_bench.cpp b/src/ganv_bench.cpp
index 11fc44e..5f723b3 100644
--- a/src/ganv_bench.cpp
+++ b/src/ganv_bench.cpp
@@ -39,8 +39,8 @@ make_module(Canvas* canvas)
snprintf(name, 8, "mod%d", rand() % 10000);
Module* m(new Module(*canvas, name,
- rand() % (int)canvas->get_width(),
- rand() % (int)canvas->get_height(),
+ rand() % static_cast<int>(canvas->get_width()),
+ rand() % static_cast<int>(canvas->get_height()),
true));
int n_ins = rand() % MAX_NUM_PORTS;
@@ -70,8 +70,8 @@ make_circle(Canvas* canvas)
snprintf(name, 8, "%d", rand() % 10000);
Circle* e(new Circle(*canvas, name,
- rand() % (int)canvas->get_width(),
- rand() % (int)canvas->get_height()));
+ rand() % static_cast<int>(canvas->get_width()),
+ rand() % static_cast<int>(canvas->get_height())));
ins.push_back(e);
outs.push_back(e);