[glibmm] Glib: More nullptr instead of 0.



commit b879555ffb731ba1fa9aabfd1520dd8ca88cd3c9
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Nov 20 10:09:46 2015 +0100

    Glib: More nullptr instead of 0.

 glib/glibmm/class.cc                      |   20 +++++++++---------
 glib/glibmm/containers.cc                 |    2 +-
 glib/glibmm/dispatcher.cc                 |    6 ++--
 glib/glibmm/error.cc                      |    4 +-
 glib/glibmm/interface.cc                  |    4 +-
 glib/glibmm/listhandle.h                  |    2 +-
 glib/glibmm/main.cc                       |   30 ++++++++++++++--------------
 glib/glibmm/object.cc                     |    6 ++--
 glib/glibmm/objectbase.cc                 |    8 +++---
 glib/glibmm/pattern.cc                    |    2 +-
 glib/glibmm/signalproxy_connectionnode.cc |    2 +-
 glib/glibmm/streamiochannel.cc            |    4 +-
 glib/glibmm/stringutils.cc                |    2 +-
 glib/glibmm/threadpool.cc                 |    2 +-
 glib/glibmm/timer.cc                      |    2 +-
 glib/glibmm/ustring.cc                    |   24 +++++++++++-----------
 glib/glibmm/value.cc                      |   16 +++++++-------
 glib/glibmm/vectorutils.h                 |   12 +++++-----
 glib/src/binding.ccg                      |    4 +-
 glib/src/convert.ccg                      |    2 +-
 glib/src/fileutils.ccg                    |    8 +++---
 glib/src/iochannel.ccg                    |    2 +-
 glib/src/markup.ccg                       |    4 +-
 glib/src/optioncontext.ccg                |    3 +-
 glib/src/thread.ccg                       |    2 +-
 glib/src/threads.ccg                      |    2 +-
 26 files changed, 88 insertions(+), 87 deletions(-)
---
diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc
index 1f23a5f..ab44e94 100644
--- a/glib/glibmm/class.cc
+++ b/glib/glibmm/class.cc
@@ -30,7 +30,7 @@ namespace Glib
 
 void Class::register_derived_type(GType base_type)
 {
-  return register_derived_type(base_type, 0);
+  return register_derived_type(base_type, nullptr);
 }
 
 void Class::register_derived_type(GType base_type, GTypeModule* module)
@@ -44,7 +44,7 @@ void Class::register_derived_type(GType base_type, GTypeModule* module)
   if(base_type == 0)
     return; // already initialized
 
-  GTypeQuery base_query = { 0, 0, 0, 0, };
+  GTypeQuery base_query = { 0, nullptr, 0, 0, };
   g_type_query(base_type, &base_query);
 
   //GTypeQuery::class_size is guint but GTypeInfo::class_size is guint16.
@@ -75,7 +75,7 @@ void Class::register_derived_type(GType base_type, GTypeModule* module)
     return;
   }
 
-  gchar* derived_name = g_strconcat("gtkmm__", base_query.type_name, (void*)0);
+  gchar* derived_name = g_strconcat("gtkmm__", base_query.type_name, nullptr);
 
   if(module)
     gtype_ = g_type_module_register_type(module, base_type, derived_name, &derived_info, GTypeFlags(0));
