[libsigc++2] More use of nullptr instead of 0



commit 02339149a28e26151402076e8cf1abd00f7dd92b
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Oct 13 16:08:00 2015 +0200

    More use of nullptr instead of 0

 sigc++/connection.cc             |    3 +--
 sigc++/functors/macros/slot.h.m4 |    4 ++--
 sigc++/functors/slot_base.cc     |    4 ++--
 sigc++/macros/signal.h.m4        |   12 +++++-------
 sigc++/signal_base.cc            |    4 ++--
 5 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/sigc++/connection.cc b/sigc++/connection.cc
index 233d5df..e01bde0 100644
--- a/sigc++/connection.cc
+++ b/sigc++/connection.cc
@@ -1,4 +1,3 @@
-// -*- c++ -*-
 /*
  * Copyright 2002, The libsigc++ Development Team
  *
@@ -105,7 +104,7 @@ void* connection::notify(void* data)
 {
   auto self = reinterpret_cast<connection*>(data);
   self->slot_ = nullptr;
-  return 0;
+  return nullptr;
 }
 
 } /* namespace sigc */
diff --git a/sigc++/functors/macros/slot.h.m4 b/sigc++/functors/macros/slot.h.m4
index 27d19d2..22eeaa9 100644
--- a/sigc++/functors/macros/slot.h.m4
+++ b/sigc++/functors/macros/slot.h.m4
@@ -252,7 +252,7 @@ struct typed_slot_rep : public slot_rep
    * @param functor The functor contained by the new slot_rep object.
    */
   inline typed_slot_rep(const T_functor& functor)
-    : slot_rep(0, &destroy, &dup), functor_(functor)
+    : slot_rep(nullptr, &destroy, &dup), functor_(functor)
     { sigc::visit_each_type<trackable*>(slot_do_bind(this), functor_); }
 
   inline typed_slot_rep(const typed_slot_rep& cl)
@@ -280,7 +280,7 @@ struct typed_slot_rep : public slot_rep
        * a) from the parent itself (in which case disconnect() leads to a segfault) or
        * b) from a parentless slot (in which case disconnect() does nothing)
        */
-      return 0;
+      return nullptr;
     }
 
   /** Makes a deep copy of the slot_rep object.
diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc
index 88a91f9..c15c213 100644
--- a/sigc++/functors/slot_base.cc
+++ b/sigc++/functors/slot_base.cc
@@ -31,7 +31,7 @@ struct destroy_notify_struct
   {
     auto self_ = reinterpret_cast<destroy_notify_struct*>(data);
     self_->deleted_ = true;
-    return 0;
+    return nullptr;
   }
 
   bool deleted_;
@@ -91,7 +91,7 @@ void* slot_rep::notify(void* data)
     self_->destroy(); // Detach the stored functor from the other referred trackables and destroy it.
                       // destroy() might lead to deletion of self_. Bug #564005.
   }
-  return 0;
+  return nullptr;
 }
 
 } // namespace internal
diff --git a/sigc++/macros/signal.h.m4 b/sigc++/macros/signal.h.m4
index 89875ce..ac1e19e 100644
--- a/sigc++/macros/signal.h.m4
+++ b/sigc++/macros/signal.h.m4
@@ -704,10 +704,8 @@ struct slot_list
   #endif /* SIGC_HAVE_SUN_REVERSE_ITERATOR */
 
 
-
-
   slot_list()
-    : list_(0) {}
+    : list_(nullptr) {}
 
   explicit slot_list(internal::signal_impl* __list)
     : list_(__list) {}
@@ -808,7 +806,7 @@ struct slot_iterator_buf
   typedef signal_impl::const_iterator_type iterator_type;
 
   slot_iterator_buf()
-    : c_(0), invoked_(false) {}
+    : c_(nullptr), invoked_(false) {}
 
   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
     : i_(i), c_(c), invoked_(false) {}
@@ -885,7 +883,7 @@ struct slot_iterator_buf<T_emitter, void>
   typedef signal_impl::const_iterator_type iterator_type;
 
   slot_iterator_buf()
-    : c_(0), invoked_(false) {}
+    : c_(nullptr), invoked_(false) {}
 
   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
     : i_(i), c_(c), invoked_(false) {}
@@ -962,7 +960,7 @@ struct slot_reverse_iterator_buf
   typedef signal_impl::const_iterator_type iterator_type;
 
   slot_reverse_iterator_buf()
-    : c_(0), invoked_(false) {}
+    : c_(nullptr), invoked_(false) {}
 
   slot_reverse_iterator_buf(const iterator_type& i, const emitter_type* c)
     : i_(i), c_(c), invoked_(false) {}
@@ -1041,7 +1039,7 @@ struct slot_reverse_iterator_buf<T_emitter, void>
   typedef signal_impl::const_iterator_type iterator_type;
 
   slot_reverse_iterator_buf()
-    : c_(0), invoked_(false) {}
+    : c_(nullptr), invoked_(false) {}
 
   slot_reverse_iterator_buf(const iterator_type& i, const emitter_type* c)
     : i_(i), c_(c), invoked_(false) {}
diff --git a/sigc++/signal_base.cc b/sigc++/signal_base.cc
index 1504f62..c968216 100644
--- a/sigc++/signal_base.cc
+++ b/sigc++/signal_base.cc
@@ -34,7 +34,7 @@ struct self_and_iter
 };
 
 signal_impl::signal_impl()
-: ref_count_(0), exec_count_(0), deferred_(0)
+: ref_count_(0), exec_count_(0), deferred_(false)
 {}
 
 // only MSVC needs this to guarantee that all new/delete are executed from the DLL module
@@ -150,7 +150,7 @@ void* signal_impl::notify(void* d)
   }
   else                           // This is occuring during signal emission or slot erasure.
     si->self_->deferred_ = true; // => sweep() will be called from ~signal_exec() after signal emission.
-  return 0;                      // This is safer because we don't have to care about our
+  return nullptr;                // This is safer because we don't have to care about our
                                  // iterators in emit(), clear(), and erase().
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]