diff options
-rw-r--r-- | ganv/Canvas.hpp | 2 | ||||
-rw-r--r-- | ganv/Edge.hpp | 8 | ||||
-rw-r--r-- | ganv/Item.hpp | 2 | ||||
-rw-r--r-- | ganv/Node.hpp | 2 | ||||
-rw-r--r-- | ganv/wrap.hpp | 4 | ||||
-rw-r--r-- | src/Port.cpp | 2 | ||||
-rw-r--r-- | src/color.h | 5 | ||||
-rw-r--r-- | src/ganv_bench.cpp | 8 |
8 files changed, 15 insertions, 18 deletions
diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index d3b2281..1a11408 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -150,7 +150,7 @@ namespace Glib { static inline Ganv::Canvas* wrap(GanvCanvas* canvas) { - return (Ganv::Canvas*)ganv_canvas_get_wrapper(canvas); + return static_cast<Ganv::Canvas*>(ganv_canvas_get_wrapper(canvas)); } } // namespace Glib diff --git a/ganv/Edge.hpp b/ganv/Edge.hpp index 5c60711..eb723e5 100644 --- a/ganv/Edge.hpp +++ b/ganv/Edge.hpp @@ -48,8 +48,8 @@ public: tail->gobj(), head->gobj(), "color", color, - "curved", (gboolean)curved, - "arrowhead", (gboolean)show_arrowhead, + "curved", static_cast<gboolean>(curved), + "arrowhead", static_cast<gboolean>(show_arrowhead), NULL))) {} @@ -77,8 +77,8 @@ public: METHODRETWRAP0(ganv_edge, Node*, get_tail) METHODRETWRAP0(ganv_edge, Node*, get_head) - GanvEdge* gobj() { return (GanvEdge*)_gobj; } - const GanvEdge* gobj() const { return (GanvEdge*)_gobj; } + GanvEdge* gobj() { return reinterpret_cast<GanvEdge*>(_gobj); } + const GanvEdge* gobj() const { return reinterpret_cast<GanvEdge*>(_gobj); } private: Edge(const Edge& copy); diff --git a/ganv/Item.hpp b/ganv/Item.hpp index 1d090d3..ebeb865 100644 --- a/ganv/Item.hpp +++ b/ganv/Item.hpp @@ -81,7 +81,7 @@ private: GdkEvent* ev, void* item) { - return ((Item*)item)->signal_event().emit(ev); + return static_cast<Item*>(item)->signal_event().emit(ev); } }; diff --git a/ganv/Node.hpp b/ganv/Node.hpp index 2dd9dbc..f83ac8f 100644 --- a/ganv/Node.hpp +++ b/ganv/Node.hpp @@ -97,7 +97,7 @@ private: gpointer signal) { gboolean value; g_object_get(gobj, g_param_spec_get_name(pspec), &value, NULL); - ((sigc::signal<bool, gboolean>*)signal)->emit(value); + static_cast<sigc::signal<bool, gboolean>*>(signal)->emit(value); } }; diff --git a/ganv/wrap.hpp b/ganv/wrap.hpp index 4affe83..6e331df 100644 --- a/ganv/wrap.hpp +++ b/ganv/wrap.hpp @@ -115,7 +115,7 @@ private: \ wrap(Ganv##Name* gobj) \ { \ if (gobj) { \ - return (Ganv::Name*)ganv_item_get_wrapper(GANV_ITEM(gobj)); \ + return static_cast<Ganv::Name*>(ganv_item_get_wrapper(GANV_ITEM(gobj))); \ } else { \ return NULL; \ } \ @@ -125,7 +125,7 @@ private: \ wrap(const Ganv##Name* gobj) \ { \ if (gobj) { \ - return (const Ganv::Name*)ganv_item_get_wrapper(GANV_ITEM(gobj)); \ + return static_cast<const Ganv::Name*>(ganv_item_get_wrapper(GANV_ITEM(gobj))); \ } else { \ return NULL; \ } \ 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); |