@@ -106,7 +106,7 @@ GType Class::clone_custom_type(const char* custom_type_name,
     // so that g_type_class_peek_parent() works correctly.
     const GType base_type = g_type_parent(gtype_);
 
-    GTypeQuery base_query = { 0, 0, 0, 0, };
+    GTypeQuery base_query = { 0, nullptr, 0, 0, };
     g_type_query(base_type, &base_query);
 
     //GTypeQuery::class_size is guint but GTypeInfo::class_size is guint16.
@@ -120,15 +120,15 @@ GType Class::clone_custom_type(const char* custom_type_name,
     const GTypeInfo derived_info =
     {
       class_size,
-      0, // base_init
+      nullptr, // base_init
       &Class::custom_class_base_finalize_function, // base_finalize
       &Class::custom_class_init_function,
-      0, // class_finalize
+      nullptr, // class_finalize
       this, // class_data
       instance_size,
       0, // n_preallocs
-      0, // instance_init
-      0, // value_table
+      nullptr, // instance_init
+      nullptr, // value_table
     };
 
     custom_type = g_type_register_static(
@@ -178,11 +178,11 @@ void Class::custom_class_init_function(void* g_class, void* class_data)
   // The class_data pointer is set to 'this' by clone_custom_type().
   const Class *const self = static_cast<Class*>(class_data);
 
-  g_return_if_fail(self->class_init_func_ != 0);
+  g_return_if_fail(self->class_init_func_ != nullptr);
 
   // Call the wrapper's class_init_function() to redirect
   // the vfunc and default signal handler callbacks.
-  (*self->class_init_func_)(g_class, 0);
+  (*self->class_init_func_)(g_class, nullptr);
 
   GObjectClass *const gobject_class = static_cast<GObjectClass*>(g_class);
   gobject_class->get_property = &Glib::custom_get_property_callback;
diff --git a/glib/glibmm/containers.cc b/glib/glibmm/containers.cc
index ff63565..07c61cd 100644
--- a/glib/glibmm/containers.cc
+++ b/glib/glibmm/containers.cc
@@ -26,7 +26,7 @@
 namespace Glib
 {
 
-gpointer glibmm_null_pointer=0;
+gpointer glibmm_null_pointer = nullptr;
 
 
 } //namespace Glib
diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc
index 5a206ff..3ab3a2f 100644
--- a/glib/glibmm/dispatcher.cc
+++ b/glib/glibmm/dispatcher.cc
@@ -58,7 +58,7 @@ struct DispatchNotifyData
   Glib::DispatchNotifier* notifier;
 
   DispatchNotifyData()
-    : dispatcher (0), notifier (0) {}
+    : dispatcher (nullptr), notifier (nullptr) {}
 
   DispatchNotifyData(Glib::Dispatcher* d, Glib::DispatchNotifier* n)
     : dispatcher (d), notifier (n) {}
@@ -280,7 +280,7 @@ DispatchNotifier* DispatchNotifier::reference_instance
   else
   {
     // Prevent massive mess-up.
-    g_return_val_if_fail(instance->context_ == context, 0);
+    g_return_val_if_fail(instance->context_ == context, nullptr);
 
     // In the possible but unlikely case that a new dispatcher gets the same
     // address as a newly deleted one, if the pipe still contains messages to
@@ -321,7 +321,7 @@ void DispatchNotifier::unreference_instance(
     g_return_if_fail(instance->ref_count_ == 0); // could be < 0 if messed up
 
     // This causes deletion of the notifier object.
-    thread_specific_instance_.replace(0);
+    thread_specific_instance_.replace(nullptr);
   }
 }
 
diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc
index 315ea71..fb7d210 100644
--- a/glib/glibmm/error.cc
+++ b/glib/glibmm/error.cc
@@ -39,7 +39,7 @@ namespace Glib
 
 Error::Error()
 :
-  gobject_ (0)
+  gobject_ (nullptr)
 {}
 
 Error::Error(GQuark error_domain, int error_code, const Glib::ustring& message)
@@ -55,7 +55,7 @@ Error::Error(GError* gobject, bool take_copy)
 Error::Error(const Error& other)
 :
   Exception(other),
-  gobject_ ((other.gobject_) ? g_error_copy(other.gobject_) : 0)
+  gobject_ ((other.gobject_) ? g_error_copy(other.gobject_) : nullptr)
 {}
 
 Error& Error::operator=(const Error& other)
diff --git a/glib/glibmm/interface.cc b/glib/glibmm/interface.cc
index 9d2bf30..5d178cb 100644
--- a/glib/glibmm/interface.cc
+++ b/glib/glibmm/interface.cc
@@ -33,8 +33,8 @@ void Interface_Class::add_interface(GType instance_type) const
     const GInterfaceInfo interface_info =
     {
       class_init_func_,
-      0, // interface_finalize
-      0, // interface_data
+      nullptr, // interface_finalize
+      nullptr, // interface_data
     };
 
     g_type_add_interface_static(instance_type, gtype_, &interface_info);
diff --git a/glib/glibmm/listhandle.h b/glib/glibmm/listhandle.h
index 25ca328..bdffe8e 100644
--- a/glib/glibmm/listhandle.h
+++ b/glib/glibmm/listhandle.h
@@ -313,7 +313,7 @@ typename ListHandle<T,Tr>::const_iterator ListHandle<T,Tr>::begin() const
 template <class T, class Tr> inline
 typename ListHandle<T,Tr>::const_iterator ListHandle<T,Tr>::end() const
 {
-  return Glib::Container_Helpers::ListHandleIterator<Tr>(0);
+  return Glib::Container_Helpers::ListHandleIterator<Tr>(nullptr);
 }
 
 template <class T, class Tr>
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index c2f1c4d..d67b737 100644
--- a/glib/glibmm/main.cc
+++ b/glib/glibmm/main.cc
@@ -88,7 +88,7 @@ inline
 SourceConnectionNode::SourceConnectionNode(const sigc::slot_base& slot)
 :
   slot_ (slot),
-  source_ (0)
+  source_ (nullptr)
 {
   slot_.set_parent(this, &SourceConnectionNode::notify);
 }
@@ -98,7 +98,7 @@ void* SourceConnectionNode::notify(void* data)
   SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data);
 
   // if there is no object, this call was triggered from destroy_notify_handler(),
-  // because we set self->source_ to 0 there:
+  // because we set self->source_ to nullptr there:
   if (self->source_)
   {
     GSource* s = self->source_;
@@ -109,7 +109,7 @@ void* SourceConnectionNode::notify(void* data)
     // either immediately or later, so we leave that to do the deletion.
   }
 
-  return 0;
+  return nullptr;
 }
 
 // static
@@ -161,7 +161,7 @@ inline
 SourceCallbackData::SourceCallbackData(Glib::Source* wrapper_)
 :
   wrapper (wrapper_),
-  node    (0)
+  node    (nullptr)
 {}
 
 void SourceCallbackData::set_node(SourceConnectionNode* node_)
@@ -200,7 +200,7 @@ void SourceCallbackData::destroy_notify_callback(void* data)
  */
 static SourceCallbackData* glibmm_source_get_callback_data(GSource* source)
 {
-  g_return_val_if_fail(source->callback_funcs != nullptr, 0);
+  g_return_val_if_fail(source->callback_funcs != nullptr, nullptr);
 
   GSourceFunc func;
   void* user_data = nullptr;
@@ -482,7 +482,7 @@ void SignalIdle::connect_once(const sigc::slot<void>& slot, int priority)
 
 SignalIdle signal_idle()
 {
-  return SignalIdle(0); // 0 means default context
+  return SignalIdle(nullptr); // nullptr means default context
 }
 
 
@@ -527,7 +527,7 @@ sigc::connection SignalIO::connect(const sigc::slot<bool,IOCondition>& slot,
 
 SignalIO signal_io()
 {
-  return SignalIO(0); // 0 means default context
+  return SignalIO(nullptr); // nullptr means default context
 }
 
 /**** Glib::SignalChildWatch **************************************************/
@@ -562,7 +562,7 @@ sigc::connection SignalChildWatch::connect(const sigc::slot<void, GPid, int>& sl
 
 SignalChildWatch signal_child_watch()
 {
-  return SignalChildWatch(0); // 0 means default context
+  return SignalChildWatch(nullptr); // nullptr means default context
 }
 
 /**** Glib::MainContext ****************************************************/
@@ -623,7 +623,7 @@ bool MainContext::prepare(int& priority)
 
 bool MainContext::prepare()
 {
-  return g_main_context_prepare(gobj(), 0);
+  return g_main_context_prepare(gobj(), nullptr);
 }
 
 void MainContext::query(int max_priority, int& timeout, std::vector<PollFD>& fds)
@@ -746,7 +746,7 @@ Glib::RefPtr<MainContext> wrap(GMainContext* gobject, bool take_copy)
 Glib::RefPtr<MainLoop> MainLoop::create(bool is_running)
 {
   return Glib::RefPtr<MainLoop>(
-      reinterpret_cast<MainLoop*>(g_main_loop_new(0, is_running)));
+      reinterpret_cast<MainLoop*>(g_main_loop_new(nullptr, is_running)));
 }
 
 Glib::RefPtr<MainLoop> MainLoop::create(const Glib::RefPtr<MainContext>& context, bool is_running)
@@ -824,11 +824,11 @@ const GSourceFuncs Source::vfunc_table_ =
   &Source::prepare_vfunc,
   &Source::check_vfunc,
   &Source::dispatch_vfunc,
-  0, // finalize_vfunc // We can't use finalize_vfunc because there is no way
+  nullptr, // finalize_vfunc // We can't use finalize_vfunc because there is no way
                        // to store a pointer to our wrapper anywhere in GSource so
                        // that it persists until finalize_vfunc would be called from here.
-  0, // closure_callback
-  0, // closure_marshal
+  nullptr, // closure_callback
+  nullptr, // closure_marshal
 };
 
 unsigned int Source::attach(const Glib::RefPtr<MainContext>& context)
@@ -838,7 +838,7 @@ unsigned int Source::attach(const Glib::RefPtr<MainContext>& context)
 
 unsigned int Source::attach()
 {
-  return g_source_attach(gobject_, 0);
+  return g_source_attach(gobject_, nullptr);
 }
 
 void Source::destroy()
@@ -1094,7 +1094,7 @@ sigc::slot_base* Source::get_slot_from_connection_node(void* data)
 sigc::slot_base* Source::get_slot_from_callback_data(void* data)
 {
   SourceCallbackData* const callback_data = static_cast<SourceCallbackData*>(data);
-  g_return_val_if_fail(callback_data->node != nullptr, 0);
+  g_return_val_if_fail(callback_data->node != nullptr, nullptr);
   return callback_data->node->get_slot();
 }
 
diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc
index 2f20189..3736c5d 100644
--- a/glib/glibmm/object.cc
+++ b/glib/glibmm/object.cc
@@ -54,7 +54,7 @@ ConstructParams::ConstructParams(const Glib::Class& glibmm_class_)
 :
   glibmm_class (glibmm_class_),
   n_parameters (0),
-  parameters   (0)
+  parameters   (nullptr)
 {}
 
 /*
@@ -72,7 +72,7 @@ ConstructParams::ConstructParams(const Glib::Class& glibmm_class_,
 :
   glibmm_class (glibmm_class_),
   n_parameters (0),
-  parameters   (0)
+  parameters   (nullptr)
 {
   va_list var_args;
   va_start(var_args, first_property_name);
@@ -215,7 +215,7 @@ Object::Object()
       custom_type_name_, custom_interface_classes);
   }
 
-  void *const new_object = g_object_newv(object_type, 0, 0);
+  void *const new_object = g_object_newv(object_type, 0, nullptr);
 
   // Connect the GObject and Glib::Object instances.
   ObjectBase::initialize(static_cast<GObject*>(new_object));
diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc
index 874958f..84f7f3d 100644
--- a/glib/glibmm/objectbase.cc
+++ b/glib/glibmm/objectbase.cc
@@ -47,21 +47,21 @@ Threads::Mutex* ObjectBase::extra_object_base_data_mutex = new Threads::Mutex();
 
 ObjectBase::ObjectBase()
 :
-  gobject_                      (0),
+  gobject_                      (nullptr),
   custom_type_name_             (anonymous_custom_type_name),
   cpp_destruction_in_progress_  (false)
 {}
 
 ObjectBase::ObjectBase(const char* custom_type_name)
 :
-  gobject_                      (0),
+  gobject_                      (nullptr),
   custom_type_name_             (custom_type_name),
   cpp_destruction_in_progress_  (false)
 {}
 
 ObjectBase::ObjectBase(const std::type_info& custom_type_info)
 :
-  gobject_                      (0),
+  gobject_                      (nullptr),
   custom_type_name_             (custom_type_info.name()),
   cpp_destruction_in_progress_  (false)
 {}
@@ -255,7 +255,7 @@ ObjectBase* ObjectBase::_get_current_wrapper(GObject* object)
   if(object)
     return static_cast<ObjectBase*>(g_object_get_qdata(object, Glib::quark_));
   else
-    return 0;
+    return nullptr;
 }
 
 // static
diff --git a/glib/glibmm/pattern.cc b/glib/glibmm/pattern.cc
index de2e5f6..d679a61 100644
--- a/glib/glibmm/pattern.cc
+++ b/glib/glibmm/pattern.cc
@@ -44,7 +44,7 @@ PatternSpec::~PatternSpec() noexcept
 
 bool PatternSpec::match(const Glib::ustring& str) const
 {
-  return g_pattern_match(gobject_, str.bytes(), str.c_str(), 0);
+  return g_pattern_match(gobject_, str.bytes(), str.c_str(), nullptr);
 }
 
 bool PatternSpec::match(const Glib::ustring& str, const Glib::ustring& str_reversed) const
diff --git a/glib/glibmm/signalproxy_connectionnode.cc b/glib/glibmm/signalproxy_connectionnode.cc
index 6784d6e..7c9b321 100644
--- a/glib/glibmm/signalproxy_connectionnode.cc
+++ b/glib/glibmm/signalproxy_connectionnode.cc
@@ -69,7 +69,7 @@ void* SignalProxyConnectionNode::notify(void* data)
     }
   }
 
-  return 0; // apparently unused in libsigc++
+  return nullptr; // apparently unused in libsigc++
 }
 
 //static
diff --git a/glib/glibmm/streamiochannel.cc b/glib/glibmm/streamiochannel.cc
index 8be257f..da45347 100644
--- a/glib/glibmm/streamiochannel.cc
+++ b/glib/glibmm/streamiochannel.cc
@@ -31,13 +31,13 @@ namespace Glib
 // static
 Glib::RefPtr<StreamIOChannel> StreamIOChannel::create(std::istream& stream)
 {
-  return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(&stream, 0));
+  return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(&stream, nullptr));
 }
 
 // static
 Glib::RefPtr<StreamIOChannel> StreamIOChannel::create(std::ostream& stream)
 {
-  return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(0, &stream));
+  return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(nullptr, &stream));
 }
 
 // static
diff --git a/glib/glibmm/stringutils.cc b/glib/glibmm/stringutils.cc
index e72f029..ee13973 100644
--- a/glib/glibmm/stringutils.cc
+++ b/glib/glibmm/stringutils.cc
@@ -87,7 +87,7 @@ std::string Glib::Ascii::dtostr(double d)
 
 std::string Glib::strescape(const std::string& source)
 {
-  const Glib::ScopedPtr<char> buf (g_strescape(source.c_str(), 0));
+  const Glib::ScopedPtr<char> buf (g_strescape(source.c_str(), nullptr));
   return buf.get();
 }
 
diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc
index 2cf8f14..fa8f8c9 100644
--- a/glib/glibmm/threadpool.cc
+++ b/glib/glibmm/threadpool.cc
@@ -125,7 +125,7 @@ namespace Glib
 
 ThreadPool::ThreadPool(int max_threads, bool exclusive)
 :
-  gobject_   (0),
+  gobject_   (nullptr),
   slot_list_ (new SlotList())
 {
   GError* error = nullptr;
diff --git a/glib/glibmm/timer.cc b/glib/glibmm/timer.cc
index d991b29..e48773b 100644
--- a/glib/glibmm/timer.cc
+++ b/glib/glibmm/timer.cc
@@ -50,7 +50,7 @@ void Timer::reset()
 
 double Timer::elapsed() const
 {
-  return g_timer_elapsed(gobject_, 0);
+  return g_timer_elapsed(gobject_, nullptr);
 }
 
 double Timer::elapsed(unsigned long& microseconds) const
diff --git a/glib/glibmm/ustring.cc b/glib/glibmm/ustring.cc
index 2ded2c8..e8d7511 100644
--- a/glib/glibmm/ustring.cc
+++ b/glib/glibmm/ustring.cc
@@ -1105,7 +1105,7 @@ ustring::size_type ustring::copy(char* dest, ustring::size_type n, ustring::size
 
 bool ustring::validate() const
 {
-  return (g_utf8_validate(string_.data(), string_.size(), 0) != 0);
+  return (g_utf8_validate(string_.data(), string_.size(), nullptr) != 0);
 }
 
 bool ustring::validate(ustring::iterator& first_invalid)
@@ -1269,17 +1269,17 @@ ustring ustring::FormatStream::to_string() const
   // Avoid going through iconv if wchar_t always contains UCS-4.
   glong n_bytes = 0;
   const ScopedPtr<char> buf (g_ucs4_to_utf8(reinterpret_cast<const gunichar*>(str.data()),
-                                            str.size(), 0, &n_bytes, &error));
+                                            str.size(), nullptr, &n_bytes, &error));
 # elif defined(G_OS_WIN32) && SIZEOF_WCHAR_T == 2
   // Avoid going through iconv if wchar_t always contains UTF-16.
   glong n_bytes = 0;
   const ScopedPtr<char> buf (g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(str.data()),
-                                             str.size(), 0, &n_bytes, &error));
+                                             str.size(), nullptr, &n_bytes, &error));
 # else
   gsize n_bytes = 0;
   const ScopedPtr<char> buf (g_convert(reinterpret_cast<const char*>(str.data()),
                                        str.size() * sizeof(std::wstring::value_type),
-                                       "UTF-8", "WCHAR_T", 0, &n_bytes, &error));
+                                       "UTF-8", "WCHAR_T", nullptr, &n_bytes, &error));
 # endif /* !(__STDC_ISO_10646__ || G_OS_WIN32) */
 
 #else /* !GLIBMM_HAVE_WIDE_STREAM */
@@ -1306,7 +1306,7 @@ std::istream& operator>>(std::istream& is, Glib::ustring& utf8_string)
 
   GError* error = nullptr;
   gsize n_bytes = 0;
-  const ScopedPtr<char> buf (g_locale_to_utf8(str.data(), str.size(), 0, &n_bytes, &error));
+  const ScopedPtr<char> buf (g_locale_to_utf8(str.data(), str.size(), nullptr, &n_bytes, &error));
 
   if (error)
   {
@@ -1322,7 +1322,7 @@ std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string)
 {
   GError* error = nullptr;
   const ScopedPtr<char> buf (g_locale_from_utf8(utf8_string.raw().data(),
-                                                utf8_string.raw().size(), 0, 0, &error));
+                                                utf8_string.raw().size(), nullptr, nullptr, &error));
   if (error)
   {
     Glib::Error::throw_exception(error);
@@ -1353,17 +1353,17 @@ std::wistream& operator>>(std::wistream& is, ustring& utf8_string)
   // Avoid going through iconv if wchar_t always contains UCS-4.
   glong n_bytes = 0;
   const ScopedPtr<char> buf (g_ucs4_to_utf8(reinterpret_cast<const gunichar*>(wstr.data()),
-                                            wstr.size(), 0, &n_bytes, &error));
+                                            wstr.size(), nullptr, &n_bytes, &error));
 #elif defined(G_OS_WIN32) && SIZEOF_WCHAR_T == 2
   // Avoid going through iconv if wchar_t always contains UTF-16.
   glong n_bytes = 0;
   const ScopedPtr<char> buf (g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(wstr.data()),
-                                             wstr.size(), 0, &n_bytes, &error));
+                                             wstr.size(), nullptr, &n_bytes, &error));
 #else
   gsize n_bytes = 0;
   const ScopedPtr<char> buf (g_convert(reinterpret_cast<const char*>(wstr.data()),
                                        wstr.size() * sizeof(std::wstring::value_type),
-                                       "UTF-8", "WCHAR_T", 0, &n_bytes, &error));
+                                       "UTF-8", "WCHAR_T", nullptr, &n_bytes, &error));
 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)
 
   if (error)
