From a85c13810a7d98885441a6f272a880ca0bbb21b3 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 7 Sep 2020 00:01:10 -0700 Subject: [PATCH] Imported Upstream version 2.45.40 --- NEWS | 20 +++++ configure.ac | 4 +- examples/iochannel_stream/fdstream.h | 10 +-- gio/src/appinfo.ccg | 12 +-- gio/src/application.ccg | 6 +- gio/src/application.hg | 4 + gio/src/asyncinitable.ccg | 2 +- gio/src/datainputstream.ccg | 24 +++--- gio/src/dbusaddress.ccg | 24 +++--- gio/src/dbusconnection.ccg | 18 ++-- gio/src/dbusproxy.ccg | 4 +- gio/src/file.ccg | 114 +++++++++++++------------- gio/src/fileattributeinfolist.ccg | 2 +- gio/src/fileinputstream.ccg | 4 +- gio/src/fileiostream.ccg | 4 +- gio/src/fileoutputstream.ccg | 4 +- gio/src/icon.ccg | 2 +- gio/src/loadableicon.ccg | 4 +- gio/src/memoryinputstream.ccg | 2 +- gio/src/menuattributeiter.ccg | 4 +- gio/src/menuitem.ccg | 2 +- gio/src/menulinkiter.ccg | 4 +- gio/src/mount.ccg | 4 +- gio/src/networkaddress.ccg | 2 +- gio/src/outputstream.ccg | 12 +-- gio/src/proxyresolver.ccg | 2 +- gio/src/resource.ccg | 6 +- gio/src/socket.ccg | 12 +-- gio/src/socketlistener.ccg | 50 +++++------ glib/glibmm/containers.h | 4 + glib/glibmm/dispatcher.cc | 8 +- glib/glibmm/dispatcher.h | 8 +- glib/glibmm/error.cc | 22 ++--- glib/glibmm/error.h | 2 +- glib/glibmm/exception.cc | 2 +- glib/glibmm/exception.h | 2 +- glib/glibmm/exceptionhandler.cc | 4 +- glib/glibmm/exceptionhandler.h | 2 +- glib/glibmm/helperlist.h | 2 +- glib/glibmm/interface.cc | 2 +- glib/glibmm/interface.h | 9 +- glib/glibmm/listhandle.h | 8 +- glib/glibmm/main.cc | 20 ++--- glib/glibmm/main.h | 19 ++--- glib/glibmm/object.cc | 4 +- glib/glibmm/object.h | 8 +- glib/glibmm/objectbase.cc | 6 +- glib/glibmm/objectbase.h | 13 +-- glib/glibmm/pattern.h | 8 +- glib/glibmm/property.cc | 8 +- glib/glibmm/property.h | 7 +- glib/glibmm/propertyproxy_base.cc | 2 +- glib/glibmm/random.h | 8 +- glib/glibmm/refptr.h | 78 ++++++++++++------ glib/glibmm/signalproxy_connectionnode.cc | 4 +- glib/glibmm/slisthandle.h | 8 +- glib/glibmm/streamiochannel.cc | 8 +- glib/glibmm/stringutils.cc | 2 +- glib/glibmm/threadpool.cc | 22 ++--- glib/glibmm/timer.h | 8 +- glib/glibmm/ustring.cc | 10 +-- glib/glibmm/ustring.h | 54 ++++++------ glib/glibmm/wrap.cc | 8 +- glib/glibmm/wrap.h | 2 +- glib/src/binding.ccg | 2 +- glib/src/binding.hg | 2 +- glib/src/checksum.ccg | 2 +- glib/src/convert.ccg | 30 +++---- glib/src/fileutils.ccg | 12 +-- glib/src/iochannel.ccg | 24 +++--- glib/src/iochannel.hg | 40 +++++++-- glib/src/keyfile.ccg | 44 +++++----- glib/src/markup.ccg | 12 +-- glib/src/miscutils.ccg | 6 +- glib/src/module.ccg | 2 +- glib/src/module.hg | 2 +- glib/src/nodetree.hg | 10 +-- glib/src/optioncontext.ccg | 2 +- glib/src/optionentry.ccg | 6 +- glib/src/optiongroup.ccg | 16 ++-- glib/src/regex.ccg | 36 ++++---- glib/src/shell.ccg | 6 +- glib/src/spawn.ccg | 16 ++-- glib/src/spawn.hg | 38 ++++----- glib/src/thread.ccg | 4 +- glib/src/thread.hg | 6 +- glib/src/threads.ccg | 2 +- glib/src/threads.hg | 6 +- glib/src/variant.ccg | 8 +- glib/src/varianttype.ccg | 4 +- tests/glibmm_interface_implementation/main.cc | 4 +- tests/glibmm_vector/main.cc | 4 +- tools/extra_defs_gen/generate_extra_defs.cc | 8 +- tools/m4/class_boxedtype.m4 | 2 +- tools/m4/class_gobject.m4 | 5 +- tools/m4/class_interface.m4 | 10 +-- tools/m4/class_opaque_copyable.m4 | 2 +- tools/m4/class_opaque_refcounted.m4 | 6 +- tools/m4/method.m4 | 4 +- tools/m4/signal.m4 | 4 +- tools/m4/vfunc.m4 | 6 +- 101 files changed, 612 insertions(+), 525 deletions(-) diff --git a/NEWS b/NEWS index 808c91b..8b70275 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,23 @@ +2.45.40 (unstable): + +Glib: +* RefPtr: Add move constructor and move assignment operator. + (Murray Cumming) + +Gio: +* Application: Add the shutdown signal. + (Murray Cumming) Bug #752600 (Ben) + +Build: +* C++11: Use noexcept instead of throw(). + (Murray Cumming) +* C++11: Use "= delete" instead of private copy constructors/operator=. + (Murray Cumming) +* C++11: Use nullptr instead of 0. + (Murray Cumming) +* C++11: Use the override keyword. + + 2.45.31 (unstable): Glib: diff --git a/configure.ac b/configure.ac index d1758b3..d032957 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.45.31], +AC_INIT([glibmm], [2.45.40], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -62,7 +62,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.45.3' +glibreq='2.0 >= 2.45.4' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" diff --git a/examples/iochannel_stream/fdstream.h b/examples/iochannel_stream/fdstream.h index 8c7f45d..80f4675 100644 --- a/examples/iochannel_stream/fdstream.h +++ b/examples/iochannel_stream/fdstream.h @@ -77,11 +77,11 @@ public: fdstream_error get_error() const; protected: - virtual int_type underflow(); - virtual std::streamsize xsgetn(char* dest, std::streamsize num); - virtual int sync(); - virtual int_type overflow(int_type c); - virtual std::streamsize xsputn(const char* source, std::streamsize num); + int_type underflow() override; + std::streamsize xsgetn(char* dest, std::streamsize num) override; + int sync() override; + int_type overflow(int_type c) override; + std::streamsize xsputn(const char* source, std::streamsize num) override; private: Glib::RefPtr iochannel_; diff --git a/gio/src/appinfo.ccg b/gio/src/appinfo.ccg index 8fab8a3..64f04d0 100644 --- a/gio/src/appinfo.ccg +++ b/gio/src/appinfo.ccg @@ -30,8 +30,8 @@ AppInfo::create_from_commandline(const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags) { - GAppInfo* capp_info = 0; - GError* gerror = 0; + GAppInfo* capp_info = nullptr; + GError* gerror = nullptr; capp_info = g_app_info_create_from_commandline(commandline.c_str(), application_name.c_str(), @@ -54,7 +54,7 @@ bool AppInfo::launch(const Glib::RefPtr& file, const Glib::RefPtr > vec; vec.push_back(file); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch(gobj(), Glib::ListHandler >::vector_to_list(vec).data (), Glib::unwrap(launch_context), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -67,7 +67,7 @@ bool AppInfo::launch(const Glib::RefPtr& file) std::vector< Glib::RefPtr > vec; vec.push_back(file); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch(gobj(), Glib::ListHandler >::vector_to_list(vec).data (), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -80,7 +80,7 @@ bool AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr vec; vec.push_back(uri); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch_uris(gobj(), Glib::ListHandler::vector_to_list(vec).data (), Glib::unwrap(launch_context), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -93,7 +93,7 @@ bool AppInfo::launch_uri(const std::string& uri) std::vector vec; vec.push_back(uri); - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_app_info_launch_uris(gobj(), Glib::ListHandler::vector_to_list(vec).data (), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 3eccdda..7b157b0 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -154,7 +154,7 @@ public: const Gio::Application* get_application() const { return application_; } gchar get_short_name() const { return short_name_; } - bool is_filename_option() const { return slot_filename_ != 0; } + bool is_filename_option() const { return slot_filename_ != nullptr; } const Glib::OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; } @@ -222,7 +222,7 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* return false; } - const bool has_value = (value != 0); + const bool has_value = (value != nullptr); const OptionArgCallbackData* const option_arg = iterFind->second; try { @@ -475,7 +475,7 @@ void Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustr else // We ensure that this is null to ensure that it is not used, // telling GApplication to put the parsed value in the options VariantDict instead. - array[0].arg_data = 0; + array[0].arg_data = nullptr; g_application_add_main_option_entries(gobj(), array); } diff --git a/gio/src/application.hg b/gio/src/application.hg index 98c5e57..b80ddac 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -363,6 +363,10 @@ public: //#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)') _WRAP_SIGNAL(void startup(), "startup") + + //TODO: Remove no_default_handler when we can break ABI + _WRAP_SIGNAL(void shutdown(), "shutdown", no_default_handler, newin "2,46") + _WRAP_SIGNAL(void activate(), "activate") //We wrap the open signal without _WRAP_SIGNAL(), because we need to change its parameters. diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 3867ef0..df26f6f 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -157,7 +157,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) / if(base && base->init_finish) { - GError* gerror = 0; + GError* gerror = nullptr; bool const result = (*base->init_finish)(gobj(), Glib::unwrap(res), &gerror); diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg index 0b4b469..8dd8b31 100644 --- a/gio/src/datainputstream.ccg +++ b/gio/src/datainputstream.ccg @@ -26,7 +26,7 @@ namespace Gio bool DataInputStream::read_line(std::string& line, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_line = g_data_input_stream_read_line(gobj(), 0, // pass NULL since we can easily determine the length from the returned std::string Glib::unwrap(cancellable), @@ -44,7 +44,7 @@ bool DataInputStream::read_line(std::string& line, const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -85,7 +85,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } @@ -95,7 +95,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr& result, bool DataInputStream::read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), 0, // pass NULL since we can easily determine the length from the returned std::string @@ -116,7 +116,7 @@ bool DataInputStream::read_until(std::string& data, const std::string& stop_char */ bool DataInputStream::read_until(std::string& data, const std::string& stop_chars) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), 0, // pass NULL since we can easily determine the length from the returned std::string @@ -149,7 +149,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot bool DataInputStream::read_until_finish(const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -158,7 +158,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } @@ -169,7 +169,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr& result, bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ 0, // pass NULL since we can easily determine the length from the returned std::string @@ -190,7 +190,7 @@ bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars */ bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars) { - GError* gerror = 0; + GError* gerror = nullptr; char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ 0, // pass NULL since we can easily determine the length from the returned std::string @@ -226,7 +226,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA bool DataInputStream::read_upto_finish(const Glib::RefPtr& result, std::string& data) { - GError* gerror = 0; + GError* gerror = nullptr; gsize size = 0; gchar* buffer = g_data_input_stream_read_upto_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); if(gerror) @@ -235,7 +235,7 @@ bool DataInputStream::read_upto_finish(const Glib::RefPtr& result, bool retval = false; if(buffer && size) { - retval = (buffer != 0); + retval = (buffer != nullptr); data = std::string(buffer, size); g_free (buffer); } diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index a8b1fd3..2b39509 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -37,7 +37,7 @@ bool is_address(const std::string& string) bool is_supported(const std::string& address) { - GError* gerror = 0; + GError* gerror = nullptr; bool const result = g_dbus_is_supported_address(address.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -62,8 +62,8 @@ void get_stream(const std::string& address, const SlotAsyncReady slot) Glib::RefPtr get_stream_finish(const Glib::RefPtr& res, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), @@ -78,7 +78,7 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res, Glib::RefPtr get_stream_finish(const Glib::RefPtr& res) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), 0, @@ -93,8 +93,8 @@ Glib::RefPtr get_stream_finish(const Glib::RefPtr& res) Glib::RefPtr get_stream_sync(const std::string& address, const Glib::RefPtr& cancellable, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), @@ -110,8 +110,8 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address, std::string& out_guid) { - GError* gerror = 0; - gchar* g_out_guid = 0; + GError* gerror = nullptr; + gchar* g_out_guid = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), @@ -127,7 +127,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, @@ -141,7 +141,7 @@ Glib::RefPtr get_stream_sync(const std::string& address, Glib::RefPtr get_stream_sync(const std::string& address) { - GError* gerror = 0; + GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, 0, &gerror)); @@ -155,7 +155,7 @@ Glib::RefPtr get_stream_sync(const std::string& address) std::string get_for_bus_sync(BusType bus_type, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; std::string result(g_dbus_address_get_for_bus_sync( static_cast(bus_type), Glib::unwrap(cancellable), &gerror)); @@ -168,7 +168,7 @@ std::string get_for_bus_sync(BusType bus_type, std::string get_for_bus_sync(BusType bus_type) { - GError* gerror = 0; + GError* gerror = nullptr; std::string result(g_dbus_address_get_for_bus_sync( static_cast(bus_type), 0, &gerror)); diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index 3102050..0e9faf6 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -545,7 +545,7 @@ void Connection::flush(const SlotAsyncReady& slot) bool Connection::send_message(const Glib::RefPtr& message, SendMessageFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const bool result = g_dbus_connection_send_message(gobj(), Glib::unwrap(message), static_cast(flags), 0, @@ -587,7 +587,7 @@ Glib::RefPtr Connection::send_message_with_reply_sync( gint timeout_msec) { volatile guint32 out_serial = 0; - GError* gerror = 0; + GError* gerror = nullptr; GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), @@ -606,7 +606,7 @@ Glib::RefPtr Connection::send_message_with_reply_sync( gint timeout_msec) { volatile guint32 out_serial = 0; - GError* gerror = 0; + GError* gerror = nullptr; GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), @@ -679,7 +679,7 @@ Glib::VariantContainerBase Connection::call_sync( CallFlags flags, const Glib::VariantType& reply_type) { - GError* gerror = 0; + GError* gerror = nullptr; GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), bus_name.c_str(), object_path.c_str(), @@ -705,7 +705,7 @@ Glib::VariantContainerBase Connection::call_sync( CallFlags flags, const Glib::VariantType& reply_type) { - GError* gerror = 0; + GError* gerror = nullptr; GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), bus_name.c_str(), object_path.c_str(), @@ -779,7 +779,7 @@ void Connection::emit_signal( const Glib::ustring& destination_bus_name, const Glib::VariantContainerBase& parameters) { - GError* gerror = 0; + GError* gerror = nullptr; // Strings are checked to see if they are empty so that NULL can be passed // for those strings to the C API. This is done because some strings such as @@ -827,7 +827,7 @@ guint Connection::register_object(const Glib::ustring& object_path, const Glib::RefPtr& interface_info, const InterfaceVTable& vtable) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_object(gobj(), object_path.c_str(), Glib::unwrap(interface_info), @@ -842,7 +842,7 @@ guint Connection::register_object(const Glib::ustring& object_path, guint Connection::register_object(const Glib::ustring& object_path, const Glib::RefPtr& interface_info) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_object(gobj(), object_path.c_str(), Glib::unwrap(interface_info), @@ -857,7 +857,7 @@ guint Connection::register_object(const Glib::ustring& object_path, guint Connection::register_subtree(const Glib::ustring& object_path, const SubtreeVTable& vtable, SubtreeFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const guint result = g_dbus_connection_register_subtree(gobj(), object_path.c_str(), diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index 25014f6..d9850d7 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -330,7 +330,7 @@ Glib::VariantContainerBase Proxy::call_sync( CallFlags flags ) { - GError* g_error = 0; + GError* g_error = nullptr; GVariant* const gvariant = g_dbus_proxy_call_sync(gobj(), method_name.c_str(), @@ -351,7 +351,7 @@ Glib::VariantContainerBase Proxy::call_sync( CallFlags flags ) { - GError* g_error = 0; + GError* g_error = nullptr; GVariant* const gvariant = g_dbus_proxy_call_sync(gobj(), method_name.c_str(), diff --git a/gio/src/file.ccg b/gio/src/file.ccg index f94511e..7bace93 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -440,7 +440,7 @@ FileType File::query_file_type(FileQueryInfoFlags flags) const Glib::RefPtr File::query_info(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -450,7 +450,7 @@ Glib::RefPtr File::query_info(const Glib::RefPtr& cancell Glib::RefPtr File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_info(const_cast(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -495,7 +495,7 @@ File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -505,7 +505,7 @@ Glib::RefPtr File::query_filesystem_info(const Glib::RefPtr File::query_filesystem_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -547,7 +547,7 @@ File::query_filesystem_info_async(const SlotAsyncReady& slot, const std::string& Glib::RefPtr File::enumerate_children(const Glib::RefPtr& cancellable, const std::string& attributes, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -557,7 +557,7 @@ Glib::RefPtr File::enumerate_children(const Glib::RefPtr File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -634,7 +634,7 @@ File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncR bool File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a copy of the slot. @@ -661,7 +661,7 @@ File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a copy of the slot. @@ -688,7 +688,7 @@ File::copy(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::copy(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast(flags), @@ -806,7 +806,7 @@ File::copy_async(const Glib::RefPtr& destination, bool File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a move of the slot. @@ -833,7 +833,7 @@ File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; // Create a move of the slot. @@ -860,7 +860,7 @@ File::move(const Glib::RefPtr& destination, const SlotFileProgress& slot, bool File::move(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_move(gobj(), @@ -915,7 +915,7 @@ bool File::set_attributes_finish(const Glib::RefPtr& result, const Glib::RefPtr& info) { - GError* gerror = 0; + GError* gerror = nullptr; GFileInfo* cinfo = Glib::unwrap(info); bool res; @@ -1282,8 +1282,8 @@ File::load_partial_contents_async(const SlotReadMore& slot_read_more, void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, const Glib::RefPtr& cancellable, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents, length, etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1296,8 +1296,8 @@ void File::replace_contents(const char* contents, gsize length, const std::strin void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents, length, etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1310,8 +1310,8 @@ void File::replace_contents(const char* contents, gsize length, const std::strin void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, const Glib::RefPtr& cancellable, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents.c_str(), contents.size(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1324,8 +1324,8 @@ void File::replace_contents(const std::string& contents, const std::string& etag void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; - gchar* c_etag_new = 0; + GError* gerror = nullptr; + gchar* c_etag_new = nullptr; g_file_replace_contents(gobj(), contents.c_str(), contents.size(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1434,8 +1434,8 @@ File::replace_contents_async(const SlotAsyncReady& slot, void File::replace_contents_finish(const Glib::RefPtr& result, std::string& new_etag) { - GError* gerror = 0; - gchar* c_new_etag = 0; + GError* gerror = nullptr; + gchar* c_new_etag = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), &c_new_etag, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1449,7 +1449,7 @@ void File::replace_contents_finish(const Glib::RefPtr& result, std: void File::replace_contents_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1504,7 +1504,7 @@ File::replace_contents_bytes_async(const SlotAsyncReady& slot, Glib::RefPtr File::replace(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1514,7 +1514,7 @@ Glib::RefPtr File::replace(const Glib::RefPtr& ca Glib::RefPtr File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1525,7 +1525,7 @@ Glib::RefPtr File::replace(const std::string& etag, bool make_ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1535,7 +1535,7 @@ Glib::RefPtr File::replace_readwrite(const Glib::RefPtr File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1547,7 +1547,7 @@ Glib::RefPtr File::replace_readwrite(const std::string& etag, bool Glib::RefPtr File::monitor_directory(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1557,7 +1557,7 @@ Glib::RefPtr File::monitor_directory(const Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1567,7 +1567,7 @@ Glib::RefPtr File::monitor_directory(FileMonitorFlags flags) Glib::RefPtr File::monitor_file(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1577,7 +1577,7 @@ Glib::RefPtr File::monitor_file(const Glib::RefPtr& ca Glib::RefPtr File::monitor_file(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1588,7 +1588,7 @@ Glib::RefPtr File::monitor_file(FileMonitorFlags flags) Glib::RefPtr File::monitor(const Glib::RefPtr& cancellable, FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1598,7 +1598,7 @@ Glib::RefPtr File::monitor(const Glib::RefPtr& cancell Glib::RefPtr File::monitor(FileMonitorFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1609,7 +1609,7 @@ Glib::RefPtr File::monitor(FileMonitorFlags flags) void File::measure_disk_usage(const Glib::RefPtr& cancellable, const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, guint64& num_files, FileMeasureFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; g_file_measure_disk_usage(gobj(), ((GFileMeasureFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &SignalProxy_file_measure_progress_callback, const_cast(&slot_progress), @@ -1754,7 +1754,7 @@ void File::find_enclosing_mount_async(const SlotAsyncReady& slot, int io_priorit bool File::set_attributes_from_info(const Glib::RefPtr& info, const Glib::RefPtr& cancellable, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1764,7 +1764,7 @@ bool File::set_attributes_from_info(const Glib::RefPtr& info, const Gl bool File::set_attributes_from_info(const Glib::RefPtr& info, FileQueryInfoFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1775,7 +1775,7 @@ bool File::set_attributes_from_info(const Glib::RefPtr& info, FileQuer bool File::copy_attributes(const Glib::RefPtr& destination, const Glib::RefPtr& cancellable, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_copy_attributes(gobj(), @@ -1793,7 +1793,7 @@ File::copy_attributes(const Glib::RefPtr& destination, const Glib::RefPtr< bool File::copy_attributes(const Glib::RefPtr& destination, FileCopyFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; bool res; res = g_file_copy_attributes(gobj(), @@ -1810,7 +1810,7 @@ File::copy_attributes(const Glib::RefPtr& destination, FileCopyFlags flags Glib::RefPtr File::create_file(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1820,7 +1820,7 @@ Glib::RefPtr File::create_file(const Glib::RefPtr Glib::RefPtr File::create_file(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1830,7 +1830,7 @@ Glib::RefPtr File::create_file(FileCreateFlags flags) Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1840,7 +1840,7 @@ Glib::RefPtr File::create_file_readwrite(const Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1850,7 +1850,7 @@ Glib::RefPtr File::create_file_readwrite(FileCreateFlags flags) Glib::RefPtr File::append_to(const Glib::RefPtr& cancellable, FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1860,7 +1860,7 @@ Glib::RefPtr File::append_to(const Glib::RefPtr& Glib::RefPtr File::append_to(FileCreateFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1870,8 +1870,8 @@ Glib::RefPtr File::append_to(FileCreateFlags flags) bool File::load_contents(const Glib::RefPtr& cancellable, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1883,7 +1883,7 @@ bool File::load_contents(const Glib::RefPtr& cancellable, char*& co bool File::load_contents(const Glib::RefPtr& cancellable, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1893,8 +1893,8 @@ bool File::load_contents(const Glib::RefPtr& cancellable, char*& co bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents(gobj(), 0, &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1906,7 +1906,7 @@ bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) bool File::load_contents(char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents(gobj(), 0, &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1916,8 +1916,8 @@ bool File::load_contents(char*& contents, gsize& length) bool File::load_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1929,7 +1929,7 @@ bool File::load_contents_finish(const Glib::RefPtr& result, char*& bool File::load_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1939,8 +1939,8 @@ bool File::load_contents_finish(const Glib::RefPtr& result, char*& bool File::load_partial_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length, std::string& etag_out) { - GError* gerror = 0; - gchar* cetag_out = 0; + GError* gerror = nullptr; + gchar* cetag_out = nullptr; bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -1952,7 +1952,7 @@ bool File::load_partial_contents_finish(const Glib::RefPtr& result, bool File::load_partial_contents_finish(const Glib::RefPtr& result, char*& contents, gsize& length) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileattributeinfolist.ccg b/gio/src/fileattributeinfolist.ccg index 7332e3d..717b731 100644 --- a/gio/src/fileattributeinfolist.ccg +++ b/gio/src/fileattributeinfolist.ccg @@ -29,7 +29,7 @@ FileAttributeInfoList::operator bool() const bool FileAttributeInfoList::empty() const { - return gobj() == 0; + return gobj() == nullptr; } FileAttributeInfo diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg index 087f970..74242dd 100644 --- a/gio/src/fileinputstream.ccg +++ b/gio/src/fileinputstream.ccg @@ -26,7 +26,7 @@ namespace Gio Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -36,7 +36,7 @@ Glib::RefPtr FileInputStream::query_info(const Glib::RefPtr FileInputStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg index ed8757b..e1a7c2d 100644 --- a/gio/src/fileiostream.ccg +++ b/gio/src/fileiostream.ccg @@ -26,7 +26,7 @@ namespace Gio Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -36,7 +36,7 @@ Glib::RefPtr FileIOStream::query_info(const Glib::RefPtr& Glib::RefPtr FileIOStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg index 7b940fe..a0c31df 100644 --- a/gio/src/fileoutputstream.ccg +++ b/gio/src/fileoutputstream.ccg @@ -28,7 +28,7 @@ namespace Gio Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr& cancellable, const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -40,7 +40,7 @@ Glib::RefPtr FileOutputStream::query_info(const Glib::RefPtr FileOutputStream::query_info(const std::string& attributes) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/icon.ccg b/gio/src/icon.ccg index 76295bf..583897a 100644 --- a/gio/src/icon.ccg +++ b/gio/src/icon.ccg @@ -32,7 +32,7 @@ Icon::equal(const Glib::RefPtr& other) const Glib::RefPtr Icon::create(const std::string& str) { - GError* gerror = 0; + GError* gerror = nullptr; auto icon = g_icon_new_for_string(str.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index c11a44b..9ae383d 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -29,7 +29,7 @@ Glib::RefPtr LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr& cancellable) { char* c_type; - GError* gerror = 0; + GError* gerror = nullptr; auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, @@ -50,7 +50,7 @@ Glib::RefPtr LoadableIcon::load(int size, Glib::ustring& type) { char* c_type; - GError* gerror = 0; + GError* gerror = nullptr; auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg index 344506d..cf30294 100644 --- a/gio/src/memoryinputstream.ccg +++ b/gio/src/memoryinputstream.ccg @@ -70,7 +70,7 @@ void MemoryInputStream::add_data(const std::string& data) void MemoryInputStream::add_data(const void* data, gssize len) { - char *data_copy = 0; + char *data_copy = nullptr; // copy the data so that the caller doesn't need to keep the data alive if (len < 0) diff --git a/gio/src/menuattributeiter.ccg b/gio/src/menuattributeiter.ccg index a6f9f68..08e8d4e 100644 --- a/gio/src/menuattributeiter.ccg +++ b/gio/src/menuattributeiter.ccg @@ -23,8 +23,8 @@ namespace Gio bool MenuAttributeIter::get_next(Glib::ustring& out_name, Glib::VariantBase& value) { - const char* g_out_name = 0; - GVariant* g_value = 0; + const char* g_out_name = nullptr; + GVariant* g_value = nullptr; bool const result = g_menu_attribute_iter_get_next(gobj(), &g_out_name, &g_value); diff --git a/gio/src/menuitem.ccg b/gio/src/menuitem.ccg index de96ad3..4c011ab 100644 --- a/gio/src/menuitem.ccg +++ b/gio/src/menuitem.ccg @@ -57,7 +57,7 @@ void MenuItem::set_action(const Glib::ustring& action) void MenuItem::unset_target() { - const gchar *action_name = 0; + const gchar *action_name = nullptr; g_menu_item_get_attribute (gobj(), G_MENU_ATTRIBUTE_ACTION, "&s", &action_name); g_menu_item_set_action_and_target_value(gobj(), action_name, 0); diff --git a/gio/src/menulinkiter.ccg b/gio/src/menulinkiter.ccg index 9fb93b5..b41fbb1 100644 --- a/gio/src/menulinkiter.ccg +++ b/gio/src/menulinkiter.ccg @@ -24,8 +24,8 @@ namespace Gio bool MenuLinkIter::get_next(Glib::ustring& out_link, Glib::RefPtr& value) { - const char* g_out_link = 0; - GMenuModel* g_value = 0; + const char* g_out_link = nullptr; + GMenuModel* g_value = nullptr; bool const result = g_menu_link_iter_get_next(gobj(), &g_out_link, &g_value); out_link = g_out_link; diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg index 522a700..d5c3644 100644 --- a/gio/src/mount.ccg +++ b/gio/src/mount.ccg @@ -281,7 +281,7 @@ void Mount::guess_content_type(bool force_rescan) void Mount::guess_content_type_sync(const Glib::RefPtr& cancellable, bool force_rescan) { - GError* gerror = 0; + GError* gerror = nullptr; g_mount_guess_content_type_sync(gobj(), force_rescan, Glib::unwrap(cancellable), &gerror); if(gerror) @@ -290,7 +290,7 @@ void Mount::guess_content_type_sync(const Glib::RefPtr& cancellable void Mount::guess_content_type_sync(bool force_rescan) { - GError* gerror = 0; + GError* gerror = nullptr; g_mount_guess_content_type_sync(gobj(), force_rescan, 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/networkaddress.ccg b/gio/src/networkaddress.ccg index 20cae4a..dad0dcf 100644 --- a/gio/src/networkaddress.ccg +++ b/gio/src/networkaddress.ccg @@ -28,7 +28,7 @@ namespace Gio Glib::RefPtr NetworkAddress::parse(const std::string& host_and_port, guint16 default_port) { - GError *error = 0; + GError *error = nullptr; auto *address = G_NETWORK_ADDRESS (g_network_address_parse (host_and_port.c_str (), default_port, &error)); diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index 5ac47fb..df1c53b 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -191,7 +191,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, int io_priority) gssize OutputStream::write(const std::string& buffer, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_write(gobj(), buffer.data(), buffer.size(), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -201,7 +201,7 @@ gssize OutputStream::write(const std::string& buffer, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -221,7 +221,7 @@ bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written, co bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -264,7 +264,7 @@ OutputStream::write_bytes_async(const Glib::RefPtr& bytes, co gssize OutputStream::splice(const Glib::RefPtr& source, const Glib::RefPtr& cancellable, OutputStreamSpliceFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -274,7 +274,7 @@ gssize OutputStream::splice(const Glib::RefPtr& source, const Glib: gssize OutputStream::splice(const Glib::RefPtr& source, OutputStreamSpliceFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 01a93b8..b5a0584 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -29,7 +29,7 @@ namespace Gio std::vector ProxyResolver::lookup(const Glib::ustring& uri) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::ArrayHandler::array_to_vector(g_proxy_resolver_lookup(gobj(), uri.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) diff --git a/gio/src/resource.ccg b/gio/src/resource.ccg index 4a4b716..89d776a 100644 --- a/gio/src/resource.ccg +++ b/gio/src/resource.ccg @@ -24,7 +24,7 @@ void Resource::get_info(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) const { guint32 file_flags = 0; - GError* gerror = 0; + GError* gerror = nullptr; // Ignore the gboolean return value from g_resource_get_info(). // gerror is set if and only if the return value is FALSE. g_resource_get_info(const_cast(gobj()), path.c_str(), @@ -36,7 +36,7 @@ void Resource::get_info(const std::string& path, gsize& size, void Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const { - GError* gerror = 0; + GError* gerror = nullptr; g_resource_get_info(const_cast(gobj()), path.c_str(), (GResourceLookupFlags)lookup_flags, 0, 0, &gerror); if (gerror) @@ -55,7 +55,7 @@ void Resource::get_info_global(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) { guint32 file_flags = 0; - GError* gerror = 0; + GError* gerror = nullptr; // Ignore the gboolean return value from g_resources_get_info(). // gerror is set if and only if the return value is FALSE. g_resources_get_info(path.c_str(), diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg index 107493f..571bc00 100644 --- a/gio/src/socket.ccg +++ b/gio/src/socket.ccg @@ -56,8 +56,8 @@ Glib::RefPtr Socket::create_from_fd(int fd, const Glib::RefPtr& address, char* buffer, gsize size, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GSocketAddress* caddr = 0; + GError* gerror = nullptr; + GSocketAddress* caddr = nullptr; auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -70,8 +70,8 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gsize size) { - GError* gerror = 0; - GSocketAddress* caddr = 0; + GError* gerror = nullptr; + GSocketAddress* caddr = nullptr; auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -85,7 +85,7 @@ gssize Socket::receive_from(Glib::RefPtr& address, char* buffer, gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) @@ -97,7 +97,7 @@ gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg index 75552e4..1697ced 100644 --- a/gio/src/socketlistener.ccg +++ b/gio/src/socketlistener.ccg @@ -25,7 +25,7 @@ namespace Gio bool SocketListener::add_socket(const Glib::RefPtr& socket) { - GError* gerror = 0; + GError* gerror = nullptr; const bool retval = g_socket_listener_add_socket(gobj(), Glib::unwrap(socket), 0, @@ -40,8 +40,8 @@ bool SocketListener::add_socket(const Glib::RefPtr& socket) bool SocketListener::add_address(const Glib::RefPtr& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr& source_object, Glib::RefPtr& effective_address) { - GError* gerror = 0; - GSocketAddress *retaddr = 0; + GError* gerror = nullptr; + GSocketAddress *retaddr = nullptr; const bool retval = g_socket_listener_add_address (gobj(), Glib::unwrap(address), static_cast(type), @@ -60,8 +60,8 @@ bool SocketListener::add_address(const Glib::RefPtr& address, Soc bool SocketListener::add_address(const Glib::RefPtr& address, SocketType type, SocketProtocol protocol, Glib::RefPtr& effective_address) { - GError* gerror = 0; - GSocketAddress *retaddr = 0; + GError* gerror = nullptr; + GSocketAddress *retaddr = nullptr; const bool retval = g_socket_listener_add_address (gobj(), Glib::unwrap(address), static_cast(type), @@ -81,7 +81,7 @@ bool SocketListener::add_address(const Glib::RefPtr& address, Soc bool SocketListener::add_inet_port(guint16 port) { - GError* gerror = 0; + GError* gerror = nullptr; const bool retvalue = g_socket_listener_add_inet_port(gobj(), port, 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -92,7 +92,7 @@ bool SocketListener::add_inet_port(guint16 port) guint16 SocketListener::add_any_inet_port() { - GError* gerror = 0; + GError* gerror = nullptr; const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -103,8 +103,8 @@ guint16 SocketListener::add_any_inet_port() Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& source_object, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, Glib::unwrap(cancellable), @@ -120,8 +120,8 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, 0, @@ -137,7 +137,7 @@ Glib::RefPtr SocketListener::accept_socket(Glib::RefPtr& s Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), 0, Glib::unwrap(cancellable), @@ -150,7 +150,7 @@ Glib::RefPtr SocketListener::accept_socket(const Glib::RefPtr SocketListener::accept_socket() { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket(gobj(), 0, 0, @@ -190,8 +190,8 @@ void SocketListener::accept_socket_async(const SlotAsyncReady& slot) Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr& result, Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), &retobj, @@ -206,7 +206,7 @@ Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), 0, @@ -220,8 +220,8 @@ Glib::RefPtr SocketListener::accept_socket_finish(const Glib::RefPtr SocketListener::accept(Glib::RefPtr& source_object, const Glib::RefPtr& cancellable) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept(gobj(), &retobj, Glib::unwrap(cancellable), @@ -237,8 +237,8 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour Glib::RefPtr SocketListener::accept(Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept(gobj(), &retobj, 0, @@ -254,7 +254,7 @@ Glib::RefPtr SocketListener::accept(Glib::RefPtr& sour Glib::RefPtr SocketListener::accept(const Glib::RefPtr& cancellable) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept(gobj(), 0, Glib::unwrap(cancellable), @@ -267,7 +267,7 @@ Glib::RefPtr SocketListener::accept(const Glib::RefPtr SocketListener::accept() { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept(gobj(), 0, 0, @@ -307,8 +307,8 @@ void SocketListener::accept_async(const Glib::RefPtr& cancellable, Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr& result, Glib::RefPtr& source_object) { - GError* gerror = 0; - GObject *retobj = 0; + GError* gerror = nullptr; + GObject *retobj = nullptr; auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), &retobj, @@ -323,7 +323,7 @@ Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr< Glib::RefPtr SocketListener::accept_finish(const Glib::RefPtr& result) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), 0, diff --git a/glib/glibmm/containers.h b/glib/glibmm/containers.h index 7d78854..d863e5e 100644 --- a/glib/glibmm/containers.h +++ b/glib/glibmm/containers.h @@ -21,6 +21,8 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef GLIBMM_DISABLE_DEPRECATED + #include #include /* for backward compatibility */ #include @@ -358,4 +360,6 @@ public: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ +#endif //GLIBMM_DISABLE_DEPRECATED + #endif /* _GLIBMM_CONTAINERS_H */ diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc index 4fa95da..d611731 100644 --- a/glib/glibmm/dispatcher.cc +++ b/glib/glibmm/dispatcher.cc @@ -127,6 +127,10 @@ class DispatchNotifier : public sigc::trackable public: ~DispatchNotifier(); + // noncopyable + DispatchNotifier(const DispatchNotifier&) = delete; + DispatchNotifier& operator=(const DispatchNotifier&) = delete; + static DispatchNotifier* reference_instance( const Glib::RefPtr& context, const Dispatcher* dispatcher); static void unreference_instance( @@ -158,10 +162,6 @@ private: void create_pipe(); bool pipe_io_handler(Glib::IOCondition condition); bool pipe_is_empty(); - - // noncopyable - DispatchNotifier(const DispatchNotifier&); - DispatchNotifier& operator=(const DispatchNotifier&); }; /**** Glib::DispatchNotifier ***********************************************/ diff --git a/glib/glibmm/dispatcher.h b/glib/glibmm/dispatcher.h index 9672165..5de499d 100644 --- a/glib/glibmm/dispatcher.h +++ b/glib/glibmm/dispatcher.h @@ -78,6 +78,10 @@ public: */ Dispatcher(); + // noncopyable + Dispatcher(const Dispatcher&) = delete; + Dispatcher& operator=(const Dispatcher&) = delete; + /** Create new Dispatcher instance using an arbitrary main context. * @throw Glib::FileError */ @@ -93,10 +97,6 @@ private: sigc::signal signal_; DispatchNotifier* notifier_; - // noncopyable - Dispatcher(const Dispatcher&); - Dispatcher& operator=(const Dispatcher&); - #ifndef DOXYGEN_SHOULD_SKIP_THIS friend class Glib::DispatchNotifier; #endif diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index d55cb43..315ea71 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -29,7 +29,7 @@ namespace typedef std::map ThrowFuncTable; -static ThrowFuncTable* throw_func_table = 0; +static ThrowFuncTable* throw_func_table = nullptr; } // anonymous namespace @@ -65,7 +65,7 @@ Error& Error::operator=(const Error& other) if(gobject_) { g_error_free(gobject_); - gobject_ = 0; + gobject_ = nullptr; } if(other.gobject_) { @@ -75,7 +75,7 @@ Error& Error::operator=(const Error& other) return *this; } -Error::~Error() throw() +Error::~Error() noexcept { if(gobject_) g_error_free(gobject_); @@ -83,22 +83,22 @@ Error::~Error() throw() GQuark Error::domain() const { - g_return_val_if_fail(gobject_ != 0, 0); + g_return_val_if_fail(gobject_ != nullptr, 0); return gobject_->domain; } int Error::code() const { - g_return_val_if_fail(gobject_ != 0, -1); + g_return_val_if_fail(gobject_ != nullptr, -1); return gobject_->code; } Glib::ustring Error::what() const { - g_return_val_if_fail(gobject_ != 0, ""); - g_return_val_if_fail(gobject_->message != 0, ""); + g_return_val_if_fail(gobject_ != nullptr, ""); + g_return_val_if_fail(gobject_->message != nullptr, ""); return gobject_->message; } @@ -121,7 +121,7 @@ const GError* Error::gobj() const void Error::propagate(GError** dest) { g_propagate_error(dest, gobject_); - gobject_ = 0; + gobject_ = nullptr; } // static @@ -141,14 +141,14 @@ void Error::register_cleanup() if(throw_func_table) { delete throw_func_table; - throw_func_table = 0; + throw_func_table = nullptr; } } // static void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func) { - g_assert(throw_func_table != 0); + g_assert(throw_func_table != nullptr); (*throw_func_table)[error_domain] = throw_func; } @@ -156,7 +156,7 @@ void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func) // static, noreturn void Error::throw_exception(GError* gobject) { - g_assert(gobject != 0); + g_assert(gobject != nullptr); // Just in case Gtk::Main hasn't been instantiated yet. if(!throw_func_table) diff --git a/glib/glibmm/error.h b/glib/glibmm/error.h index d2701da..1886d9a 100644 --- a/glib/glibmm/error.h +++ b/glib/glibmm/error.h @@ -38,7 +38,7 @@ public: Error(const Error& other); Error& operator=(const Error& other); - virtual ~Error() throw(); + virtual ~Error() noexcept; GQuark domain() const; int code() const; diff --git a/glib/glibmm/exception.cc b/glib/glibmm/exception.cc index cc3d8ef..bf81ee0 100644 --- a/glib/glibmm/exception.cc +++ b/glib/glibmm/exception.cc @@ -30,7 +30,7 @@ namespace Glib { -Exception::~Exception() throw() +Exception::~Exception() noexcept {} Glib::ustring Exception::what() const diff --git a/glib/glibmm/exception.h b/glib/glibmm/exception.h index 56d58b6..c0e1270 100644 --- a/glib/glibmm/exception.h +++ b/glib/glibmm/exception.h @@ -31,7 +31,7 @@ namespace Glib class Exception { public: - virtual ~Exception() throw() = 0; + virtual ~Exception() noexcept = 0; virtual Glib::ustring what() const = 0; }; diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc index 734da3e..df0b53e 100644 --- a/glib/glibmm/exceptionhandler.cc +++ b/glib/glibmm/exceptionhandler.cc @@ -40,7 +40,7 @@ static Glib::Threads::Private thread_specific_handler_list; static void glibmm_exception_warning(const GError* error) { - g_assert(error != 0); + g_assert(error != nullptr); g_critical("\n" "unhandled exception (type Glib::Error) in signal handler:\n" @@ -99,7 +99,7 @@ sigc::connection add_exception_handler(const sigc::slot& slot) } // internal -void exception_handlers_invoke() throw() +void exception_handlers_invoke() noexcept { // This function will be called from our GLib signal handler proxies // if an exception has been caught. It's not possible to throw C++ diff --git a/glib/glibmm/exceptionhandler.h b/glib/glibmm/exceptionhandler.h index 534ca06..350cd02 100644 --- a/glib/glibmm/exceptionhandler.h +++ b/glib/glibmm/exceptionhandler.h @@ -34,7 +34,7 @@ sigc::connection add_exception_handler(const sigc::slot& slot); #ifndef DOXYGEN_SHOULD_SKIP_THIS // internal -void exception_handlers_invoke() throw(); +void exception_handlers_invoke() noexcept; #endif //DOXYGEN_SHOULD_SKIP_THIS } // namespace Glib diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index d9a1c95..2028a1d 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -81,7 +81,7 @@ public: } inline size_type max_size() { return size_type(-1); } - inline bool empty() { return glist() == 0; } + inline bool empty() { return glist() == nullptr; } inline iterator begin() {return begin_();} diff --git a/glib/glibmm/interface.cc b/glib/glibmm/interface.cc index c849565..8ed14d3 100644 --- a/glib/glibmm/interface.cc +++ b/glib/glibmm/interface.cc @@ -98,7 +98,7 @@ Interface::Interface(const Interface_Class& interface_class) g_free(iface_props); } } - else // gobject_ == 0 + else // gobject_ == nullptr { // The GObject is not instantiated yet. Add to the custom_interface_classes // and add the interface in the Glib::Object constructor. diff --git a/glib/glibmm/interface.h b/glib/glibmm/interface.h index 7b453a0..0fc9ba6 100644 --- a/glib/glibmm/interface.h +++ b/glib/glibmm/interface.h @@ -62,6 +62,10 @@ public: explicit Interface(GObject* castitem); virtual ~Interface(); + // noncopyable + Interface(const Interface&) = delete; + Interface& operator=(const Interface&) = delete; + //void add_interface(GType gtype_implementer); // Hook for translating API @@ -74,11 +78,6 @@ public: inline GObject* gobj() { return gobject_; } inline const GObject* gobj() const { return gobject_; } - -private: - // noncopyable - Interface(const Interface&); - Interface& operator=(const Interface&); }; RefPtr wrap_interface(GObject* object, bool take_copy = false); diff --git a/glib/glibmm/listhandle.h b/glib/glibmm/listhandle.h index e63bb0b..76bb7a8 100644 --- a/glib/glibmm/listhandle.h +++ b/glib/glibmm/listhandle.h @@ -37,7 +37,7 @@ namespace Container_Helpers template GList* create_list(Bi pbegin, Bi pend, Tr) { - GList* head = 0; + GList* head = nullptr; while(pend != pbegin) { @@ -56,7 +56,7 @@ GList* create_list(Bi pbegin, Bi pend, Tr) template GList* create_list(For pbegin, Tr) { - GList* head = 0; + GList* head = nullptr; while(*pbegin) { @@ -297,7 +297,7 @@ ListHandle::~ListHandle() if(ownership_ != Glib::OWNERSHIP_SHALLOW) { // Deep ownership: release each container element. - for(GList* node = plist_; node != 0; node = node->next) + for(GList* node = plist_; node != nullptr; node = node->next) Tr::release_c_type(static_cast(node->data)); } g_list_free(plist_); @@ -396,7 +396,7 @@ std::size_t ListHandle::size() const template inline bool ListHandle::empty() const { - return (plist_ == 0); + return (plist_ == nullptr); } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc index 81ffa40..9dfe09f 100644 --- a/glib/glibmm/main.cc +++ b/glib/glibmm/main.cc @@ -102,7 +102,7 @@ void* SourceConnectionNode::notify(void* data) if (self->source_) { GSource* s = self->source_; - self->source_ = 0; + self->source_ = nullptr; g_source_destroy(s); // Destroying the object triggers execution of destroy_notify_handler(), @@ -120,7 +120,7 @@ void SourceConnectionNode::destroy_notify_callback(void* data) if (self) { // The GLib side is disconnected now, thus the GSource* is no longer valid. - self->source_ = 0; + self->source_ = nullptr; delete self; } @@ -200,10 +200,10 @@ void SourceCallbackData::destroy_notify_callback(void* data) */ static SourceCallbackData* glibmm_source_get_callback_data(GSource* source) { - g_return_val_if_fail(source->callback_funcs != 0, 0); + g_return_val_if_fail(source->callback_funcs != nullptr, 0); GSourceFunc func; - void* user_data = 0; + void* user_data = nullptr; // Retrieve the callback function and data. (*source->callback_funcs->get)(source->callback_data, source, &func, &user_data); @@ -268,7 +268,7 @@ static gboolean glibmm_source_callback_once(void* data) static gboolean glibmm_iosource_callback(GIOChannel*, GIOCondition condition, void* data) { SourceCallbackData *const callback_data = static_cast(data); - g_return_val_if_fail(callback_data->node != 0, 0); + g_return_val_if_fail(callback_data->node != nullptr, 0); try { @@ -943,10 +943,10 @@ Source::~Source() if(gobject_) { SourceCallbackData *const data = glibmm_source_get_callback_data(gobject_); - data->wrapper = 0; + data->wrapper = nullptr; GSource *const tmp_gobject = gobject_; - gobject_ = 0; + gobject_ = nullptr; g_source_unref(tmp_gobject); @@ -1035,7 +1035,7 @@ gboolean Source::dispatch_vfunc(GSource*, GSourceFunc callback, void* user_data) SourceCallbackData *const callback_data = static_cast(user_data); g_return_val_if_fail(callback == &glibmm_dummy_source_callback, 0); - g_return_val_if_fail(callback_data != 0 && callback_data->node != 0, 0); + g_return_val_if_fail(callback_data != nullptr && callback_data->node != nullptr, 0); try { @@ -1057,7 +1057,7 @@ void Source::destroy_notify_callback(void* data) Source *const self = static_cast(data); // gobject_ is already invalid at this point. - self->gobject_ = 0; + self->gobject_ = nullptr; // No exception checking: if the dtor throws, you're out of luck anyway. delete self; @@ -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(data); - g_return_val_if_fail(callback_data->node != 0, 0); + g_return_val_if_fail(callback_data->node != nullptr, 0); return callback_data->node->get_slot(); } diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h index 30b40a6..53a2370 100644 --- a/glib/glibmm/main.h +++ b/glib/glibmm/main.h @@ -405,6 +405,10 @@ public: typedef Glib::MainContext CppObjectType; typedef GMainContext BaseObjectType; + // noncopyable + MainContext(const MainContext& other) = delete; + MainContext& operator=(const MainContext& other) = delete; + /** Creates a new MainContext. * @return The new MainContext. */ @@ -587,11 +591,6 @@ private: // Glib::MainContext can neither be constructed nor deleted. MainContext(); void operator delete(void*, std::size_t); - - // noncopyable - MainContext(const MainContext& other); - MainContext& operator=(const MainContext& other); - }; /** @relates Glib::MainContext */ @@ -662,6 +661,10 @@ public: typedef Glib::Source CppObjectType; typedef GSource BaseObjectType; + // noncopyable + Source(const Source&) = delete; + Source& operator=(const Source&) = delete; + static Glib::RefPtr create() /* = 0 */; /** Adds a Source to a context so that it will be executed within that context. @@ -802,13 +805,7 @@ public: static sigc::slot_base* get_slot_from_connection_node(void* data); // Used by derived Source classes in other files. static sigc::slot_base* get_slot_from_callback_data(void* data); - -private: #endif /* DOXYGEN_SHOULD_SKIP_THIS */ - - // noncopyable - Source(const Source&); - Source& operator=(const Source&); }; diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc index 1658d81..ddaa47b 100644 --- a/glib/glibmm/object.cc +++ b/glib/glibmm/object.cc @@ -84,10 +84,10 @@ ConstructParams::ConstructParams(const Glib::Class& glibmm_class_, static_cast(g_type_class_ref(glibmm_class.get_type())); unsigned int n_alloced_params = 0; - char* collect_error = 0; // output argument of G_VALUE_COLLECT() + char* collect_error = nullptr; // output argument of G_VALUE_COLLECT() for(const char* name = first_property_name; - name != 0; + name != nullptr; name = va_arg(var_args, char*)) { GParamSpec *const pspec = g_object_class_find_property(g_class, name); diff --git a/glib/glibmm/object.h b/glib/glibmm/object.h index 4ac56a1..202b28e 100644 --- a/glib/glibmm/object.h +++ b/glib/glibmm/object.h @@ -103,6 +103,10 @@ public: typedef GObjectClass BaseClassType; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ + // noncopyable + Object(const Object&) = delete; + Object& operator=(const Object&) = delete; + protected: Object(); //For use by C++-only sub-types. explicit Object(const Glib::ConstructParams& construct_params); @@ -145,10 +149,6 @@ private: friend class Glib::Object_Class; static CppClassType object_class_; - // noncopyable - Object(const Object&); - Object& operator=(const Object&); - #endif /* DOXYGEN_SHOULD_SKIP_THIS */ // Glib::Object can not be dynamic because it lacks a float state. diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc index c7add7f..c1efb13 100644 --- a/glib/glibmm/objectbase.cc +++ b/glib/glibmm/objectbase.cc @@ -119,7 +119,7 @@ ObjectBase::~ObjectBase() g_warning("(Glib::ObjectBase::~ObjectBase): gobject_ = %p", (void*) gobject_); #endif - gobject_ = 0; + gobject_ = nullptr; #ifdef GLIBMM_DEBUG_REFCOUNTING g_warning("(Glib::ObjectBase::~ObjectBase): before g_object_steal_qdata()"); @@ -222,7 +222,7 @@ void ObjectBase::destroy_notify_() g_warning("Glib::ObjectBase::destroy_notify_: gobject_ = %p", (void*) gobject_); #endif - gobject_ = 0; // Make sure we don't unref it again in the dtor. + gobject_ = nullptr; // Make sure we don't unref it again in the dtor. delete this; } @@ -236,7 +236,7 @@ bool ObjectBase::is_anonymous_custom_() const bool ObjectBase::is_derived_() const { // gtkmmproc-generated classes initialize this to 0 by default. - return (custom_type_name_ != 0); + return (custom_type_name_ != nullptr); } void ObjectBase::set_manage() diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index fe501df..44fb7ad 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -57,6 +57,12 @@ class Mutex; */ class GLIBMM_API ObjectBase : virtual public sigc::trackable { +public: + + // noncopyable + ObjectBase(const ObjectBase&) = delete; + ObjectBase& operator=(const ObjectBase&) = delete; + protected: /** This default constructor is called implicitly from the constructor of user-derived * classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. @@ -70,7 +76,7 @@ protected: * The C++ language itself ensures that the constructor * is only invoked once. * - * All classes generated by gtkmmproc use this constructor, with custom_type_name = 0, + * All classes generated by gtkmmproc use this constructor, with custom_type_name = nullptr, * which essentially means it's not a custom type. This is used to optimize * vfunc and signal handler callbacks -- since the C++ virtual methods are * not overridden, invocation can be skipped. @@ -224,7 +230,7 @@ public: // is_derived_() must be public, so that overridden vfuncs and signal h /// This is for use by gtkmm wrappers only, and not by applications. //inline bool is_derived_inline_() const //{ - // return (custom_type_name_ != 0); + // return (custom_type_name_ != nullptr); //} protected: @@ -235,9 +241,6 @@ protected: #endif //DOXYGEN_SHOULD_SKIP_THIS private: - // noncopyable - ObjectBase(const ObjectBase&); - ObjectBase& operator=(const ObjectBase&); #ifndef DOXYGEN_SHOULD_SKIP_THIS virtual void set_manage(); // calls g_error() diff --git a/glib/glibmm/pattern.h b/glib/glibmm/pattern.h index 6f527cc..dff0a97 100644 --- a/glib/glibmm/pattern.h +++ b/glib/glibmm/pattern.h @@ -43,6 +43,10 @@ public: explicit PatternSpec(GPatternSpec* gobject); ~PatternSpec(); + // noncopyable + PatternSpec(const PatternSpec&) = delete; + PatternSpec& operator=(const PatternSpec&) = delete; + bool match(const Glib::ustring& str) const; bool match(const Glib::ustring& str, const Glib::ustring& str_reversed) const; @@ -54,10 +58,6 @@ public: private: GPatternSpec* gobject_; - - // noncopyable - PatternSpec(const PatternSpec&); - PatternSpec& operator=(const PatternSpec&); }; /** @} group PatternMatching */ diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc index 4cf054f..346c3e1 100644 --- a/glib/glibmm/property.cc +++ b/glib/glibmm/property.cc @@ -239,7 +239,7 @@ PropertyBase::~PropertyBase() bool PropertyBase::lookup_property(const Glib::ustring& name) { - g_assert(param_spec_ == 0); + g_assert(param_spec_ == nullptr); param_spec_ = g_object_class_find_property(G_OBJECT_GET_CLASS(object_->gobj()), name.c_str()); @@ -249,12 +249,12 @@ bool PropertyBase::lookup_property(const Glib::ustring& name) g_param_spec_ref(param_spec_); } - return (param_spec_ != 0); + return (param_spec_ != nullptr); } void PropertyBase::install_property(GParamSpec* param_spec) { - g_return_if_fail(param_spec != 0); + g_return_if_fail(param_spec != nullptr); // Ensure that there would not be id clashes with possible existing // properties overridden from implemented interfaces if dealing with a custom @@ -280,7 +280,7 @@ void PropertyBase::install_property(GParamSpec* param_spec) const char* PropertyBase::get_name_internal() const { const char *const name = g_param_spec_get_name(param_spec_); - g_return_val_if_fail(name != 0, ""); + g_return_val_if_fail(name != nullptr, ""); return name; } diff --git a/glib/glibmm/property.h b/glib/glibmm/property.h index 716d859..dadc0f2 100644 --- a/glib/glibmm/property.h +++ b/glib/glibmm/property.h @@ -57,6 +57,10 @@ class PropertyBase { public: + // noncopyable + PropertyBase(const PropertyBase&) = delete; + PropertyBase& operator=(const PropertyBase&) = delete; + /** Returns the name of the property. */ Glib::ustring get_name() const; @@ -98,9 +102,6 @@ protected: const char* get_name_internal() const; private: - // noncopyable - PropertyBase(const PropertyBase&); - PropertyBase& operator=(const PropertyBase&); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc index 0f1fac8..4d44939 100644 --- a/glib/glibmm/propertyproxy_base.cc +++ b/glib/glibmm/propertyproxy_base.cc @@ -112,7 +112,7 @@ void PropertyProxy_Base::reset_property_() const GParamSpec *const pParamSpec = g_object_class_find_property(G_OBJECT_GET_CLASS(obj_->gobj()), property_name_); - g_return_if_fail(pParamSpec != 0); + g_return_if_fail(pParamSpec != nullptr); Glib::ValueBase value; value.init(G_PARAM_SPEC_VALUE_TYPE(pParamSpec)); diff --git a/glib/glibmm/random.h b/glib/glibmm/random.h index 864a4a3..aeda3a6 100644 --- a/glib/glibmm/random.h +++ b/glib/glibmm/random.h @@ -43,6 +43,10 @@ public: explicit Rand(guint32 seed); ~Rand(); + // noncopyable + Rand(const Rand&) = delete; + Rand& operator=(const Rand&) = delete; + void set_seed(guint32 seed); bool get_bool(); @@ -58,10 +62,6 @@ public: private: GRand* gobject_; - - // noncopyable - Rand(const Rand&); - Rand& operator=(const Rand&); }; /** @} group Random */ diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index 7b11a75..1aca555 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -66,7 +66,11 @@ public: * * This increments the shared reference count. */ - inline RefPtr(const RefPtr& src); + inline RefPtr(const RefPtr& src); + + /** Move constructor + */ + inline RefPtr(RefPtr&& src); /** Copy constructor (from different, but castable type). * @@ -80,23 +84,26 @@ public: * done safely without involving a reference/unreference cycle and is * therefore highly efficient. */ - inline void swap(RefPtr& other); + inline void swap(RefPtr& other); /// Copy from another RefPtr: - inline RefPtr& operator=(const RefPtr& src); + inline RefPtr& operator=(const RefPtr& src); + + /// Move assignment operator: + inline RefPtr& operator=(RefPtr&& src); /** Copy from different, but castable type). * * Increments the reference count. */ template - inline RefPtr& operator=(const RefPtr& src); + inline RefPtr& operator=(const RefPtr& src); /// Tests whether the RefPtr<> point to the same underlying instance. - inline bool operator==(const RefPtr& src) const; + inline bool operator==(const RefPtr& src) const; /// See operator==(). - inline bool operator!=(const RefPtr& src) const; + inline bool operator!=(const RefPtr& src) const; /** Dereferencing. * @@ -133,7 +140,7 @@ public: * @endcode */ template - static inline RefPtr cast_dynamic(const RefPtr& src); + static inline RefPtr cast_dynamic(const RefPtr& src); /** Static cast to derived class. * @@ -143,7 +150,7 @@ public: * @endcode */ template - static inline RefPtr cast_static(const RefPtr& src); + static inline RefPtr cast_static(const RefPtr& src); /** Cast to non-const. * @@ -153,7 +160,7 @@ public: * @endcode */ template - static inline RefPtr cast_const(const RefPtr& src); + static inline RefPtr cast_const(const RefPtr& src); //TODO: Maybe remove these if we replace operator bool() with operator const void* after //an API/ABI break, as suggested by Daniel Elstner? murrayc. @@ -168,16 +175,16 @@ public: * is still syntactically possible, but the result is semantically * wrong, as p1 REL_OP p2 is interpreted as (bool)p1 REL_OP (bool)p2. */ - inline bool operator<(const RefPtr& src) const; + inline bool operator<(const RefPtr& src) const; /// See operator<(). - inline bool operator<=(const RefPtr& src) const; + inline bool operator<=(const RefPtr& src) const; /// See operator<(). - inline bool operator>(const RefPtr& src) const; + inline bool operator>(const RefPtr& src) const; /// See operator<(). - inline bool operator>=(const RefPtr& src) const; + inline bool operator>=(const RefPtr& src) const; private: T_CppObject* pCppObject_; @@ -215,7 +222,7 @@ RefPtr::RefPtr(T_CppObject* pCppObject) {} template inline -RefPtr::RefPtr(const RefPtr& src) +RefPtr::RefPtr(const RefPtr& src) : pCppObject_ (src.pCppObject_) { @@ -223,6 +230,14 @@ RefPtr::RefPtr(const RefPtr& src) pCppObject_->reference(); } +template inline +RefPtr::RefPtr(RefPtr&& src) +: + pCppObject_ (src.pCppObject_) +{ + src.pCppObject_ = nullptr; +} + // The templated ctor allows copy construction from any object that's // castable. Thus, it does downcasts: // base_ref = derived_ref @@ -241,7 +256,7 @@ RefPtr::RefPtr(const RefPtr& src) } template inline -void RefPtr::swap(RefPtr& other) +void RefPtr::swap(RefPtr& other) { T_CppObject *const temp = pCppObject_; pCppObject_ = other.pCppObject_; @@ -249,7 +264,7 @@ void RefPtr::swap(RefPtr& other) } template inline -RefPtr& RefPtr::operator=(const RefPtr& src) +RefPtr& RefPtr::operator=(const RefPtr& src) { // In case you haven't seen the swap() technique to implement copy // assignment before, here's what it does: @@ -280,6 +295,23 @@ RefPtr& RefPtr::operator=(const RefPtr& s return *this; } +template inline +RefPtr& RefPtr::operator=(RefPtr&& src) +{ + if (pCppObject_) + pCppObject_->unreference(); + + pCppObject_ = src.pCppObject_; + src.pCppObject_ = nullptr; + + //This should work instead, but seems less efficient: + //RefPtr temp (src); + //this->swap(temp); + //src.pCppObject_ = nullptr; + + return *this; +} + template template inline @@ -291,13 +323,13 @@ RefPtr& RefPtr::operator=(const RefPtr& sr } template inline -bool RefPtr::operator==(const RefPtr& src) const +bool RefPtr::operator==(const RefPtr& src) const { return (pCppObject_ == src.pCppObject_); } template inline -bool RefPtr::operator!=(const RefPtr& src) const +bool RefPtr::operator!=(const RefPtr& src) const { return (pCppObject_ != src.pCppObject_); } @@ -305,7 +337,7 @@ bool RefPtr::operator!=(const RefPtr& src) const template inline RefPtr::operator bool() const { - return (pCppObject_ != 0); + return (pCppObject_ != nullptr); } #ifndef GLIBMM_DISABLE_DEPRECATED @@ -363,25 +395,25 @@ RefPtr RefPtr::cast_const(const RefPtr& sr } template inline -bool RefPtr::operator<(const RefPtr& src) const +bool RefPtr::operator<(const RefPtr& src) const { return (pCppObject_ < src.pCppObject_); } template inline -bool RefPtr::operator<=(const RefPtr& src) const +bool RefPtr::operator<=(const RefPtr& src) const { return (pCppObject_ <= src.pCppObject_); } template inline -bool RefPtr::operator>(const RefPtr& src) const +bool RefPtr::operator>(const RefPtr& src) const { return (pCppObject_ > src.pCppObject_); } template inline -bool RefPtr::operator>=(const RefPtr& src) const +bool RefPtr::operator>=(const RefPtr& src) const { return (pCppObject_ >= src.pCppObject_); } diff --git a/glib/glibmm/signalproxy_connectionnode.cc b/glib/glibmm/signalproxy_connectionnode.cc index cc6f707..6784d6e 100644 --- a/glib/glibmm/signalproxy_connectionnode.cc +++ b/glib/glibmm/signalproxy_connectionnode.cc @@ -51,7 +51,7 @@ void* SignalProxyConnectionNode::notify(void* data) if(conn && conn->object_) { GObject* o = conn->object_; - conn->object_ = 0; + conn->object_ = nullptr; if(g_signal_handler_is_connected(o, conn->connection_id_)) //We check first, because during destruction, GTK+ sometimes seems to disconnect them for us, before we expect it to. See bug #87912 { @@ -84,7 +84,7 @@ void SignalProxyConnectionNode::destroy_notify_handler(gpointer data, GClosure*) if(conn) { // the object has already lost track of this object. - conn->object_ = 0; + conn->object_ = nullptr; delete conn; // if there are connection objects referring to slot_ they are notified during destruction of slot_ } diff --git a/glib/glibmm/slisthandle.h b/glib/glibmm/slisthandle.h index a83cc85..231d675 100644 --- a/glib/glibmm/slisthandle.h +++ b/glib/glibmm/slisthandle.h @@ -37,7 +37,7 @@ namespace Container_Helpers template GSList* create_slist(Bi pbegin, Bi pend, Tr) { - GSList* head = 0; + GSList* head = nullptr; while(pend != pbegin) { @@ -56,7 +56,7 @@ GSList* create_slist(Bi pbegin, Bi pend, Tr) template GSList* create_slist(For pbegin, Tr) { - GSList* head = 0; + GSList* head = nullptr; while(*pbegin) { @@ -296,7 +296,7 @@ SListHandle::~SListHandle() if(ownership_ != Glib::OWNERSHIP_SHALLOW) { // Deep ownership: release each container element. - for(GSList* node = pslist_; node != 0; node = node->next) + for(GSList* node = pslist_; node != nullptr; node = node->next) Tr::release_c_type(static_cast(node->data)); } g_slist_free(pslist_); @@ -395,7 +395,7 @@ std::size_t SListHandle::size() const template inline bool SListHandle::empty() const { - return (pslist_ == 0); + return (pslist_ == nullptr); } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/glibmm/streamiochannel.cc b/glib/glibmm/streamiochannel.cc index 8a1b10a..674960d 100644 --- a/glib/glibmm/streamiochannel.cc +++ b/glib/glibmm/streamiochannel.cc @@ -59,7 +59,7 @@ StreamIOChannel::~StreamIOChannel() IOStatus StreamIOChannel::read_vfunc(char* buf, gsize count, gsize& bytes_read) { - g_return_val_if_fail(stream_in_ != 0, IO_STATUS_ERROR); + g_return_val_if_fail(stream_in_ != nullptr, IO_STATUS_ERROR); stream_in_->clear(); stream_in_->read(buf, count); @@ -78,7 +78,7 @@ IOStatus StreamIOChannel::read_vfunc(char* buf, gsize count, gsize& bytes_read) IOStatus StreamIOChannel::write_vfunc(const char* buf, gsize count, gsize& bytes_written) { - g_return_val_if_fail(stream_out_ != 0, IO_STATUS_ERROR); + g_return_val_if_fail(stream_out_ != nullptr, IO_STATUS_ERROR); bytes_written = 0; @@ -173,8 +173,8 @@ IOStatus StreamIOChannel::set_flags_vfunc(IOFlags) IOFlags StreamIOChannel::get_flags_vfunc() { gobj()->is_seekable = 1; - gobj()->is_readable = (stream_in_ != 0); - gobj()->is_writeable = (stream_out_ != 0); + gobj()->is_readable = (stream_in_ != nullptr); + gobj()->is_writeable = (stream_out_ != nullptr); IOFlags flags = IO_FLAG_IS_SEEKABLE; diff --git a/glib/glibmm/stringutils.cc b/glib/glibmm/stringutils.cc index 5b61dd1..e72f029 100644 --- a/glib/glibmm/stringutils.cc +++ b/glib/glibmm/stringutils.cc @@ -51,7 +51,7 @@ double Glib::Ascii::strtod(const std::string& str, } const char *const bufptr = str.c_str(); - char* endptr = 0; + char* endptr = nullptr; const double result = g_ascii_strtod(bufptr + start_index, &endptr); const int err_no = errno; diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc index 9a9af18..a007a43 100644 --- a/glib/glibmm/threadpool.cc +++ b/glib/glibmm/threadpool.cc @@ -34,6 +34,10 @@ public: SlotList(); ~SlotList(); + // noncopyable + SlotList(const ThreadPool::SlotList&) = delete; + ThreadPool::SlotList& operator=(const ThreadPool::SlotList&) = delete; + sigc::slot* push(const sigc::slot& slot); sigc::slot pop(sigc::slot* slot_ptr); @@ -42,10 +46,6 @@ public: private: Glib::Threads::Mutex mutex_; std::list< sigc::slot > list_; - - // noncopyable - SlotList(const ThreadPool::SlotList&); - ThreadPool::SlotList& operator=(const ThreadPool::SlotList&); }; ThreadPool::SlotList::SlotList() @@ -128,7 +128,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) gobject_ (0), slot_list_ (new SlotList()) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_thread_pool_new( &call_thread_entry_slot, slot_list_, max_threads, exclusive, &error); @@ -136,7 +136,7 @@ ThreadPool::ThreadPool(int max_threads, bool exclusive) if(error) { delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; Glib::Error::throw_exception(error); } } @@ -157,7 +157,7 @@ void ThreadPool::push(const sigc::slot& slot) { sigc::slot *const slot_ptr = slot_list_->push(slot); - GError* error = 0; + GError* error = nullptr; g_thread_pool_push(gobject_, slot_ptr, &error); if(error) @@ -169,7 +169,7 @@ void ThreadPool::push(const sigc::slot& slot) void ThreadPool::set_max_threads(int max_threads) { - GError* error = 0; + GError* error = nullptr; g_thread_pool_set_max_threads(gobject_, max_threads, &error); if(error) @@ -193,7 +193,7 @@ unsigned int ThreadPool::unprocessed() const bool ThreadPool::get_exclusive() const { - g_return_val_if_fail(gobject_ != 0, false); + g_return_val_if_fail(gobject_ != nullptr, false); return gobject_->exclusive; } @@ -203,14 +203,14 @@ void ThreadPool::shutdown(bool immediately) if(gobject_) { g_thread_pool_free(gobject_, immediately, 1); - gobject_ = 0; + gobject_ = nullptr; } if(slot_list_) { slot_list_->lock_and_unlock(); delete slot_list_; - slot_list_ = 0; + slot_list_ = nullptr; } } diff --git a/glib/glibmm/timer.h b/glib/glibmm/timer.h index 4864e68..2c68d3a 100644 --- a/glib/glibmm/timer.h +++ b/glib/glibmm/timer.h @@ -41,6 +41,10 @@ public: Timer(); ~Timer(); + // not copyable + Timer(const Timer&) = delete; + Timer& operator=(const Timer&) = delete; + void start(); void stop(); void reset(); @@ -63,10 +67,6 @@ public: private: GTimer* gobject_; - - // not copyable - Timer(const Timer&); - Timer& operator=(const Timer&); }; diff --git a/glib/glibmm/ustring.cc b/glib/glibmm/ustring.cc index 6cb4b1f..1d5e841 100644 --- a/glib/glibmm/ustring.cc +++ b/glib/glibmm/ustring.cc @@ -1260,7 +1260,7 @@ ustring::FormatStream::~FormatStream() ustring ustring::FormatStream::to_string() const { - GError* error = 0; + GError* error = nullptr; #ifdef GLIBMM_HAVE_WIDE_STREAM const std::wstring str = stream_.str(); @@ -1304,7 +1304,7 @@ std::istream& operator>>(std::istream& is, Glib::ustring& utf8_string) std::string str; is >> str; - GError* error = 0; + GError* error = nullptr; gsize n_bytes = 0; const ScopedPtr buf (g_locale_to_utf8(str.data(), str.size(), 0, &n_bytes, &error)); @@ -1320,7 +1320,7 @@ std::istream& operator>>(std::istream& is, Glib::ustring& utf8_string) std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; const ScopedPtr buf (g_locale_from_utf8(utf8_string.raw().data(), utf8_string.raw().size(), 0, 0, &error)); if (error) @@ -1344,7 +1344,7 @@ std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string) std::wistream& operator>>(std::wistream& is, ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; std::wstring wstr; is >> wstr; @@ -1378,7 +1378,7 @@ std::wistream& operator>>(std::wistream& is, ustring& utf8_string) std::wostream& operator<<(std::wostream& os, const ustring& utf8_string) { - GError* error = 0; + GError* error = nullptr; #if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4 // Avoid going through iconv if wchar_t always contains UCS-4. diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index c93a7d7..3f74be7 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -875,6 +875,12 @@ struct ustring::SequenceToString : publ class ustring::FormatStream { +public: + + // noncopyable + FormatStream(const ustring::FormatStream&) = delete; + FormatStream& operator=(const ustring::FormatStream&) = delete; + private: #ifdef GLIBMM_HAVE_WIDE_STREAM typedef std::wostringstream StreamType; @@ -883,10 +889,6 @@ private: #endif StreamType stream_; - // noncopyable - FormatStream(const ustring::FormatStream&); - FormatStream& operator=(const ustring::FormatStream&); - public: FormatStream(); ~FormatStream(); @@ -1261,16 +1263,16 @@ class ustring::Stringify private: ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const T& arg) : string_ (ustring::format(arg)) {} //TODO: Why is this here? See the template specialization: explicit inline Stringify(const char* arg) : string_(arg) {} + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1281,12 +1283,13 @@ class ustring::Stringify private: const ustring& string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const ustring& arg) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1299,12 +1302,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char* arg) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1317,12 +1321,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char arg[N]) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; @@ -1336,12 +1341,13 @@ class ustring::Stringify private: const ustring string_; - // noncopyable - Stringify(const ustring::Stringify&); - Stringify& operator=(const ustring::Stringify&); - public: explicit inline Stringify(const char arg[N]) : string_(arg) {} + + // noncopyable + Stringify(const ustring::Stringify&) = delete; + Stringify& operator=(const ustring::Stringify&) = delete; + inline const ustring* ptr() const { return &string_; } }; diff --git a/glib/glibmm/wrap.cc b/glib/glibmm/wrap.cc index 4d9c71c..4b801a4 100644 --- a/glib/glibmm/wrap.cc +++ b/glib/glibmm/wrap.cc @@ -38,7 +38,7 @@ namespace typedef std::vector WrapFuncTable; -static WrapFuncTable* wrap_func_table = 0; +static WrapFuncTable* wrap_func_table = nullptr; } // anonymous namespace @@ -70,7 +70,7 @@ void wrap_register_cleanup() if(wrap_func_table) { delete wrap_func_table; - wrap_func_table = 0; + wrap_func_table = nullptr; } } @@ -95,7 +95,7 @@ void wrap_register(GType type, WrapNewFunction func) static Glib::ObjectBase* wrap_create_new_wrapper(GObject* object) { - g_return_val_if_fail(wrap_func_table != 0, 0); + g_return_val_if_fail(wrap_func_table != nullptr, 0); const bool gtkmm_wrapper_already_deleted = (bool)g_object_get_qdata((GObject*)object, Glib::quark_cpp_wrapper_deleted_); if(gtkmm_wrapper_already_deleted) @@ -140,7 +140,7 @@ static gboolean gtype_wraps_interface(GType implementer_type, GType interface_ty Glib::ObjectBase* wrap_create_new_wrapper_for_interface(GObject* object, GType interface_gtype) { - g_return_val_if_fail(wrap_func_table != 0, 0); + g_return_val_if_fail(wrap_func_table != nullptr, 0); const bool gtkmm_wrapper_already_deleted = (bool)g_object_get_qdata((GObject*)object, Glib::quark_cpp_wrapper_deleted_); if(gtkmm_wrapper_already_deleted) diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h index c4ca34e..f898785 100644 --- a/glib/glibmm/wrap.h +++ b/glib/glibmm/wrap.h @@ -73,7 +73,7 @@ TInterface* wrap_auto_interface(GObject* object, bool take_copy = false) //If no exact wrapper was created, //create an instance of the interface, //so we at least get the expected type: - TInterface* result = 0; + TInterface* result = nullptr; if(pCppObject) { result = dynamic_cast(pCppObject); diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg index 8362cb6..29d69ec 100644 --- a/glib/src/binding.ccg +++ b/glib/src/binding.ccg @@ -83,7 +83,7 @@ Glib::RefPtr Binding::bind_property_value( const SlotTransform& transform_to, const SlotTransform& transform_from) { - GBinding* binding = 0; + GBinding* binding = nullptr; if (transform_to.empty() && transform_from.empty()) { // No user-supplied transformations. diff --git a/glib/src/binding.hg b/glib/src/binding.hg index 7464f5d..5b5dd4b 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -384,7 +384,7 @@ public: /** Decrement the reference count for this object. * You should never need to do this manually - use the object via a RefPtr instead. */ - virtual void unreference() const; + void unreference() const override; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ private: diff --git a/glib/src/checksum.ccg b/glib/src/checksum.ccg index efa0d72..9a70050 100644 --- a/glib/src/checksum.ccg +++ b/glib/src/checksum.ccg @@ -28,7 +28,7 @@ Checksum::Checksum(ChecksumType type) Checksum::operator bool() const { - return gobject_ != 0; + return gobject_ != nullptr; } gssize Checksum::get_length(ChecksumType checksum_type) diff --git a/glib/src/convert.ccg b/glib/src/convert.ccg index 295088b..e752313 100644 --- a/glib/src/convert.ccg +++ b/glib/src/convert.ccg @@ -35,7 +35,7 @@ IConv::IConv(const std::string& to_codeset, const std::string& from_codeset) { if(gobject_ == reinterpret_cast(-1)) { - GError* gerror = 0; + GError* gerror = nullptr; // Abuse g_convert() to create a GError object. This may seem a weird // thing to do, but it gives us consistently translated error messages @@ -43,7 +43,7 @@ IConv::IConv(const std::string& to_codeset, const std::string& from_codeset) g_convert("", 0, to_codeset.c_str(), from_codeset.c_str(), 0, 0, &gerror); // If this should ever fail we're fucked. - g_assert(gerror != 0); + g_assert(gerror != nullptr); if(gerror) ::Glib::Error::throw_exception(gerror); } @@ -70,7 +70,7 @@ void IConv::reset() // NULL for anything but inbuf; work around that. (NULL outbuf // or NULL *outbuf is allowed by Unix98.) - char* outbuf = 0; + char* outbuf = nullptr; gsize inbytes_left = 0; gsize outbytes_left = 0; @@ -80,7 +80,7 @@ void IConv::reset() std::string IConv::convert(const std::string& str) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_convert_with_iconv( str.data(), str.size(), gobject_, 0, &bytes_written, &gerror); @@ -100,7 +100,7 @@ bool get_charset() bool get_charset(std::string& charset) { - const char* charset_cstr = 0; + const char* charset_cstr = nullptr; const bool is_utf8 = g_get_charset(&charset_cstr); charset = charset_cstr; @@ -113,7 +113,7 @@ std::string convert(const std::string& str, const std::string& from_codeset) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_convert( str.data(), str.size(), to_codeset.c_str(), from_codeset.c_str(), @@ -163,7 +163,7 @@ std::string convert_with_fallback(const std::string& str, Glib::ustring locale_to_utf8(const std::string& opsys_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_locale_to_utf8( opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror); @@ -178,7 +178,7 @@ Glib::ustring locale_to_utf8(const std::string& opsys_string) std::string locale_from_utf8(const Glib::ustring& utf8_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_locale_from_utf8( utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror); @@ -192,7 +192,7 @@ std::string locale_from_utf8(const Glib::ustring& utf8_string) Glib::ustring filename_to_utf8(const std::string& opsys_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_utf8( opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror); @@ -207,7 +207,7 @@ Glib::ustring filename_to_utf8(const std::string& opsys_string) std::string filename_from_utf8(const Glib::ustring& utf8_string) { gsize bytes_written = 0; - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_from_utf8( utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror); @@ -220,8 +220,8 @@ std::string filename_from_utf8(const Glib::ustring& utf8_string) std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname) { - char* hostname_buf = 0; - GError* gerror = 0; + char* hostname_buf = nullptr; + GError* gerror = nullptr; char *const buf = g_filename_from_uri(uri.c_str(), &hostname_buf, &gerror); @@ -241,7 +241,7 @@ std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname) std::string filename_from_uri(const Glib::ustring& uri) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_from_uri(uri.c_str(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -252,7 +252,7 @@ std::string filename_from_uri(const Glib::ustring& uri) Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_uri(filename.c_str(), hostname.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -263,7 +263,7 @@ Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& Glib::ustring filename_to_uri(const std::string& filename) { - GError* gerror = 0; + GError* gerror = nullptr; char *const buf = g_filename_to_uri(filename.c_str(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg index 42be941..43dc185 100644 --- a/glib/src/fileutils.ccg +++ b/glib/src/fileutils.ccg @@ -26,7 +26,7 @@ namespace Glib Dir::Dir(const std::string& path) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_dir_open(path.c_str(), 0, &error); if(error) @@ -60,7 +60,7 @@ void Dir::close() if(gobject_) { g_dir_close(gobject_); - gobject_ = 0; + gobject_ = nullptr; } } @@ -136,7 +136,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) std::string basename_template (prefix); basename_template += "XXXXXX"; // this sillyness shouldn't be in the interface - GError* error = 0; + GError* error = nullptr; ScopedPtr buf_name_used; const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); @@ -150,7 +150,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) int file_open_tmp(std::string& name_used) { - GError* error = 0; + GError* error = nullptr; ScopedPtr buf_name_used; const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); @@ -166,7 +166,7 @@ std::string file_get_contents(const std::string& filename) { ScopedPtr contents; gsize length = 0; - GError* error = 0; + GError* error = nullptr; g_file_get_contents(filename.c_str(), contents.addr(), &length, &error); @@ -181,7 +181,7 @@ file_set_contents(const std::string& filename, const gchar *contents, gssize length) { - GError* error = 0; + GError* error = nullptr; g_file_set_contents(filename.c_str(), contents, length, &error); diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg index e093a50..93faefa 100644 --- a/glib/src/iochannel.ccg +++ b/glib/src/iochannel.ccg @@ -50,8 +50,8 @@ public: ForeignIOChannel(GIOChannel* gobject, bool take_copy) : Glib::IOChannel(gobject, take_copy), ref_count_(0) {} - virtual void reference() const; - virtual void unreference() const; + void reference() const override; + void unreference() const override; private: mutable int ref_count_; @@ -136,7 +136,7 @@ IOChannel::IOChannel(GIOChannel* gobject, bool take_copy) gobject_ (gobject) { // This ctor should never be called for GlibmmIOChannel instances. - g_assert(gobject != 0); + g_assert(gobject != nullptr); g_assert(gobject->funcs != &GlibmmIOChannel::vfunc_table); if(take_copy) @@ -157,11 +157,11 @@ IOChannel::~IOChannel() if(gobject_->funcs == &GlibmmIOChannel::vfunc_table) { // Disconnect the wrapper object so that it won't be deleted twice. - reinterpret_cast(gobject_)->wrapper = 0; + reinterpret_cast(gobject_)->wrapper = nullptr; } const auto tmp_gobject = gobject_; - gobject_ = 0; + gobject_ = nullptr; g_io_channel_unref(tmp_gobject); } @@ -169,7 +169,7 @@ IOChannel::~IOChannel() Glib::RefPtr IOChannel::create_from_file(const std::string& filename, const std::string& mode) { - GError* gerror = 0; + GError* gerror = nullptr; const auto channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); if(gerror) @@ -208,7 +208,7 @@ IOStatus IOChannel::write(const Glib::ustring& str) IOStatus IOChannel::read_line(Glib::ustring& line) { Glib::ScopedPtr buf; - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); @@ -229,7 +229,7 @@ IOStatus IOChannel::read_line(Glib::ustring& line) IOStatus IOChannel::read_to_end(Glib::ustring& str) { Glib::ScopedPtr buf; - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); @@ -250,7 +250,7 @@ IOStatus IOChannel::read_to_end(Glib::ustring& str) IOStatus IOChannel::read(Glib::ustring& str, gsize count) { Glib::ScopedPtr buf (g_new(char, count)); - GError* gerror = 0; + GError* gerror = nullptr; gsize bytes = 0; const auto status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); @@ -270,7 +270,7 @@ IOStatus IOChannel::read(Glib::ustring& str, gsize count) IOStatus IOChannel::set_encoding(const std::string& encoding) { - GError* gerror = 0; + GError* gerror = nullptr; const auto status = g_io_channel_set_encoding( gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror); @@ -367,7 +367,7 @@ void IOChannel::unreference() const Glib::RefPtr wrap(GIOChannel* gobject, bool take_copy) { - IOChannel* cpp_object = 0; + IOChannel* cpp_object = nullptr; if(gobject) { @@ -497,7 +497,7 @@ void GlibmmIOChannel::io_free(GIOChannel* channel) { if(IOChannel *const wrapper = reinterpret_cast(channel)->wrapper) { - wrapper->gobject_ = 0; + wrapper->gobject_ = nullptr; delete wrapper; } diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg index 93bf749..9c97ce7 100644 --- a/glib/src/iochannel.hg +++ b/glib/src/iochannel.hg @@ -78,15 +78,7 @@ class GlibmmIOChannel; * set_encoding("ISO-8859-15"). To set the channel to no encoding, use * set_encoding() without any arguments. * - * You can create an IOChannel with one of the static create methods, or - * implement one yourself, in which case you have to 1) override all - * _vfunc() members. 2) set the GIOChannel flags in your constructor. - * - * @note This feature of being able to implement a custom Glib::IOChannel is - * deprecated in glibmm 2.2. The vfunc interface has not yet stabilized - * enough to allow that -- the C++ wrapper went in by pure accident. Besides, - * it isn't terribly useful either. Thus please refrain from overriding any - * IOChannel vfuncs. + * You can create an IOChannel with one of the static create methods. */ class IOChannel : public sigc::trackable { @@ -437,12 +429,42 @@ protected: IOChannel(GIOChannel* gobject, bool take_copy); #endif + //We don't put GLIBMM_DISABLE_DEPRECATED around these deprecated methods + //because they are virtual and that would make the ABI dependent on the ifdef. + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus read_vfunc(char* buf, gsize count, gsize& bytes_read); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus write_vfunc(const char* buf, gsize count, gsize& bytes_written); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus seek_vfunc(gint64 offset, SeekType type); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus close_vfunc(); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOStatus set_flags_vfunc(IOFlags flags); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual IOFlags get_flags_vfunc(); + + /** + * @deprecated Custom Glib::IOChannel implementation was never really supported. + */ virtual Glib::RefPtr create_watch_vfunc(IOCondition cond); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/glib/src/keyfile.ccg b/glib/src/keyfile.ccg index 366b498..4488e31 100644 --- a/glib/src/keyfile.ccg +++ b/glib/src/keyfile.ccg @@ -40,7 +40,7 @@ KeyFile::~KeyFile() bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags) { - GError* gerror = 0; + GError* gerror = nullptr; const gboolean result = g_key_file_load_from_data( gobj(), data.c_str(), data.bytes(), @@ -55,8 +55,8 @@ bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags) bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags) { - GError* gerror = 0; - char* full_path_c = 0; + GError* gerror = nullptr; + char* full_path_c = nullptr; const gboolean result = g_key_file_load_from_data_dirs( gobj(), file.c_str(), &full_path_c, @@ -76,8 +76,8 @@ bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_pat bool KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle& search_dirs, std::string& full_path, KeyFileFlags flags) { - GError* gerror = 0; - char* full_path_c = 0; + GError* gerror = nullptr; + char* full_path_c = nullptr; const gboolean result = g_key_file_load_from_dirs( gobj(), file.c_str(), const_cast(search_dirs.data()), @@ -103,7 +103,7 @@ bool KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle KeyFile::get_groups() const Glib::ArrayHandle KeyFile::get_keys(const Glib::ustring& group_name) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_keys( const_cast(gobj()), @@ -139,7 +139,7 @@ Glib::ArrayHandle KeyFile::get_keys(const Glib::ustring& group_na Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_locale_string( const_cast(gobj()), (group_name.empty()) ? 0 : group_name.c_str(), @@ -153,7 +153,7 @@ Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, bool KeyFile::get_boolean(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const bool value = static_cast(g_key_file_get_boolean(const_cast(gobj()), 0, key.c_str(), &gerror)); @@ -165,7 +165,7 @@ bool KeyFile::get_boolean(const Glib::ustring& key) const int KeyFile::get_integer(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const int value = g_key_file_get_integer(const_cast(gobj()), 0, key.c_str(), &gerror); if(gerror) @@ -176,7 +176,7 @@ int KeyFile::get_integer(const Glib::ustring& key) const gint64 KeyFile::get_int64(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const gint64 value = g_key_file_get_int64(const_cast(gobj()), 0, key.c_str(), &gerror); @@ -189,7 +189,7 @@ gint64 KeyFile::get_int64(const Glib::ustring& key) const guint64 KeyFile::get_uint64(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; const guint64 value = g_key_file_get_uint64(const_cast(gobj()), 0, key.c_str(), &gerror); @@ -202,7 +202,7 @@ guint64 KeyFile::get_uint64(const Glib::ustring& key) const double KeyFile::get_double(const Glib::ustring& key) const { - GError* gerror = 0; + GError* gerror = nullptr; double retvalue = g_key_file_get_double(const_cast(gobj()), 0, key.c_str(), &(gerror)); if(gerror) @@ -224,7 +224,7 @@ Glib::ArrayHandle KeyFile::get_string_list(const Glib::ustring& g GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_string_list( const_cast(gobj()), @@ -242,7 +242,7 @@ Glib::ArrayHandle KeyFile::get_locale_string_list(const Glib::ust GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; char** const array = g_key_file_get_locale_string_list( const_cast(gobj()), @@ -259,7 +259,7 @@ Glib::ArrayHandle KeyFile::get_boolean_list(const Glib::ustring& group_nam GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; gboolean *const array = g_key_file_get_boolean_list( const_cast(gobj()), @@ -276,7 +276,7 @@ Glib::ArrayHandle KeyFile::get_integer_list(const Glib::ustring& group_name GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; int *const array = g_key_file_get_integer_list( const_cast(gobj()), @@ -293,7 +293,7 @@ Glib::ArrayHandle KeyFile::get_double_list(const Glib::ustring& group_na GLIBMM_ERROR_ARG) const { gsize length = 0; - GError* gerror = 0; + GError* gerror = nullptr; double *const array = g_key_file_get_double_list(const_cast(gobj()), group_name.c_str(), key.c_str(), @@ -341,7 +341,7 @@ void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustr Glib::ustring KeyFile::get_comment() const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_comment(const_cast(gobj()), 0, 0, &gerror); GLIBMM_THROW(gerror); @@ -351,7 +351,7 @@ Glib::ustring KeyFile::get_comment() const Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name GLIBMM_ERROR_ARG) const { - GError* gerror = 0; + GError* gerror = nullptr; char *const str = g_key_file_get_comment(const_cast(gobj()), (group_name.empty()) ? 0 : group_name.c_str(), 0, &gerror); @@ -362,7 +362,7 @@ Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name GLIBMM_ERROR_ void KeyFile::set_comment(const Glib::ustring& comment GLIBMM_ERROR_ARG) { - GError* gerror = 0; + GError* gerror = nullptr; g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &gerror); GLIBMM_THROW(gerror); @@ -371,7 +371,7 @@ void KeyFile::set_comment(const Glib::ustring& comment GLIBMM_ERROR_ARG) void KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& comment GLIBMM_ERROR_ARG) { - GError* gerror = 0; + GError* gerror = nullptr; g_key_file_set_comment(gobj(), (group_name.empty()) ? 0 : group_name.c_str(), 0, comment.c_str(), &gerror); GLIBMM_THROW(gerror); diff --git a/glib/src/markup.ccg b/glib/src/markup.ccg index ae3d4d2..738ce78 100644 --- a/glib/src/markup.ccg +++ b/glib/src/markup.ccg @@ -110,7 +110,7 @@ void ParserCallbacks::start_element(GMarkupParseContext* context, for(; *pname && *pvalue; ++pname, ++pvalue) attributes.insert(Parser::AttributeMap::value_type(*pname, *pvalue)); - g_return_if_fail(*pname == 0 && *pvalue == 0); + g_return_if_fail(*pname == nullptr && *pvalue == nullptr); } cpp_context.get_parser()->on_start_element(cpp_context, element_name, attributes); @@ -249,13 +249,13 @@ ParseContext::ParseContext(Parser& parser, ParseFlags flags) ParseContext::~ParseContext() { - parser_ = 0; + parser_ = nullptr; g_markup_parse_context_free(gobject_); } void ParseContext::parse(const Glib::ustring& text) { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_parse(gobject_, text.data(), text.bytes(), &error); if(error) @@ -264,7 +264,7 @@ void ParseContext::parse(const Glib::ustring& text) void ParseContext::parse(const char* text_begin, const char* text_end) { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_parse(gobject_, text_begin, text_end - text_begin, &error); if(error) @@ -273,7 +273,7 @@ void ParseContext::parse(const char* text_begin, const char* text_end) void ParseContext::end_parse() { - GError* error = 0; + GError* error = nullptr; g_markup_parse_context_end_parse(gobject_, &error); if(error) @@ -306,7 +306,7 @@ void ParseContext::destroy_notify_callback(void* data) ParseContext *const self = static_cast(data); // Detect premature destruction. - g_return_if_fail(self->parser_ == 0); + g_return_if_fail(self->parser_ == nullptr); } } // namespace Markup diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg index 3beabc9..9d7de8e 100644 --- a/glib/src/miscutils.ccg +++ b/glib/src/miscutils.ccg @@ -49,7 +49,7 @@ void set_prgname(const std::string& prgname) std::string getenv(const std::string& variable, bool& found) { const char *const value = g_getenv(variable.c_str()); - found = (value != 0); + found = (value != nullptr); return convert_const_gchar_ptr_to_stdstring(value); } @@ -133,7 +133,7 @@ std::vector get_system_data_dirs() if(!cresult) return result; - for(const gchar* const * iter = cresult; *iter != 0; ++iter) + for(const gchar* const * iter = cresult; *iter != nullptr; ++iter) { result.push_back( convert_const_gchar_ptr_to_stdstring(*iter)); @@ -150,7 +150,7 @@ std::vector get_system_config_dirs() if(!cresult) return result; - for(const gchar* const * iter = cresult; *iter != 0; ++iter) + for(const gchar* const * iter = cresult; *iter != nullptr; ++iter) { result.push_back( convert_const_gchar_ptr_to_stdstring(*iter)); diff --git a/glib/src/module.ccg b/glib/src/module.ccg index 8afd6d3..4e4666c 100644 --- a/glib/src/module.ccg +++ b/glib/src/module.ccg @@ -34,7 +34,7 @@ Module::~Module() Module::operator bool() const { - return (gobject_ != 0); + return (gobject_ != nullptr); } } // namespace Glib diff --git a/glib/src/module.hg b/glib/src/module.hg index 65f7f87..f1caf77 100644 --- a/glib/src/module.hg +++ b/glib/src/module.hg @@ -61,7 +61,7 @@ public: * Glib::Module module("plugins/helloworld"); * if(module) * { - * void* func = 0; + * void* func = nullptr; * bool found = get_symbol("some_function", func); * } * @endcode diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg index 2866057..fb0ff7b 100644 --- a/glib/src/nodetree.hg +++ b/glib/src/nodetree.hg @@ -337,7 +337,7 @@ public: { sigc::slot real_slot = sigc::ptr_fun(on_compare_child); - GNode* child = 0; + GNode* child = nullptr; typedef sigc::slot type_foreach_gnode_slot; type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); @@ -370,7 +370,7 @@ public: { //We use a sigc::slot for the C callback, so we can bind some extra data. sigc::slot real_slot = sigc::ptr_fun(on_compare_node); - GNode* child = 0; + GNode* child = nullptr; typedef sigc::slot type_traverse_gnode_slot; type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); @@ -690,11 +690,11 @@ private: //Free the wrapped object (g_node_free not available) g_slice_free(GNode, gobject_); - gobject_ = 0; + gobject_ = nullptr; } ///Create a new GNode, taking the contents of an existing node if one is specified. - void clone(const NodeTree* node = 0) + void clone(const NodeTree* node = nullptr) { //Store the this pointer in the GNode so we can discover this wrapper later: gobject_ = g_node_new(reinterpret_cast(this)); @@ -702,7 +702,7 @@ private: if(node) { //Prepend the copied children of @node to the constructing node. - for(const NodeTree* i = node->last_child(); i != 0; i = i->prev_sibling()) + for(const NodeTree* i = node->last_child(); i != nullptr; i = i->prev_sibling()) prepend(*(new NodeTree(*i))); } } diff --git a/glib/src/optioncontext.ccg b/glib/src/optioncontext.ccg index ecc1ac8..56980b4 100644 --- a/glib/src/optioncontext.ccg +++ b/glib/src/optioncontext.ccg @@ -65,7 +65,7 @@ OptionContext::~OptionContext() if(has_ownership_) g_option_context_free(gobj()); - gobject_ = 0; + gobject_ = nullptr; } void OptionContext::add_group(OptionGroup& group) diff --git a/glib/src/optionentry.ccg b/glib/src/optionentry.ccg index 9a64f10..3764169 100644 --- a/glib/src/optionentry.ccg +++ b/glib/src/optionentry.ccg @@ -75,7 +75,7 @@ void OptionEntry::set_long_name(const Glib::ustring& value) if(gobject_->long_name) { g_free((gchar*)(gobject_->long_name)); - gobject_->long_name = 0; + gobject_->long_name = nullptr; } //Note that we do not use NULL for an empty string, @@ -89,7 +89,7 @@ void OptionEntry::set_description(const Glib::ustring& value) if(gobject_->description) { g_free((gchar*)(gobject_->description)); - gobject_->description = 0; + gobject_->description = nullptr; } gobj()->description = (value).empty() ? 0 : g_strdup((value).c_str()); @@ -100,7 +100,7 @@ void OptionEntry::set_arg_description(const Glib::ustring& value) if(gobject_->arg_description) { g_free((gchar*)(gobject_->arg_description)); - gobject_->arg_description = 0; + gobject_->arg_description = nullptr; } gobj()->arg_description = (value).empty() ? 0 : g_strdup((value).c_str()); diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index 42313bc..4d26a8f 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -43,7 +43,7 @@ public: { } bool is_filename_option() const - { return slot_filename_ != 0; } + { return slot_filename_ != nullptr; } const OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; } @@ -229,7 +229,7 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* return false; } - const bool has_value = (value != 0); + const bool has_value = (value != nullptr); const OptionArgCallback* const option_arg = static_cast(cppOptionEntry.cpparg_); try @@ -294,7 +294,7 @@ OptionGroup::~OptionGroup() if(has_ownership_) { g_option_group_unref(gobj()); - gobject_ = 0; + gobject_ = nullptr; } } @@ -388,7 +388,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar // Only one C variable shall be allocated for them. // See https://bugzilla.gnome.org/show_bug.cgi?id=744854. bool is_duplicate = false; - void* carg = 0; + void* carg = nullptr; if (arg_type != G_OPTION_ARG_CALLBACK) { for (type_map_entries::iterator iter = map_entries_.begin(); @@ -478,7 +478,7 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() { char** typed_arg = new char*; //The C code will allocate a char* and put it here, for us to g_free() later. - *typed_arg = 0; + *typed_arg = nullptr; carg_ = typed_arg; break; @@ -512,7 +512,7 @@ void OptionGroup::CppOptionEntry::allocate_c_arg() case G_OPTION_ARG_NONE: // Actually a boolean. { gboolean* typed_arg = new gboolean; - *typed_arg = 0; + *typed_arg = false; carg_ = typed_arg; break; @@ -659,7 +659,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() //or add_entry_filename(). auto option_arg = static_cast(cpparg_); delete option_arg; - cpparg_ = 0; + cpparg_ = nullptr; break; } @@ -669,7 +669,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() } } - carg_ = 0; + carg_ = nullptr; } if(entry_) diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index 4f56581..61408cc 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -24,7 +24,7 @@ Glib::RefPtr Regex::create(const Glib::ustring& pattern, RegexCompileFlags compile_options, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, (GRegexMatchFlags)match_options, &gerror); @@ -47,7 +47,7 @@ bool Regex::match( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match(gobj(), string.c_str(), static_cast(match_options), &ginfo)); match_info.set_gobject(ginfo); @@ -66,8 +66,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_full(gobj(), string.c_str(), -1, start_position, @@ -88,8 +88,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_full(gobj(), string.c_str(), string_len, start_position, @@ -104,7 +104,7 @@ bool Regex::match( bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -114,7 +114,7 @@ bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFla bool Regex::match(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -128,7 +128,7 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast(g_regex_match_all(gobj(), string.c_str(), static_cast(match_options), &ginfo)); @@ -148,8 +148,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast(g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, @@ -170,8 +170,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast(g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, @@ -186,7 +186,7 @@ bool Regex::match_all( bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -196,7 +196,7 @@ bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatc bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -206,7 +206,7 @@ bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -217,7 +217,7 @@ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, co Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -227,7 +227,7 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi Glib::StringArrayHandle Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const { - GError* gerror = 0; + GError* gerror = nullptr; auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/glib/src/shell.ccg b/glib/src/shell.ccg index 4950c08..db01f78 100644 --- a/glib/src/shell.ccg +++ b/glib/src/shell.ccg @@ -25,9 +25,9 @@ namespace Glib Glib::ArrayHandle shell_parse_argv(const std::string& command_line) { - char** argv = 0; + char** argv = nullptr; int argc = 0; - GError* error = 0; + GError* error = nullptr; g_shell_parse_argv(command_line.c_str(), &argc, &argv, &error); @@ -45,7 +45,7 @@ std::string shell_quote(const std::string& unquoted_string) std::string shell_unquote(const std::string& quoted_string) { - GError* error = 0; + GError* error = nullptr; char *const buf = g_shell_unquote(quoted_string.c_str(), &error); if(error) diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg index ef9eed2..5cfbdb7 100644 --- a/glib/src/spawn.ccg +++ b/glib/src/spawn.ccg @@ -75,7 +75,7 @@ void spawn_async_with_pipes(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async_with_pipes( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -103,7 +103,7 @@ void spawn_async_with_pipes(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async_with_pipes( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -128,7 +128,7 @@ void spawn_async(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -152,7 +152,7 @@ void spawn_async(const std::string& working_directory, { const bool setup_slot = !child_setup.empty(); auto child_setup_ = child_setup; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_async( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -181,7 +181,7 @@ void spawn_sync(const std::string& working_directory, Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_sync( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -215,7 +215,7 @@ void spawn_sync(const std::string& working_directory, Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_sync( (working_directory.empty()) ? 0 : working_directory.c_str(), @@ -237,7 +237,7 @@ void spawn_sync(const std::string& working_directory, void spawn_command_line_async(const std::string& command_line) { - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_command_line_async(command_line.c_str(), &gerror); if(gerror) @@ -251,7 +251,7 @@ void spawn_command_line_sync(const std::string& command_line, { Glib::ScopedPtr buf_standard_output; Glib::ScopedPtr buf_standard_error; - GError* gerror = 0; + GError* gerror = nullptr; g_spawn_command_line_sync( command_line.c_str(), diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg index f82115e..c10e44b 100644 --- a/glib/src/spawn.hg +++ b/glib/src/spawn.hg @@ -197,10 +197,10 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0, - int* standard_input = 0, - int* standard_output = 0, - int* standard_error = 0); + Pid* child_pid = nullptr, + int* standard_input = nullptr, + int* standard_output = nullptr, + int* standard_error = nullptr); /** Like the main spawn_async_with_pipes() method, but inheriting the parent's environment. * @@ -223,10 +223,10 @@ void spawn_async_with_pipes(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0, - int* standard_input = 0, - int* standard_output = 0, - int* standard_error = 0); + Pid* child_pid = nullptr, + int* standard_input = nullptr, + int* standard_output = nullptr, + int* standard_error = nullptr); /** See spawn_async_with_pipes() for a full description. This function * simply calls the spawn_async_with_pipes() without any pipes. @@ -254,7 +254,7 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0); + Pid* child_pid = nullptr); /** Like the main spawn_async() method, but inheriting the parent's environment. * @@ -273,7 +273,7 @@ void spawn_async(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - Pid* child_pid = 0); + Pid* child_pid = nullptr); /** Executes a child synchronously (waits for the child to exit before returning). * All output from the child is stored in @a standard_output and @a standard_error, @@ -312,9 +312,9 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& envp, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** Like the main spawn_sync() method, but inheriting the parent's environment. * @@ -336,9 +336,9 @@ void spawn_sync(const std::string& working_directory, const Glib::ArrayHandle& argv, SpawnFlags flags = SPAWN_DEFAULT, const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(), - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** A simple version of spawn_async() that parses a command line with * shell_parse_argv() and passes it to spawn_async(). It runs a @@ -393,9 +393,9 @@ void spawn_command_line_async(const std::string& command_line); * @throws ShellError If the command line could not be parsed. */ void spawn_command_line_sync(const std::string& command_line, - std::string* standard_output = 0, - std::string* standard_error = 0, - int* exit_status = 0); + std::string* standard_output = nullptr, + std::string* standard_error = nullptr, + int* exit_status = nullptr); /** On some platforms, notably WIN32, the Pid type represents a resource * which must be closed to prevent resource leaking. close_pid() diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg index 2116b52..cfca218 100644 --- a/glib/src/thread.ccg +++ b/glib/src/thread.ccg @@ -73,7 +73,7 @@ Thread* Thread::create(const sigc::slot& slot, bool /* joinable */) // Make a copy of slot on the heap const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; const auto thread = g_thread_try_new(NULL, &call_thread_entry_slot, slot_copy, &error); @@ -99,7 +99,7 @@ Thread* Thread::create(const sigc::slot& slot, unsigned long stack_size, // Make a copy of slot on the heap const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; const auto thread = g_thread_create_full( &call_thread_entry_slot, slot_copy, stack_size, joinable, diff --git a/glib/src/thread.hg b/glib/src/thread.hg index dd116c3..b5efa43 100644 --- a/glib/src/thread.hg +++ b/glib/src/thread.hg @@ -106,7 +106,7 @@ _WRAP_ENUM(ThreadPriority, GThreadPriority, NO_GTYPE) /** Initializes the GLib thread system. * @deprecated Calling thread_init() is no longer necessary and no longer has any effect. */ -void thread_init(GThreadFunctions* vtable = 0); +void thread_init(GThreadFunctions* vtable = nullptr); /** Returns whether the thread system is initialized. * @return @c true, if the thread system is initialized. @@ -630,7 +630,7 @@ private: * @code * Glib::Cond data_cond; * Glib::Mutex data_mutex; - * void* current_data = 0; + * void* current_data = nullptr; * * void push_data(void* data) * { @@ -648,7 +648,7 @@ private: * data_cond.wait(data_mutex); * * void *const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg index 49ad107..e507b6d 100644 --- a/glib/src/threads.ccg +++ b/glib/src/threads.ccg @@ -80,7 +80,7 @@ Thread* Thread::create(const sigc::slot& slot, const std::string& name) // Make a copy of slot on the heap. const auto slot_copy = new sigc::slot(slot); - GError* error = 0; + GError* error = nullptr; auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), &call_thread_entry_slot, slot_copy, &error); diff --git a/glib/src/threads.hg b/glib/src/threads.hg index 5fa559c..412d5fb 100644 --- a/glib/src/threads.hg +++ b/glib/src/threads.hg @@ -434,7 +434,7 @@ private: * @code * Glib::Threads::Cond data_cond; * Glib::Threads::Mutex data_mutex; - * void* current_data = 0; + * void* current_data = nullptr; * * void push_data(void* data) * { @@ -452,7 +452,7 @@ private: * data_cond.wait(data_mutex); * * void* const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } @@ -508,7 +508,7 @@ public: * return 0; // timeout * * void* const data = current_data; - * current_data = 0; + * current_data = nullptr; * * return data; * } diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index 7523db5..7ab9cb1 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -125,7 +125,7 @@ VariantStringBase::VariantStringBase(GVariant* castitem, bool take_a_reference) void VariantStringBase::create_object_path(VariantStringBase& output, const std::string& object_path) { - GVariant* result = 0; + GVariant* result = nullptr; result = g_variant_new_object_path(object_path.c_str()); g_variant_ref_sink(result); output.init(result); @@ -135,7 +135,7 @@ void VariantStringBase::create_object_path(VariantStringBase& output, void VariantStringBase::create_signature(VariantStringBase& output, const std::string& signature) { - GVariant* result = 0; + GVariant* result = nullptr; result = g_variant_new_signature(signature.c_str()); g_variant_ref_sink(result); output.init(result); @@ -241,7 +241,7 @@ VariantIter VariantContainerBase::get_iter(const VariantType& container_variant_ // use the actual type (which may differ from container_variant_type, if // the GVariant contains strings, object paths or DBus type signatures), // otherwise let g_variant_get() report what's wrong with the type. - GVariantIter* g_iter = 0; + GVariantIter* g_iter = nullptr; g_variant_get(const_cast(gobj()), is_castable_to(container_variant_type) ? get_type_string().c_str() : container_variant_type.get_string().c_str(), @@ -409,7 +409,7 @@ std::string Variant::get() const { const VariantType vtype = get_type(); - const char* pch = 0; + const char* pch = nullptr; if(vtype.equal(VARIANT_TYPE_BYTESTRING)) pch = g_variant_get_bytestring(gobject_); else //g_variant_get_string() can handle strings, object paths, and signatures. diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 46153d6..5a3702f 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -27,7 +27,7 @@ VariantType::VariantType(const GVariantType* castitem) if(castitem) gobject_ = g_variant_type_copy(castitem); else - gobject_ = 0; + gobject_ = nullptr; } VariantType::VariantType(const std::string& type_string) @@ -45,7 +45,7 @@ VariantType& VariantType::operator=(const GVariantType* castitem) if(castitem) gobject_ = g_variant_type_copy(castitem); else - gobject_ = 0; + gobject_ = nullptr; return *this; } diff --git a/tests/glibmm_interface_implementation/main.cc b/tests/glibmm_interface_implementation/main.cc index c748215..40da278 100644 --- a/tests/glibmm_interface_implementation/main.cc +++ b/tests/glibmm_interface_implementation/main.cc @@ -74,14 +74,14 @@ int main(int, char**) << action.property.get_value() << "'." << std::endl; success &= action.property.get_value() == "A new value."; - gchar* prop_value = 0; + gchar* prop_value = nullptr; g_object_set(action.gobj(), "custom_property", "Another value", NULL); g_object_get(action.gobj(), "custom_property", &prop_value, NULL); std::cout << "The custom property after g_object_set/get() is '" << prop_value << "'." << std::endl; success &= std::strcmp(prop_value, "Another value") == 0; g_free(prop_value); - prop_value = 0; + prop_value = nullptr; std::cout << "The custom property through the Glib::Property<> is '" << action.property.get_value() << "'." << std::endl; diff --git a/tests/glibmm_vector/main.cc b/tests/glibmm_vector/main.cc index b1ae14b..d184ecc 100644 --- a/tests/glibmm_vector/main.cc +++ b/tests/glibmm_vector/main.cc @@ -40,7 +40,7 @@ const unsigned int magic_limit(5); GList* create_list() { - GList* head = 0; + GList* head = nullptr; for(unsigned int iter(0); iter < magic_limit; ++iter) { @@ -142,7 +142,7 @@ copy_array(GCredentials** array) { dup[iter] = array[iter]; } - dup[magic_limit] = 0; + dup[magic_limit] = nullptr; return dup; } diff --git a/tools/extra_defs_gen/generate_extra_defs.cc b/tools/extra_defs_gen/generate_extra_defs.cc index 8477f05..bc8a78c 100644 --- a/tools/extra_defs_gen/generate_extra_defs.cc +++ b/tools/extra_defs_gen/generate_extra_defs.cc @@ -69,7 +69,7 @@ std::string get_properties(GType gtype) std::string strObjectName = g_type_name(gtype); //Get the list of properties: - GParamSpec** ppParamSpec = 0; + GParamSpec** ppParamSpec = nullptr; guint iCount = 0; if(G_TYPE_IS_OBJECT(gtype)) { @@ -160,8 +160,8 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) std::string strResult; std::string strObjectName = g_type_name(gtype); - gpointer gclass_ref = 0; - gpointer ginterface_ref = 0; + gpointer gclass_ref = nullptr; + gpointer ginterface_ref = nullptr; if(G_TYPE_IS_OBJECT(gtype)) gclass_ref = g_type_class_ref(gtype); //Ensures that class_init() is called. @@ -229,7 +229,7 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func) gchar* pchNum = g_strdup_printf("%d", j); std::string strParamName = "p" + std::string(pchNum); g_free(pchNum); - pchNum = 0; + pchNum = nullptr; //Just like above, for the return type: std::string strTypeName = get_type_name_signal( typeParamMangled & ~G_SIGNAL_TYPE_STATIC_SCOPE, is_a_pointer_func ); //The type is mangled with a flag. Hacky. diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4 index fc46097..1afa53a 100644 --- a/tools/m4/class_boxedtype.m4 +++ b/tools/m4/class_boxedtype.m4 @@ -139,7 +139,7 @@ __CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other) : gobject_(other.gobject_) { - other.gobject_ = 0; + other.gobject_ = nullptr; } __CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other) diff --git a/tools/m4/class_gobject.m4 b/tools/m4/class_gobject.m4 index 14cbb22..edd0c5b 100644 --- a/tools/m4/class_gobject.m4 +++ b/tools/m4/class_gobject.m4 @@ -248,10 +248,9 @@ private:')dnl endif friend class __CPPNAME__`'_Class; static CppClassType `'__BASE__`'_class_; -private: // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; protected: explicit __CPPNAME__`'(const Glib::ConstructParams& construct_params); diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4 index 8d25e6a..7226a32 100644 --- a/tools/m4/class_interface.m4 +++ b/tools/m4/class_interface.m4 @@ -96,7 +96,7 @@ void __CPPNAME__`'_Class::iface_init_function(void* g_iface, void*) //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect. //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc - g_assert(klass != 0); + g_assert(klass != nullptr); _IMPORT(SECTION_PCC_CLASS_INIT_VFUNCS) @@ -234,14 +234,14 @@ public: typedef __CNAME__ BaseObjectType; typedef __CCLASS__ BaseClassType; + // noncopyable + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; + private: friend class __CPPNAME__`'_Class; static CppClassType `'__BASE__`'_class_; - // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); - #endif /* DOXYGEN_SHOULD_SKIP_THIS */ protected: /** diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4 index b98502f..f3fe4bd 100644 --- a/tools/m4/class_opaque_copyable.m4 +++ b/tools/m4/class_opaque_copyable.m4 @@ -113,7 +113,7 @@ __CPPNAME__::__CPPNAME__`'(__CNAME__* castitem, bool make_a_copy /* = false */) if(castitem) gobject_ = __OPAQUE_FUNC_COPY`'(castitem); else - gobject_ = 0; + gobject_ = nullptr; } } ') diff --git a/tools/m4/class_opaque_refcounted.m4 b/tools/m4/class_opaque_refcounted.m4 index cec87fa..847ac3b 100644 --- a/tools/m4/class_opaque_refcounted.m4 +++ b/tools/m4/class_opaque_refcounted.m4 @@ -171,11 +171,11 @@ protected: __CPPNAME__`'(); void operator delete(void*, std::size_t); -private: // noncopyable - __CPPNAME__`'(const __CPPNAME__&); - __CPPNAME__& operator=(const __CPPNAME__&); + __CPPNAME__`'(const __CPPNAME__&) = delete; + __CPPNAME__& operator=(const __CPPNAME__&) = delete; +private: _IMPORT(SECTION_CLASS2) ') diff --git a/tools/m4/method.m4 b/tools/m4/method.m4 index fe4075d..3ca4de6 100644 --- a/tools/m4/method.m4 +++ b/tools/m4/method.m4 @@ -61,7 +61,7 @@ ifelse(`$8',,,`$8 ')dnl ')',dnl End if a C++ output parameter is specified. dnl If is errthrow or refreturn -`ifelse(`$11',,,` GError* gerror = 0; +`ifelse(`$11',,,` GError* gerror = nullptr; ')dnl dnl If a slot type has been specified insert a slot copy declaration. ifelse(`$18',,,dnl @@ -155,7 +155,7 @@ dnl Return the value if it was stored and if the method returns something ifelse(`$3',void,,`ifelse(`$6',,,` return retval; ')')dnl ',dnl End if a C++ output parameter is specified. -`ifelse(`$10',,,` GError* gerror = 0;') +`ifelse(`$10',,,` GError* gerror = nullptr;') dnl If a slot type has been specified insert a slot copy declaration. ifelse(`$15',,,dnl dnl See if the slot should or should not be copied diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4 index cc0473c..d85f93c 100644 --- a/tools/m4/signal.m4 +++ b/tools/m4/signal.m4 @@ -285,7 +285,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT($8)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); // Call the original underlying C function: if(base && base->$2) @@ -331,7 +331,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT(gobject_)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); if(base && base->$2) ifelse($3,void,`dnl diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4 index 6ed4989..fd2aeb8 100644 --- a/tools/m4/vfunc.m4 +++ b/tools/m4/vfunc.m4 @@ -117,7 +117,7 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT($8)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); // Call the original underlying C function: if(base && base->$2) @@ -170,12 +170,12 @@ ifdef(`__BOOL_IS_INTERFACE__',`dnl ',`dnl _PARENT_GCLASS_FROM_OBJECT(gobject_)dnl ') ); -dnl g_assert(base != 0); +dnl g_assert(base != nullptr); if(base && base->$2) { ifelse($10,errthrow,`dnl - GError* gerror = 0; + GError* gerror = nullptr; ')dnl ifelse($3,void,`dnl (*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6)); -- 2.7.4