[libsigcplusplus] Replace some reinterpret_cast<>s with static_casts<>.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] Replace some reinterpret_cast<>s with static_casts<>.
- Date: Sat, 16 Apr 2016 19:42:58 +0000 (UTC)
commit ba9e84fa765e3bc7492f3cd12f8ebb463f2f7536
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Apr 16 21:29:37 2016 +0200
Replace some reinterpret_cast<>s with static_casts<>.
This is particularly unnecessary now that we have the notifiable
base class.
sigc++/connection.cc | 2 +-
sigc++/functors/slot.h | 2 +-
sigc++/functors/slot_base.cc | 4 ++--
sigc++/functors/slot_base.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/sigc++/connection.cc b/sigc++/connection.cc
index 6772276..b7d3517 100644
--- a/sigc++/connection.cc
+++ b/sigc++/connection.cc
@@ -109,7 +109,7 @@ connection::set_slot(slot_base* sl)
void
connection::notify(notifiable* data)
{
- auto self = reinterpret_cast<connection*>(data);
+ auto self = static_cast<connection*>(data);
self->slot_ = nullptr;
}
diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h
index df4f80e..a66f376 100644
--- a/sigc++/functors/slot.h
+++ b/sigc++/functors/slot.h
@@ -67,7 +67,7 @@ private:
*/
static void destroy(notifiable* data)
{
- self* self_ = static_cast<self*>(reinterpret_cast<slot_rep*>(data));
+ self* self_ = static_cast<self*>(data);
self_->call_ = nullptr;
self_->destroy_ = nullptr;
sigc::visit_each_trackable(slot_do_unbind(self_), self_->functor_);
diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc
index 78130e2..a5cd529 100644
--- a/sigc++/functors/slot_base.cc
+++ b/sigc++/functors/slot_base.cc
@@ -29,7 +29,7 @@ struct destroy_notify_struct : public sigc::notifiable
static void notify(notifiable* data) noexcept
{
- auto self_ = reinterpret_cast<destroy_notify_struct*>(data);
+ auto self_ = static_cast<destroy_notify_struct*>(data);
self_->deleted_ = true;
}
@@ -79,7 +79,7 @@ slot_rep::disconnect()
void
slot_rep::notify(notifiable* data)
{
- auto self_ = reinterpret_cast<slot_rep*>(data);
+ auto self_ = static_cast<slot_rep*>(data);
self_->call_ = nullptr; // Invalidate the slot.
diff --git a/sigc++/functors/slot_base.h b/sigc++/functors/slot_base.h
index 8bc5dc9..7ad2d51 100644
--- a/sigc++/functors/slot_base.h
+++ b/sigc++/functors/slot_base.h
@@ -98,7 +98,7 @@ public:
*/
inline slot_rep* dup() const
{
- return reinterpret_cast<slot_rep*>((*dup_)(const_cast<slot_rep*>(this)));
+ return static_cast<slot_rep*>((*dup_)(const_cast<slot_rep*>(this)));
}
/** Set the parent with a callback.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]