@@ -1383,14 +1383,14 @@ std::wostream& operator<<(std::wostream& os, const ustring& utf8_string)
 #if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
   // Avoid going through iconv if wchar_t always contains UCS-4.
   const ScopedPtr<gunichar> buf (g_utf8_to_ucs4(utf8_string.raw().data(),
-                                                utf8_string.raw().size(), 0, 0, &error));
+                                                utf8_string.raw().size(), nullptr, nullptr, &error));
 #elif defined(G_OS_WIN32) && SIZEOF_WCHAR_T == 2
   // Avoid going through iconv if wchar_t always contains UTF-16.
   const ScopedPtr<gunichar2> buf (g_utf8_to_utf16(utf8_string.raw().data(),
-                                                  utf8_string.raw().size(), 0, 0, &error));
+                                                  utf8_string.raw().size(), nullptr, nullptr, &error));
 #else
   const ScopedPtr<char> buf (g_convert(utf8_string.raw().data(), utf8_string.raw().size(),
-                                       "WCHAR_T", "UTF-8", 0, 0, &error));
+                                       "WCHAR_T", "UTF-8", nullptr, nullptr, &error));
 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)
 
   if (error)
diff --git a/glib/glibmm/value.cc b/glib/glibmm/value.cc
index b49d9a4..53551d0 100644
--- a/glib/glibmm/value.cc
+++ b/glib/glibmm/value.cc
@@ -94,7 +94,7 @@ void* ValueBase_Boxed::get_boxed() const
 GParamSpec* ValueBase_Boxed::create_param_spec(const Glib::ustring& name) const
 {
   return g_param_spec_boxed(
-      name.c_str(), 0, 0, G_VALUE_TYPE(&gobject_),
+      name.c_str(), nullptr, nullptr, G_VALUE_TYPE(&gobject_),
       GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
 }
 
@@ -109,7 +109,7 @@ GType ValueBase_Object::value_type()
 
 void ValueBase_Object::set_object(Glib::ObjectBase* data)
 {
-  g_value_set_object(&gobject_, (data) ? data->gobj() : 0);
+  g_value_set_object(&gobject_, (data) ? data->gobj() : nullptr);
 }
 
 Glib::ObjectBase* ValueBase_Object::get_object() const
@@ -134,15 +134,15 @@ GParamSpec* ValueBase_Object::create_param_spec(const Glib::ustring& name) const
   if(G_VALUE_HOLDS_OBJECT(&gobject_))
   {
     return g_param_spec_object(
-        name.c_str(), 0, 0, G_VALUE_TYPE(&gobject_),
+        name.c_str(), nullptr, nullptr, G_VALUE_TYPE(&gobject_),
         GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
   }
   else
   {
-    g_return_val_if_fail(G_VALUE_HOLDS_POINTER(&gobject_), 0);
+    g_return_val_if_fail(G_VALUE_HOLDS_POINTER(&gobject_), nullptr);
 
     return g_param_spec_pointer(
-        name.c_str(), 0, 0,
+        name.c_str(), nullptr, nullptr,
         GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
   }
 }
@@ -169,7 +169,7 @@ int ValueBase_Enum::get_enum() const
 GParamSpec* ValueBase_Enum::create_param_spec(const Glib::ustring& name) const
 {
   return g_param_spec_enum(
-      name.c_str(), 0, 0,
+      name.c_str(), nullptr, nullptr,
       G_VALUE_TYPE(&gobject_), g_value_get_enum(&gobject_),
       GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
 }
@@ -196,7 +196,7 @@ unsigned int ValueBase_Flags::get_flags() const
 GParamSpec* ValueBase_Flags::create_param_spec(const Glib::ustring& name) const
 {
   return g_param_spec_flags(
-      name.c_str(), 0, 0,
+      name.c_str(), nullptr, nullptr,
       G_VALUE_TYPE(&gobject_), g_value_get_flags(&gobject_),
       GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
 }
@@ -226,7 +226,7 @@ const char* ValueBase_String::get_cstring() const
 GParamSpec* ValueBase_String::create_param_spec(const Glib::ustring& name) const
 {
   return g_param_spec_string(
-      name.c_str(), 0, 0, get_cstring(),
+      name.c_str(), nullptr, nullptr, get_cstring(),
       GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
 }
 
diff --git a/glib/glibmm/vectorutils.h b/glib/glibmm/vectorutils.h
index fcf8fe0..a85ad97 100644
--- a/glib/glibmm/vectorutils.h
+++ b/glib/glibmm/vectorutils.h
@@ -120,7 +120,7 @@ template <class Tr>
 GList* create_glist(const typename std::vector<typename Tr::CppType>::const_iterator pbegin,
                      typename std::vector<typename Tr::CppType>::const_iterator pend)
 {
-  GList* head(0);
+  GList* head(nullptr);
 
   while(pend != pbegin)
   {
@@ -139,7 +139,7 @@ template <class Tr>
 GSList* create_gslist(const typename std::vector<typename Tr::CppType>::const_iterator pbegin,
                        typename std::vector<typename Tr::CppType>::const_iterator pend)
 {
-  GSList* head(0);
+  GSList* head(nullptr);
 
   while(pend != pbegin)
   {
@@ -943,11 +943,11 @@ ListHandler<T, Tr>::list_to_vector(GList* glist, Glib::OwnershipType ownership)
   // it will handle destroying data depending on passed ownership.
   GListKeeperType keeper(glist, ownership);
 #ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
-  return VectorType(ListIteratorType(glist), ListIteratorType(0));
+  return VectorType(ListIteratorType(glist), ListIteratorType(nullptr));
 #else
   VectorType temp;
   temp.reserve(g_list_length(glist));
-  Glib::Container_Helpers::fill_container(temp, ListIteratorType(glist), ListIteratorType(0));
+  Glib::Container_Helpers::fill_container(temp, ListIteratorType(glist), ListIteratorType(nullptr));
   return temp;
 #endif
 }
@@ -968,11 +968,11 @@ SListHandler<T, Tr>::slist_to_vector(GSList* gslist, Glib::OwnershipType ownersh
   // it will handle destroying data depending on passed ownership.
   GSListKeeperType keeper(gslist, ownership);
 #ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
-  return VectorType(SListIteratorType(gslist), SListIteratorType(0));
+  return VectorType(SListIteratorType(gslist), SListIteratorType(nullptr));
 #else
   VectorType temp;
   temp.reserve(g_slist_length(gslist));
-  Glib::Container_Helpers::fill_container(temp, SListIteratorType(gslist), SListIteratorType(0));
+  Glib::Container_Helpers::fill_container(temp, SListIteratorType(gslist), SListIteratorType(nullptr));
   return temp;
 #endif
 }
diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg
index 29d69ec..a36b01c 100644
--- a/glib/src/binding.ccg
+++ b/glib/src/binding.ccg
@@ -103,8 +103,8 @@ Glib::RefPtr<Binding> Binding::bind_property_value(
       source_property.get_object()->gobj(), source_property.get_name(),
       target_property.get_object()->gobj(), target_property.get_name(),
       (GBindingFlags)flags,
-      transform_to.empty() ? 0 : &Binding_transform_to_callback,
-      transform_from.empty() ? 0 : &Binding_transform_from_callback,
+      transform_to.empty() ? nullptr : &Binding_transform_to_callback,
+      transform_from.empty() ? nullptr : &Binding_transform_from_callback,
       slots_copy, &Binding_transform_callback_destroy);
   }
 
diff --git a/glib/src/convert.ccg b/glib/src/convert.ccg
index 02a1399..4204c24 100644
--- a/glib/src/convert.ccg
+++ b/glib/src/convert.ccg
@@ -74,7 +74,7 @@ void IConv::reset()
   gsize inbytes_left  = 0;
   gsize outbytes_left = 0;
 
-  g_iconv(gobject_, 0, &inbytes_left, &outbuf, &outbytes_left);
+  g_iconv(gobject_, nullptr, &inbytes_left, &outbuf, &outbytes_left);
 }
 
 std::string IConv::convert(const std::string& str)
diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg
index 43dc185..6fb7f56 100644
--- a/glib/src/fileutils.ccg
+++ b/glib/src/fileutils.ccg
@@ -72,7 +72,7 @@ DirIterator Dir::begin()
 
 DirIterator Dir::end()
 {
-  return DirIterator(gobject_, 0);
+  return DirIterator(gobject_, nullptr);
 }
 
 
@@ -80,8 +80,8 @@ DirIterator Dir::end()
 
 DirIterator::DirIterator()
 :
-  gobject_ (0),
-  current_ (0)
+  gobject_ (nullptr),
+  current_ (nullptr)
 {}
 
 DirIterator::DirIterator(GDir* gobject, const char* current)
@@ -153,7 +153,7 @@ int file_open_tmp(std::string& name_used)
   GError* error = nullptr;
   ScopedPtr<char> buf_name_used;
 
-  const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error);
+  const auto fileno = g_file_open_tmp(nullptr, buf_name_used.addr(), &error);
 
   if(error)
     Glib::Error::throw_exception(error);
diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg
index d9f9a5e..81b1eb2 100644
--- a/glib/src/iochannel.ccg
+++ b/glib/src/iochannel.ccg
@@ -513,7 +513,7 @@ GSource* GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition cond
     Glib::exception_handlers_invoke();
   }
 
-  return 0;
+  return nullptr;
 }
 
 // static
diff --git a/glib/src/markup.ccg b/glib/src/markup.ccg
index 14f5c25..d3ae62b 100644
--- a/glib/src/markup.ccg
+++ b/glib/src/markup.ccg
@@ -320,14 +320,14 @@ Glib::ustring ParseContext::get_element() const
 int ParseContext::get_line_number() const
 {
   int line_number = 0;
-  g_markup_parse_context_get_position(gobject_, &line_number, 0);
+  g_markup_parse_context_get_position(gobject_, &line_number, nullptr);
   return line_number;
 }
 
 int ParseContext::get_char_number() const
 {
   int char_number = 0;
-  g_markup_parse_context_get_position(gobject_, 0, &char_number);
+  g_markup_parse_context_get_position(gobject_, nullptr, &char_number);
   return char_number;
 }
 
diff --git a/glib/src/optioncontext.ccg b/glib/src/optioncontext.ccg
index 7bd3c07..f38c54d 100644
--- a/glib/src/optioncontext.ccg
+++ b/glib/src/optioncontext.ccg
@@ -126,7 +126,8 @@ void OptionContext::set_translate_func (const SlotTranslate& slot)
 
 Glib::ustring OptionContext::get_help(bool main_help) const
 {
-  return 
Glib::convert_return_gchar_ptr_to_ustring(g_option_context_get_help(const_cast<GOptionContext*>(gobj()), 
static_cast<int>(main_help), 0));
+  return Glib::convert_return_gchar_ptr_to_ustring(g_option_context_get_help(
+    const_cast<GOptionContext*>(gobj()), static_cast<int>(main_help), nullptr));
 }
 
 } // namespace Glib
diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg
index b1cacc2..af4695f 100644
--- a/glib/src/thread.ccg
+++ b/glib/src/thread.ccg
@@ -44,7 +44,7 @@ static void* call_thread_entry_slot(void* data)
   }
 
   delete slot;
-  return 0;
+  return nullptr;
 }
 
 } //extern "C"
diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg
index cc3ba46..5830fae 100644
--- a/glib/src/threads.ccg
+++ b/glib/src/threads.ccg
@@ -81,7 +81,7 @@ Thread* Thread::create(const sigc::slot<void>& slot, const std::string& name)
   const auto slot_copy = new sigc::slot<void>(slot);
 
   GError* error = nullptr;
-  auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(),
+  auto thread = g_thread_try_new(name.empty() ? nullptr : name.c_str(),
     &call_thread_entry_slot, slot_copy, &error);
 
   if (error)


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