diff options
author | Murray Cumming <murrayc@murrayc.com> | 2015-11-20 10:09:46 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-11-20 10:18:07 +0100 |
commit | b879555ffb731ba1fa9aabfd1520dd8ca88cd3c9 (patch) | |
tree | ea8b2e00e79d3008b8708c8b2be4a600c8d270c4 /glib/glibmm | |
parent | 47d8024cdb18f29eb7def2bb843f0a1a07cef9dd (diff) | |
download | glibmm-b879555ffb731ba1fa9aabfd1520dd8ca88cd3c9.tar.gz |
Glib: More nullptr instead of 0.
Diffstat (limited to 'glib/glibmm')
-rw-r--r-- | glib/glibmm/class.cc | 20 | ||||
-rw-r--r-- | glib/glibmm/containers.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/dispatcher.cc | 6 | ||||
-rw-r--r-- | glib/glibmm/error.cc | 4 | ||||
-rw-r--r-- | glib/glibmm/interface.cc | 4 | ||||
-rw-r--r-- | glib/glibmm/listhandle.h | 2 | ||||
-rw-r--r-- | glib/glibmm/main.cc | 30 | ||||
-rw-r--r-- | glib/glibmm/object.cc | 6 | ||||
-rw-r--r-- | glib/glibmm/objectbase.cc | 8 | ||||
-rw-r--r-- | glib/glibmm/pattern.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/signalproxy_connectionnode.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/streamiochannel.cc | 4 | ||||
-rw-r--r-- | glib/glibmm/stringutils.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/threadpool.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/timer.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/ustring.cc | 24 | ||||
-rw-r--r-- | glib/glibmm/value.cc | 16 | ||||
-rw-r--r-- | glib/glibmm/vectorutils.h | 12 |
18 files changed, 74 insertions, 74 deletions
diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc index 1f23a5fa..ab44e948 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 ff635650..07c61cdb 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 5a206ff6..3ab3a2f5 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 315ea71d..fb7d2106 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 9d2bf302..5d178cba 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 25ca3280..bdffe8e0 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 c2f1c4d1..d67b7370 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 2f20189b..3736c5d9 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 874958f2..84f7f3df 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 de2e5f62..d679a611 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 6784d6eb..7c9b3212 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 8be257f8..da453472 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 e72f029d..ee139733 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 2cf8f14d..fa8f8c99 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 d991b291..e48773b6 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 2ded2c8f..e8d75113 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 b49d9a49..53551d00 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 fcf8fe04..a85ad97b 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 } |