diff options
author | Murray Cumming <murrayc@murrayc.com> | 2015-07-15 12:45:22 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-07-15 12:45:22 +0200 |
commit | 40f91e93e079a59d6e39bf0f7f2012357d3ee763 (patch) | |
tree | 8fcaf53512a26f6440362b87d3139d634eb76dd6 | |
parent | 254f5b93e08e45cd32ccdbb0f4a31c433ece9d08 (diff) | |
download | glibmm-40f91e93e079a59d6e39bf0f7f2012357d3ee763.tar.gz |
C++11: Some use of the auto keyword.
54 files changed, 287 insertions, 287 deletions
diff --git a/gio/src/action.hg b/gio/src/action.hg index eca98122..1b10876e 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -243,8 +243,8 @@ void Action::get_state(T_Value& value) const g_return_if_fail( g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj())); - const Glib::VariantBase variantBase = get_state_variant(); - const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); + const auto variantBase = get_state_variant(); + const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); value = variantDerived.get(); } @@ -255,13 +255,13 @@ void Action::get_state_hint(T_Value& value) const typedef Glib::Variant<T_Value> type_glib_variant; - const Glib::VariantBase variantBase = get_state_hint_variant(); + const auto variantBase = get_state_hint_variant(); // We can't check the type (a range) that will be returned before getting the range hint. g_return_if_fail( variantBase.is_of_type(type_glib_variant::variant_type()) ); - const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); + const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); value = variantDerived.get(); } diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg index 71385be6..a1d5d333 100644 --- a/gio/src/actiongroup.hg +++ b/gio/src/actiongroup.hg @@ -169,10 +169,10 @@ void ActionGroup::get_action_state(const Glib::ustring& action_name, T_Value& va g_return_if_fail( g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj())); - const Glib::VariantBase variantBase = get_action_state_variant(action_name); + const auto variantBase = get_action_state_variant(action_name); //TODO: Add a bool return instead of letting a std::bad_cast from the cast_dynamic() be thrown up to the caller? - const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); + const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); value = variantDerived.get(); } @@ -183,13 +183,13 @@ void ActionGroup::get_action_state_hint(const Glib::ustring& action_name, T_Valu typedef Glib::Variant<T_Value> type_glib_variant; - const Glib::VariantBase variantBase = get_action_state_hint_variant(action_name); + const auto variantBase = get_action_state_hint_variant(action_name); // We can't check the type (a range) that will be returned before getting the range hint. g_return_if_fail( variantBase.is_of_type(type_glib_variant::variant_type()) ); - const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); + const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase); value = variantDerived.get(); } diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg index 432b65f8..a294bddc 100644 --- a/gio/src/actionmap.ccg +++ b/gio/src/actionmap.ccg @@ -25,21 +25,21 @@ namespace Gio Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name) { - Glib::RefPtr<SimpleAction> action = SimpleAction::create(name); + auto action = SimpleAction::create(name); add_action(action); return action; } Glib::RefPtr<SimpleAction> ActionMap::add_action_with_parameter(const Glib::ustring& name, const ActivateWithParameterSlot& slot) { - Glib::RefPtr<SimpleAction> action = add_action(name); + auto action = add_action(name); action->signal_activate().connect(slot); return action; } Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot) { - Glib::RefPtr<SimpleAction> action = add_action(name); + auto action = add_action(name); action->signal_activate().connect( sigc::hide(slot)); return action; @@ -48,7 +48,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name, cons Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, bool state) { - Glib::RefPtr<SimpleAction> action = SimpleAction::create_bool(name, state); + auto action = SimpleAction::create_bool(name, state); add_action(action); return action; } @@ -56,7 +56,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, //TODO: Use a slot that takes a bool? Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, const ActivateSlot& slot, bool state) { - Glib::RefPtr<SimpleAction> action = add_action_bool(name, state); + auto action = add_action_bool(name, state); action->signal_activate().connect( sigc::hide(slot)); return action; @@ -65,7 +65,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, //TODO: Use a slot that takes a string? Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const Glib::ustring& state) { - Glib::RefPtr<SimpleAction> action = SimpleAction::create_radio_string(name, state); + auto action = SimpleAction::create_radio_string(name, state); add_action(action); return action; } @@ -79,7 +79,7 @@ static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio //TODO: This syntax is odd: const Glib::Variant<Glib::ustring> variantDerived = parameter.cast_dynamic< Glib::Variant<Glib::ustring> >(parameter); - const Glib::ustring str = variantDerived.get(); + const auto str = variantDerived.get(); slot(str); } @@ -87,7 +87,7 @@ static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const ActivateWithStringParameterSlot& slot, const Glib::ustring& state) { - Glib::RefPtr<SimpleAction> action = add_action_radio_string(name, state); + auto action = add_action_radio_string(name, state); action->signal_activate().connect( sigc::bind(sigc::ptr_fun(&on_action_radio_string), slot)); return action; @@ -101,7 +101,7 @@ static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::A //TODO: This syntax is odd: const Glib::Variant<int> variantDerived = parameter.cast_dynamic< Glib::Variant<int> >(parameter); - const int str = variantDerived.get(); + const auto str = variantDerived.get(); slot(str); } @@ -110,14 +110,14 @@ static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::A //TODO: Use a slot that takes an integer? Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, gint32 state) { - Glib::RefPtr<SimpleAction> action = SimpleAction::create_radio_integer(name, state); + auto action = SimpleAction::create_radio_integer(name, state); add_action(action); return action; } Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state) { - Glib::RefPtr<SimpleAction> action = add_action_radio_integer(name, state); + auto action = add_action_radio_integer(name, state); action->signal_activate().connect( sigc::bind(sigc::ptr_fun(&on_action_radio_int), slot)); return action; diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 1952abae..59f17dd7 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -68,7 +68,7 @@ static void Application_signal_open_callback(GApplication* self, GFile** files, vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) @@ -101,7 +101,7 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile** vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) @@ -202,13 +202,13 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* if (option_name[1] == '-') { // Long option name. - const Glib::ustring long_option_name = Glib::ustring(option_name+2); + const auto long_option_name = Glib::ustring(option_name+2); iterFind = option_arg_callback_data.find(long_option_name); } else { // Short option name. - const gchar short_option_name = option_name[1]; + const auto short_option_name = option_name[1]; for (iterFind = option_arg_callback_data.begin(); iterFind != option_arg_callback_data.end(); ++iterFind) { @@ -230,14 +230,14 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* { if (option_arg->is_filename_option()) { - const Glib::OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename(); + const auto the_slot = option_arg->get_slot_filename(); lock.release(); const std::string cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } else { - const Glib::OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string(); + const auto the_slot = option_arg->get_slot_string(); lock.release(); const Glib::ustring cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); @@ -303,7 +303,7 @@ void Application::unset_default() void Application_Class::open_callback(GApplication* self, GFile** files, gint n_files, const gchar *hint) { - Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( + const auto obj_base = static_cast<Glib::ObjectBase*>( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -314,7 +314,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); + const auto obj = dynamic_cast<CppObjectType* const>(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -325,7 +325,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, vec_files[i] = Glib::wrap(files[i], true); } - const Glib::ustring hint_str = (hint ? hint : Glib::ustring()); + const auto hint_str = (hint ? hint : Glib::ustring()); obj->on_open(vec_files, hint_str); return; @@ -337,7 +337,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files, } } - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). ); @@ -353,7 +353,7 @@ Glib::SignalProxy2< void, const Application::type_vec_files&, const Glib::ustrin void Gio::Application::on_open(const Application::type_vec_files& files, const Glib::ustring& hint) { - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). ); @@ -397,7 +397,7 @@ void Application::add_main_option_entry( if (iterFind != option_arg_callback_data.end()) return; // Ignore duplicates - OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot); + auto callback_data = new OptionArgCallbackData(this, short_name, slot); option_arg_callback_data[long_name] = callback_data; lock.release(); @@ -415,7 +415,7 @@ void Application::add_main_option_entry_filename( if (iterFind != option_arg_callback_data.end()) return; // Ignore duplicates - OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot); + auto callback_data = new OptionArgCallbackData(this, short_name, slot); option_arg_callback_data[long_name] = callback_data; lock.release(); diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 39d3f02e..3867ef0e 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -30,7 +30,7 @@ void AsyncInitable::init_async(const SlotAsyncReady& slot, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_async_initable_init_async(gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); @@ -41,7 +41,7 @@ void AsyncInitable::init_async(const SlotAsyncReady& slot, int io_priority) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_async_initable_init_async(gobj(), io_priority, 0, &SignalProxy_async_callback, slot_copy); @@ -51,7 +51,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { - Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( + const auto obj_base = static_cast<Glib::ObjectBase*>( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -61,7 +61,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, // being overridden: if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); + const auto obj = dynamic_cast<CppObjectType* const>(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -82,7 +82,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, } } - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. ) ); @@ -95,7 +95,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge void Gio::AsyncInitable::init_async_vfunc(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. ) ); @@ -110,7 +110,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) / gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, GAsyncResult* res, GError** error) { - Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( + const auto obj_base = static_cast<Glib::ObjectBase*>( Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default @@ -120,7 +120,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, // being overridden: if(obj_base && obj_base->is_derived_()) { - CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); + const auto obj = dynamic_cast<CppObjectType* const>(obj_base); if(obj) // This can be NULL during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. @@ -135,7 +135,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, } } - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. ) ); @@ -150,7 +150,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge } bool Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr<AsyncResult>& res) { - BaseClassType *const base = static_cast<BaseClassType*>( + const auto base = static_cast<BaseClassType*>( g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. ) ); diff --git a/gio/src/asyncresult.ccg b/gio/src/asyncresult.ccg index 9697606e..b336f181 100644 --- a/gio/src/asyncresult.ccg +++ b/gio/src/asyncresult.ccg @@ -31,8 +31,8 @@ static GObject* unwrap_objectbase_custom(const Glib::RefPtr<Glib::ObjectBase>& c Glib::RefPtr<Glib::ObjectBase> AsyncResult::get_source_object_base() { - GObject* cobj = g_async_result_get_source_object(gobj()); - ObjectBase* cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj); + auto cobj = g_async_result_get_source_object(gobj()); + auto cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj); return Glib::RefPtr<Glib::ObjectBase>(cppobj); //g_async_result_get_source_object() gives us a ref, unusually. //TODO: For some reason this fails: Glib::wrap(cobj); } diff --git a/gio/src/bufferedinputstream.ccg b/gio/src/bufferedinputstream.ccg index b015f9a9..af74ea92 100644 --- a/gio/src/bufferedinputstream.ccg +++ b/gio/src/bufferedinputstream.ccg @@ -36,7 +36,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_buffered_input_stream_fill_async(gobj(), count, @@ -53,7 +53,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_buffered_input_stream_fill_async(gobj(), count, diff --git a/gio/src/cancellable.ccg b/gio/src/cancellable.ccg index a266e7e5..787990e1 100644 --- a/gio/src/cancellable.ccg +++ b/gio/src/cancellable.ccg @@ -43,7 +43,7 @@ void slot_cancelled_proxy(GCancellable * /*cancellable*/, gpointer data) gulong Cancellable::connect(const SlotCancelledCallback& slot) { - SlotCancelledCallback* slot_copy = new SlotCancelledCallback(slot); + auto slot_copy = new SlotCancelledCallback(slot); return g_cancellable_connect (gobj(), G_CALLBACK(slot_cancelled_proxy), slot_copy, diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg index 485c7b1e..0b4b4691 100644 --- a/gio/src/datainputstream.ccg +++ b/gio/src/datainputstream.ccg @@ -65,7 +65,7 @@ void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::Re // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_line_async(gobj(), io_priority, @@ -138,7 +138,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), io_priority, @@ -215,7 +215,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_upto_async(gobj(), stop_chars.c_str(), -1, /* null-terminated */ io_priority, diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index 2fe11d9b..2bcb7d7c 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -47,14 +47,14 @@ bool is_supported(const std::string& address) void get_stream(const std::string& address, const SlotAsyncReady slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_address_get_stream(address.c_str(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void get_stream(const std::string& address, const SlotAsyncReady slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_address_get_stream(address.c_str(), 0, &SignalProxy_async_callback, slot_copy); } diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index f2f60355..31020505 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -68,7 +68,7 @@ static GDBusMessage* DBusConnection_Message_Filter_giomm_callback( try { - Glib::RefPtr<Gio::DBus::Message> result = (*the_slot)( + auto result = (*the_slot)( Glib::wrap(connection, true), Glib::wrap(message, true), static_cast<bool>(incoming)); return (result) ? result->gobj_copy() : 0; @@ -477,7 +477,7 @@ Glib::RefPtr<Connection> Connection::create_for_address_sync( void Connection::get(BusType bus_type, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_bus_get(static_cast<GBusType>(bus_type), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); @@ -486,7 +486,7 @@ void Connection::get(BusType bus_type, const SlotAsyncReady& slot, //static void Connection::get(BusType bus_type, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_bus_get(static_cast<GBusType>(bus_type), 0, &SignalProxy_async_callback, slot_copy); @@ -499,7 +499,7 @@ void Connection::close() void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_close(gobj(), Glib::unwrap(cancellable), @@ -509,7 +509,7 @@ void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellabl void Connection::close(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_close(gobj(), 0, @@ -524,7 +524,7 @@ void Connection::flush() void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_flush(gobj(), Glib::unwrap(cancellable), @@ -534,7 +534,7 @@ void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellabl void Connection::flush(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_flush(gobj(), 0, @@ -559,7 +559,7 @@ bool Connection::send_message(const Glib::RefPtr<Message>& message, void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(message->get_flags()), @@ -571,7 +571,7 @@ void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, i void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(message->get_flags()), @@ -635,7 +635,7 @@ void Connection::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -659,7 +659,7 @@ void Connection::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -737,7 +737,7 @@ void Connection::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call_with_unix_fd_list(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -762,7 +762,7 @@ void Connection::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call_with_unix_fd_list(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), @@ -805,7 +805,7 @@ guint Connection::signal_subscribe( const Glib::ustring& arg0, SignalFlags flags) { - SlotSignal* slot_copy = new SlotSignal(slot); + auto slot_copy = new SlotSignal(slot); return g_dbus_connection_signal_subscribe(gobj(), sender.c_str(), interface_name.c_str(), member.c_str(), object_path.c_str(), arg0.c_str(), @@ -816,7 +816,7 @@ guint Connection::signal_subscribe( guint Connection::add_filter(const SlotMessageFilter& slot) { - SlotMessageFilter* slot_copy = new SlotMessageFilter(slot); + auto slot_copy = new SlotMessageFilter(slot); return g_dbus_connection_add_filter(gobj(), &DBusConnection_Message_Filter_giomm_callback, slot_copy, diff --git a/gio/src/dbusownname.ccg b/gio/src/dbusownname.ccg index d295247d..49de2042 100644 --- a/gio/src/dbusownname.ccg +++ b/gio/src/dbusownname.ccg @@ -37,8 +37,8 @@ extern "C" static void Bus_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast<OwnSlots*>(data); - Gio::DBus::SlotBusAcquired* the_slot = slots->bus_acquired_slot; + auto slots = static_cast<OwnSlots*>(data); + auto the_slot = slots->bus_acquired_slot; try { @@ -53,8 +53,8 @@ static void Bus_Acquired_giomm_callback(GDBusConnection* connection, static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast<OwnSlots*>(data); - Gio::DBus::SlotNameAcquired* the_slot = slots->name_acquired_slot; + auto slots = static_cast<OwnSlots*>(data); + auto the_slot = slots->name_acquired_slot; try { @@ -69,8 +69,8 @@ static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - OwnSlots* slots = static_cast<OwnSlots*>(data); - Gio::DBus::SlotNameLost* the_slot = slots->name_lost_slot; + auto slots = static_cast<OwnSlots*>(data); + auto the_slot = slots->name_lost_slot; try { @@ -84,7 +84,7 @@ static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, static void Bus_Own_Name_giomm_callback_destroy(void* data) { - OwnSlots* slots = static_cast<OwnSlots*>(data); + auto slots = static_cast<OwnSlots*>(data); if(slots->bus_acquired_slot) delete slots->bus_acquired_slot; @@ -118,7 +118,7 @@ guint own_name( BusNameOwnerFlags flags ) { - struct OwnSlots* slots = new OwnSlots; + auto slots = new OwnSlots; // Make copies of the slots which will be deleted on destroy notification. slots->bus_acquired_slot = new SlotBusAcquired(bus_acquired_slot); diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index 3c93d4b1..25014f6d 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -296,7 +296,7 @@ void Proxy::call(const Glib::ustring& method_name, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), @@ -314,7 +314,7 @@ void Proxy::call(const Glib::ustring& method_name, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), @@ -378,7 +378,7 @@ void Proxy::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), @@ -398,7 +398,7 @@ void Proxy::call( // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), diff --git a/gio/src/dbuswatchname.ccg b/gio/src/dbuswatchname.ccg index ca9947bb..0900b6a0 100644 --- a/gio/src/dbuswatchname.ccg +++ b/gio/src/dbuswatchname.ccg @@ -36,8 +36,8 @@ extern "C" static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, const gchar* name, const char* name_owner, gpointer data) { - WatchSlots* slots = static_cast<WatchSlots*>(data); - Gio::DBus::SlotNameAppeared* the_slot = slots->name_appeared_slot; + auto slots = static_cast<WatchSlots*>(data); + auto the_slot = slots->name_appeared_slot; try { @@ -53,8 +53,8 @@ static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { - WatchSlots* slots = static_cast<WatchSlots*>(data); - Gio::DBus::SlotNameVanished* the_slot = slots->name_vanished_slot; + auto slots = static_cast<WatchSlots*>(data); + auto the_slot = slots->name_vanished_slot; try { @@ -68,7 +68,7 @@ static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, static void Bus_Watch_Name_giomm_callback_destroy(void* data) { - WatchSlots* slots = static_cast<WatchSlots*>(data); + auto slots = static_cast<WatchSlots*>(data); if(slots->name_appeared_slot) delete slots->name_appeared_slot; @@ -98,7 +98,7 @@ guint watch_name( BusNameWatcherFlags flags ) { - struct WatchSlots* slots = new WatchSlots; + auto slots = new WatchSlots; // Make copies of the slots which will be deleted on destroy notification. slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); @@ -118,7 +118,7 @@ guint watch_name( BusNameWatcherFlags flags ) { - struct WatchSlots* slots = new WatchSlots; + auto slots = new WatchSlots; // Make copies of the slots which will be deleted on destroy notification. slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); diff --git a/gio/src/drive.ccg b/gio/src/drive.ccg index c0568616..da3fe0e0 100644 --- a/gio/src/drive.ccg +++ b/gio/src/drive.ccg @@ -31,7 +31,7 @@ void Drive::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& c // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -46,7 +46,7 @@ void Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -61,7 +61,7 @@ void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -76,7 +76,7 @@ void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -111,7 +111,7 @@ void Drive::poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr<Cancel // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_poll_for_media(gobj(), Glib::unwrap(cancellable), @@ -124,7 +124,7 @@ void Drive::poll_for_media(const SlotAsyncReady& slot) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_poll_for_media(gobj(), 0, // cancellable @@ -149,7 +149,7 @@ Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_stop(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -167,7 +167,7 @@ Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_stop(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -187,7 +187,7 @@ Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_start(gobj(), static_cast<GDriveStartFlags>(flags), @@ -205,7 +205,7 @@ Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_drive_start(gobj(), static_cast<GDriveStartFlags>(flags), diff --git a/gio/src/file.ccg b/gio/src/file.ccg index 639d4d78..56516ea1 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -36,7 +36,7 @@ SignalProxy_file_progress_callback(goffset current_num_bytes, goffset total_num_bytes, gpointer data) { - Gio::File::SlotFileProgress* the_slot = static_cast<Gio::File::SlotFileProgress*>(data); + auto the_slot = static_cast<Gio::File::SlotFileProgress*>(data); try { @@ -56,14 +56,14 @@ SignalProxy_file_progress_callback(goffset current_num_bytes, static void SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) { - CopySlots* slot_pair = static_cast<CopySlots*>(data); - Gio::SlotAsyncReady* the_slot = slot_pair->second; + auto slot_pair = static_cast<CopySlots*>(data); + auto the_slot = slot_pair->second; try { if(*the_slot) { - Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } @@ -84,14 +84,14 @@ SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) static void SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) { - MeasureSlots* slot_pair = static_cast<MeasureSlots*>(data); - Gio::SlotAsyncReady* the_slot = slot_pair->second; + auto slot_pair = static_cast<MeasureSlots*>(data); + auto the_slot = slot_pair->second; try { if(*the_slot) { - Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */); + auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } @@ -108,8 +108,8 @@ SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) static gboolean SignalProxy_load_partial_contents_read_more_callback(const char* file_contents, goffset file_size, gpointer data) { - LoadPartialSlots* slot_pair = static_cast<LoadPartialSlots*>(data); - Gio::File::SlotReadMore* the_slot = slot_pair->first; + auto slot_pair = static_cast<LoadPartialSlots*>(data); + auto the_slot = slot_pair->first; bool result = false; diff --git a/gio/src/fileattributeinfolist.ccg b/gio/src/fileattributeinfolist.ccg index b4320457..7332e3d2 100644 --- a/gio/src/fileattributeinfolist.ccg +++ b/gio/src/fileattributeinfolist.ccg @@ -35,7 +35,7 @@ bool FileAttributeInfoList::empty() const FileAttributeInfo FileAttributeInfoList::lookup(const std::string& name) const { - GFileAttributeInfoList* cobject = const_cast<GFileAttributeInfoList*>(gobj()); + auto cobject = const_cast<GFileAttributeInfoList*>(gobj()); const GFileAttributeInfo* cinfo = g_file_attribute_info_list_lookup (cobject, name.c_str()); diff --git a/gio/src/fileenumerator.ccg b/gio/src/fileenumerator.ccg index 49a893af..d5cb85cb 100644 --- a/gio/src/fileenumerator.ccg +++ b/gio/src/fileenumerator.ccg @@ -32,7 +32,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, const Glib::RefPtr< // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_next_files_async(gobj(), num_files, @@ -48,7 +48,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, int num_files, int // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_next_files_async(gobj(), num_files, @@ -66,7 +66,7 @@ FileEnumerator::close_async(int io_priority, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_close_async(gobj(), io_priority, @@ -82,7 +82,7 @@ FileEnumerator::close_async(int io_priority, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_enumerator_close_async(gobj(), io_priority, diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg index 9dc275e2..087f9701 100644 --- a/gio/src/fileinputstream.ccg +++ b/gio/src/fileinputstream.ccg @@ -27,7 +27,7 @@ namespace Gio Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -37,7 +37,7 @@ Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellabl Glib::RefPtr<FileInfo> FileInputStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + 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); @@ -50,7 +50,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_input_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), @@ -66,7 +66,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const std::string& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_input_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg index 5ae6ac50..ed8757b9 100644 --- a/gio/src/fileiostream.ccg +++ b/gio/src/fileiostream.ccg @@ -27,7 +27,7 @@ namespace Gio Glib::RefPtr<FileInfo> FileIOStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -37,7 +37,7 @@ Glib::RefPtr<FileInfo> FileIOStream::query_info(const Glib::RefPtr<Cancellable>& Glib::RefPtr<FileInfo> FileIOStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + 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); @@ -50,7 +50,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Ca // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_io_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), @@ -66,7 +66,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const std::string& at // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_io_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg index e46308cb..7b940feb 100644 --- a/gio/src/fileoutputstream.ccg +++ b/gio/src/fileoutputstream.ccg @@ -29,7 +29,7 @@ namespace Gio Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -41,7 +41,7 @@ Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellab Glib::RefPtr<FileInfo> FileOutputStream::query_info(const std::string& attributes) { GError* gerror = 0; - Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror))); + 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); @@ -56,7 +56,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPt // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_output_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), @@ -72,7 +72,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const std::string // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_file_output_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), diff --git a/gio/src/icon.ccg b/gio/src/icon.ccg index 7b77fa4c..76295bf6 100644 --- a/gio/src/icon.ccg +++ b/gio/src/icon.ccg @@ -33,7 +33,7 @@ Icon::equal(const Glib::RefPtr<Icon>& other) const Glib::RefPtr<Icon> Icon::create(const std::string& str) { GError* gerror = 0; - GIcon* icon = g_icon_new_for_string(str.c_str(), &gerror); + auto icon = g_icon_new_for_string(str.c_str(), &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/inputstream.ccg b/gio/src/inputstream.ccg index 82d0c134..54a82620 100644 --- a/gio/src/inputstream.ccg +++ b/gio/src/inputstream.ccg @@ -31,7 +31,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, c // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_async(gobj(), buffer, @@ -48,7 +48,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, i // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_async(gobj(), buffer, @@ -66,7 +66,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_all_async(gobj(), buffer, @@ -83,7 +83,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_all_async(gobj(), buffer, @@ -101,7 +101,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Gli // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_bytes_async(gobj(), count, @@ -117,7 +117,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_pr // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_read_bytes_async(gobj(), count, @@ -134,7 +134,7 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, const Glib::Ref // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_skip_async(gobj(), count, @@ -150,7 +150,7 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, int io_priority // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_skip_async(gobj(), count, @@ -166,7 +166,7 @@ InputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancella // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_close_async(gobj(), io_priority, @@ -181,7 +181,7 @@ InputStream::close_async(const SlotAsyncReady& slot, int io_priority) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_input_stream_close_async(gobj(), io_priority, diff --git a/gio/src/iostream.ccg b/gio/src/iostream.ccg index c1aae465..49b8280c 100644 --- a/gio/src/iostream.ccg +++ b/gio/src/iostream.ccg @@ -31,7 +31,7 @@ IOStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_close_async(gobj(), io_priority, @@ -46,7 +46,7 @@ IOStream::close_async(const SlotAsyncReady& slot, int io_priority) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_close_async(gobj(), io_priority, @@ -63,7 +63,7 @@ IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast<GIOStreamSpliceFlags>(flags), io_priority, @@ -77,7 +77,7 @@ IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast<GIOStreamSpliceFlags>(flags), io_priority, 0, diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index 2ff4d601..20281191 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -74,7 +74,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot, const // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_loadable_icon_load_async(gobj(), size, @@ -89,7 +89,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_loadable_icon_load_async(gobj(), size, diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg index 0dfd768d..344506d6 100644 --- a/gio/src/memoryinputstream.ccg +++ b/gio/src/memoryinputstream.ccg @@ -41,7 +41,7 @@ private: void destroy_data_callback(void* user_data) { - SlotWithData* slot_with_data = static_cast<SlotWithData*>(user_data); + auto slot_with_data = static_cast<SlotWithData*>(user_data); g_return_if_fail(slot_with_data != 0); try @@ -84,8 +84,8 @@ _DEPRECATE_IFDEF_END void MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot) { - SlotWithData* slot_with_data = new SlotWithData(destroy_slot, const_cast<void*>(data)); - GBytes* bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data); + auto slot_with_data = new SlotWithData(destroy_slot, const_cast<void*>(data)); + auto bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data); g_memory_input_stream_add_bytes(gobj(), bytes); g_bytes_unref(bytes); // g_memory_input_stream_add_bytes() takes a reference } diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg index 6d1ac668..522a700f 100644 --- a/gio/src/mount.ccg +++ b/gio/src/mount.ccg @@ -32,7 +32,7 @@ void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -47,7 +47,7 @@ void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -73,7 +73,7 @@ void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -89,7 +89,7 @@ void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), @@ -116,7 +116,7 @@ void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsy // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), @@ -131,7 +131,7 @@ void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsy // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), @@ -166,7 +166,7 @@ void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& c // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -181,7 +181,7 @@ void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -206,7 +206,7 @@ void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -221,7 +221,7 @@ void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), @@ -247,7 +247,7 @@ void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr<Ca // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_guess_content_type(gobj(), force_rescan, @@ -261,7 +261,7 @@ void Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_mount_guess_content_type(gobj(), force_rescan, diff --git a/gio/src/networkaddress.ccg b/gio/src/networkaddress.ccg index 182b5075..20cae4a2 100644 --- a/gio/src/networkaddress.ccg +++ b/gio/src/networkaddress.ccg @@ -29,7 +29,7 @@ Glib::RefPtr<NetworkAddress> NetworkAddress::parse(const std::string& host_and_port, guint16 default_port) { GError *error = 0; - GNetworkAddress *address = G_NETWORK_ADDRESS + auto *address = G_NETWORK_ADDRESS (g_network_address_parse (host_and_port.c_str (), default_port, &error)); if (error) diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg index aaa5ee13..550a6ac3 100644 --- a/gio/src/networkmonitor.ccg +++ b/gio/src/networkmonitor.ccg @@ -26,7 +26,7 @@ void NetworkMonitor::can_reach_async(const Glib::RefPtr<SocketConnectable>& conn // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_network_monitor_can_reach_async(gobj(), Glib::unwrap(connectable), diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index 0ed1e138..5ac47fbd 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -30,7 +30,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_async(gobj(), buffer, @@ -47,7 +47,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_async(gobj(), buffer, @@ -66,7 +66,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_all_async(gobj(), buffer, @@ -83,7 +83,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_write_all_async(gobj(), buffer, @@ -101,7 +101,7 @@ OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAs // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_splice_async(gobj(), Glib::unwrap(source), @@ -118,7 +118,7 @@ OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAs // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_splice_async(gobj(), Glib::unwrap(source), @@ -135,7 +135,7 @@ OutputStream::flush_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancell // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_flush_async(gobj(), io_priority, @@ -150,7 +150,7 @@ OutputStream::flush_async(const SlotAsyncReady& slot, int io_priority) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_flush_async(gobj(), io_priority, @@ -165,7 +165,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancell // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_close_async(gobj(), io_priority, @@ -180,7 +180,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, int io_priority) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_output_stream_close_async(gobj(), io_priority, diff --git a/gio/src/proxy.ccg b/gio/src/proxy.ccg index 232333e0..f5248362 100644 --- a/gio/src/proxy.ccg +++ b/gio/src/proxy.ccg @@ -31,7 +31,7 @@ void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib:: // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_connect_async(gobj(), Glib::unwrap(connection), @@ -46,7 +46,7 @@ void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib:: // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_connect_async(gobj(), Glib::unwrap(connection), diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 3fd2d6a8..72cad04e 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -43,7 +43,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_resolver_lookup_async(gobj(), uri.c_str(), @@ -57,7 +57,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_proxy_resolver_lookup_async(gobj(), uri.c_str(), diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg index 2f5f6948..0c5f9592 100644 --- a/gio/src/resolver.ccg +++ b/gio/src/resolver.ccg @@ -39,7 +39,7 @@ Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_name_async (gobj(), hostname.c_str(), @@ -52,7 +52,7 @@ void Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_name_async (gobj(), hostname.c_str(), @@ -66,7 +66,7 @@ Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_address_async (gobj(), Glib::unwrap(address), @@ -79,7 +79,7 @@ void Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_by_address_async (gobj(), Glib::unwrap(address), @@ -95,7 +95,7 @@ Resolver::lookup_service_async(const Glib::ustring& service, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_service_async (gobj(), service.c_str(), @@ -112,7 +112,7 @@ Resolver::lookup_service_async(const Glib::ustring& service, const Glib::ustring& domain, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_service_async (gobj(), service.c_str(), @@ -129,7 +129,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_records_async(gobj(), (rrname.empty() ? 0 : rrname.c_str()), @@ -144,7 +144,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname, ResolverRecordType record_type, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_resolver_lookup_records_async(gobj(), (rrname.empty() ? 0 : rrname.c_str()), diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index 03e48075..98b6ccd4 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -24,7 +24,7 @@ namespace Gio void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_value(const_cast<GSettings*>(gobj()), key.c_str()); + const auto g_value = g_settings_get_value(const_cast<GSettings*>(gobj()), key.c_str()); if(!g_value) return; @@ -33,7 +33,7 @@ void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) con bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str()); + const auto g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str()); if(!g_value) return false; @@ -43,7 +43,7 @@ bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value void Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const { - GVariant* const g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str()); + const auto g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str()); if(!g_value) return; diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg index 7a4a211d..107493f5 100644 --- a/gio/src/socket.ccg +++ b/gio/src/socket.ccg @@ -58,7 +58,7 @@ gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, { GError* gerror = 0; GSocketAddress* caddr = 0; - gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); + auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -72,7 +72,7 @@ gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, { GError* gerror = 0; GSocketAddress* caddr = 0; - gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); + auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -86,7 +86,7 @@ gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = 0; - gssize const retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, + const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -98,7 +98,7 @@ gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = 0; - gssize const retvalue = g_socket_send_with_blocking(gobj(), buffer, size, + const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); diff --git a/gio/src/socketaddressenumerator.ccg b/gio/src/socketaddressenumerator.ccg index b783ec8a..d7aca9b6 100644 --- a/gio/src/socketaddressenumerator.ccg +++ b/gio/src/socketaddressenumerator.ccg @@ -31,7 +31,7 @@ namespace Gio { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_address_enumerator_next_async(gobj(), Glib::unwrap(cancellable), diff --git a/gio/src/socketclient.ccg b/gio/src/socketclient.ccg index ec970358..6448c219 100644 --- a/gio/src/socketclient.ccg +++ b/gio/src/socketclient.ccg @@ -32,7 +32,7 @@ SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_async (gobj(), connectable->gobj (), @@ -48,7 +48,7 @@ SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_async (gobj(), connectable->gobj (), @@ -66,7 +66,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_host_async (gobj(), host_and_port.c_str (), @@ -84,7 +84,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_host_async (gobj(), host_and_port.c_str (), @@ -103,7 +103,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_service_async (gobj(), domain.c_str (), @@ -121,7 +121,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_service_async (gobj(), domain.c_str (), @@ -139,7 +139,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_uri_async (gobj(), uri.c_str(), default_port, @@ -155,7 +155,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_client_connect_to_uri_async (gobj(), uri.c_str(), default_port, diff --git a/gio/src/socketconnection.ccg b/gio/src/socketconnection.ccg index 8bd85788..79094c16 100644 --- a/gio/src/socketconnection.ccg +++ b/gio/src/socketconnection.ccg @@ -28,7 +28,7 @@ SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_connection_connect_async(gobj(), Glib::unwrap(address), @@ -41,7 +41,7 @@ void SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address, const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_connection_connect_async(gobj(), Glib::unwrap(address), diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg index b55c6055..75552e47 100644 --- a/gio/src/socketlistener.ccg +++ b/gio/src/socketlistener.ccg @@ -93,7 +93,7 @@ bool SocketListener::add_inet_port(guint16 port) guint16 SocketListener::add_any_inet_port() { GError* gerror = 0; - const guint16 retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); + const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -105,7 +105,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s { GError* gerror = 0; GObject *retobj = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); @@ -122,7 +122,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s { GError* gerror = 0; GObject *retobj = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, 0, &gerror); @@ -138,7 +138,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), 0, Glib::unwrap(cancellable), &gerror); @@ -151,7 +151,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellabl Glib::RefPtr<Socket> SocketListener::accept_socket() { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket(gobj(), + auto retvalue = g_socket_listener_accept_socket(gobj(), 0, 0, &gerror); @@ -167,7 +167,7 @@ void SocketListener::accept_socket_async(const Glib::RefPtr<Cancellable>& cancel // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_socket_async(gobj(), Glib::unwrap(cancellable), @@ -180,7 +180,7 @@ void SocketListener::accept_socket_async(const SlotAsyncReady& slot) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_socket_async(gobj(), 0, @@ -192,7 +192,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<Asy { GError* gerror = 0; GObject *retobj = 0; - GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(), + auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), &retobj, &gerror); @@ -207,7 +207,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<Asy Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result) { GError* gerror = 0; - GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(), + auto retvalue = g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), 0, &gerror); @@ -222,7 +222,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); @@ -239,7 +239,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), &retobj, 0, &gerror); @@ -255,7 +255,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), 0, Glib::unwrap(cancellable), &gerror); @@ -268,7 +268,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancell Glib::RefPtr<SocketConnection> SocketListener::accept() { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept(gobj(), + auto retvalue = g_socket_listener_accept(gobj(), 0, 0, &gerror); @@ -284,7 +284,7 @@ void SocketListener::accept_async(const SlotAsyncReady& slot) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_async(gobj(), 0, @@ -297,7 +297,7 @@ void SocketListener::accept_async(const Glib::RefPtr<Cancellable>& cancellable, // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_socket_listener_accept_async(gobj(), Glib::unwrap(cancellable), @@ -309,7 +309,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr< { GError* gerror = 0; GObject *retobj = 0; - GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(), + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), &retobj, &gerror); @@ -324,7 +324,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr< Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result) { GError* gerror = 0; - GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(), + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), 0, &gerror); diff --git a/gio/src/unixconnection.ccg b/gio/src/unixconnection.ccg index 2341973a..bddc9696 100644 --- a/gio/src/unixconnection.ccg +++ b/gio/src/unixconnection.ccg @@ -27,7 +27,7 @@ namespace Gio void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_receive_credentials_async(gobj(), Glib::unwrap(cancellable), @@ -37,7 +37,7 @@ void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot, void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_receive_credentials_async(gobj(), 0, @@ -49,7 +49,7 @@ void UnixConnection::send_credentials_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_send_credentials_async(gobj(), Glib::unwrap(cancellable), @@ -61,7 +61,7 @@ void UnixConnection::send_credentials_async(const SlotAsyncReady& slot) { - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_unix_connection_send_credentials_async(gobj(), 0, diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg index aa26c9c6..b17b0f6d 100644 --- a/gio/src/unixfdlist.ccg +++ b/gio/src/unixfdlist.ccg @@ -50,7 +50,7 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds) const Glib::ArrayHandle<int> UnixFDList::peek_fds() const { int length = 0; - const int* fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()), &length); + const auto fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_list_peek_fds() returns. return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_NONE); @@ -59,7 +59,7 @@ const Glib::ArrayHandle<int> UnixFDList::peek_fds() const Glib::ArrayHandle<int> UnixFDList::steal_fds() { int length = 0; - const int* fds = g_unix_fd_list_steal_fds(gobj(), &length); + const auto fds = g_unix_fd_list_steal_fds(gobj(), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_list_steal_fds() returns. return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_DEEP); diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg index d112bb65..7849a208 100644 --- a/gio/src/unixfdmessage.ccg +++ b/gio/src/unixfdmessage.ccg @@ -25,7 +25,7 @@ namespace Gio Glib::ArrayHandle<int> UnixFDMessage::steal_fds() { int length = 0; - const int* fds = g_unix_fd_message_steal_fds(gobj(), &length); + const auto fds = g_unix_fd_message_steal_fds(gobj(), &length); // The array is terminated with a -1, but that terminating element is // not included in the length that g_unix_fd_message_steal_fds() returns. return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_DEEP); diff --git a/gio/src/volume.ccg b/gio/src/volume.ccg index d06790a8..0bffbcb6 100644 --- a/gio/src/volume.ccg +++ b/gio/src/volume.ccg @@ -33,7 +33,7 @@ Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsy // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), @@ -50,7 +50,7 @@ Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsy // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), @@ -88,7 +88,7 @@ void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -103,7 +103,7 @@ void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -128,7 +128,7 @@ void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Sl // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), @@ -143,7 +143,7 @@ void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Sl // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), diff --git a/glib/src/date.ccg b/glib/src/date.ccg index bc7590c0..ad6b6ef0 100644 --- a/glib/src/date.ccg +++ b/glib/src/date.ccg @@ -305,7 +305,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const struct tm tm_data; g_date_to_struct_tm(&gobject_, &tm_data); - const std::string locale_format = locale_from_utf8(format); + const auto locale_format = locale_from_utf8(format); gsize bufsize = std::max<gsize>(2 * locale_format.size(), 128); @@ -316,7 +316,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const // Set the first byte to something other than '\0', to be able to // recognize whether strftime actually failed or just returned "". buf.get()[0] = '\1'; - const gsize len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data); + const auto len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data); if(len != 0 || buf.get()[0] == '\0') { diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg index 59fe145c..42be941b 100644 --- a/glib/src/fileutils.ccg +++ b/glib/src/fileutils.ccg @@ -125,7 +125,7 @@ bool file_test(const std::string& filename, FileTest test) int mkstemp(std::string& filename_template) { const ScopedPtr<char> buf (g_strndup(filename_template.data(), filename_template.size())); - const int fileno = g_mkstemp(buf.get()); + const auto fileno = g_mkstemp(buf.get()); filename_template = buf.get(); return fileno; @@ -139,7 +139,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) GError* error = 0; ScopedPtr<char> buf_name_used; - const int fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); @@ -153,7 +153,7 @@ int file_open_tmp(std::string& name_used) GError* error = 0; ScopedPtr<char> buf_name_used; - const int fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); diff --git a/glib/src/iochannel.ccg b/glib/src/iochannel.ccg index d0a18aae..e093a50b 100644 --- a/glib/src/iochannel.ccg +++ b/glib/src/iochannel.ccg @@ -160,7 +160,7 @@ IOChannel::~IOChannel() reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = 0; } - GIOChannel *const tmp_gobject = gobject_; + const auto tmp_gobject = gobject_; gobject_ = 0; g_io_channel_unref(tmp_gobject); @@ -170,7 +170,7 @@ IOChannel::~IOChannel() Glib::RefPtr<IOChannel> IOChannel::create_from_file(const std::string& filename, const std::string& mode) { GError* gerror = 0; - GIOChannel *const channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); + const auto channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror); if(gerror) { @@ -211,7 +211,7 @@ IOStatus IOChannel::read_line(Glib::ustring& line) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); + const auto status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror); if(gerror) { @@ -232,7 +232,7 @@ IOStatus IOChannel::read_to_end(Glib::ustring& str) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); + const auto status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror); if(gerror) { @@ -253,7 +253,7 @@ IOStatus IOChannel::read(Glib::ustring& str, gsize count) GError* gerror = 0; gsize bytes = 0; - const GIOStatus status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); + const auto status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror); if(gerror) { @@ -272,7 +272,7 @@ IOStatus IOChannel::set_encoding(const std::string& encoding) { GError* gerror = 0; - const GIOStatus status = g_io_channel_set_encoding( + const auto status = g_io_channel_set_encoding( gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror); if(gerror) @@ -394,7 +394,7 @@ Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy) GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count, gsize* bytes_read, GError** err) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { @@ -415,7 +415,7 @@ GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count, GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count, gsize* bytes_written, GError** err) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { @@ -435,7 +435,7 @@ GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { @@ -455,7 +455,7 @@ GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { @@ -477,11 +477,11 @@ GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err) // static GSource* GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition condition) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { - const Glib::RefPtr<Source> source = wrapper->create_watch_vfunc((IOCondition) condition); + const auto source = wrapper->create_watch_vfunc((IOCondition) condition); return (source) ? source->gobj_copy() : 0; } catch(...) @@ -506,7 +506,7 @@ void GlibmmIOChannel::io_free(GIOChannel* channel) GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { @@ -527,7 +527,7 @@ GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GEr // static GIOFlags GlibmmIOChannel::io_get_flags(GIOChannel* channel) { - IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; + const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper; try { diff --git a/glib/src/optioncontext.ccg b/glib/src/optioncontext.ccg index 601b928c..ecc1ac85 100644 --- a/glib/src/optioncontext.ccg +++ b/glib/src/optioncontext.ccg @@ -84,7 +84,7 @@ void OptionContext::set_main_group(OptionGroup& group) /* OptionGroup OptionContext::get_main_group() const { - const GOptionGroup* cobj = g_option_context_get_main_group(const_cast<GOptionContext*>( gobj()) ); + const auto cobj = g_option_context_get_main_group(const_cast<GOptionContext*>( gobj()) ); OptionGroup cppObj(const_cast<GOptionGroup*>(cobj), true); // take_copy return cppObj; } @@ -95,7 +95,7 @@ void OptionContext::set_translate_func (const SlotTranslate& slot) { //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter. //It will be deleted when SignalProxy_translate_gtk_callback_destroy() is called. - SlotTranslate* slot_copy = new SlotTranslate(slot); + auto slot_copy = new SlotTranslate(slot); g_option_context_set_translate_func( gobj(), &OptionContextPrivate::SignalProxy_translate_gtk_callback, slot_copy, diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg index da0f0b89..cffa3435 100644 --- a/glib/src/optiongroup.ccg +++ b/glib/src/optiongroup.ccg @@ -75,7 +75,7 @@ static gboolean g_callback_pre_parse(GOptionContext* context, { OptionContext cppContext(context, false /* take_ownership */); - OptionGroup* option_group = static_cast<OptionGroup*>(data); + auto option_group = static_cast<OptionGroup*>(data); if(!option_group) { OptionError(OptionError::FAILED, "Glib::OptionGroup: g_callback_pre_parse(): " @@ -108,7 +108,7 @@ static void g_callback_error(GOptionContext* context, OptionContext cppContext(context, false /* take_ownership */); - OptionGroup* option_group = static_cast<OptionGroup*>(data); + auto option_group = static_cast<OptionGroup*>(data); if(option_group) return option_group->on_error(cppContext, *option_group); } @@ -160,7 +160,7 @@ gboolean OptionGroup::post_parse_callback(GOptionContext* context, for(type_map_entries::iterator iter = option_group->map_entries_.begin(); iter != option_group->map_entries_.end(); ++iter) { - CppOptionEntry& cpp_entry = iter->second; + auto& cpp_entry = iter->second; cpp_entry.convert_c_to_cpp(); } @@ -198,17 +198,17 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* if(option_name[1] == '-') { //Long option name. - const Glib::ustring long_option_name = Glib::ustring(option_name+2); + const auto long_option_name = Glib::ustring(option_name+2); iterFind = option_group->map_entries_.find(long_option_name); } else { //Short option name. - const gchar short_option_name = option_name[1]; + const auto short_option_name = option_name[1]; for(iterFind = option_group->map_entries_.begin(); iterFind != option_group->map_entries_.end(); ++iterFind) { - const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second; + const auto& cppOptionEntry = iterFind->second; if (cppOptionEntry.entry_ && cppOptionEntry.entry_->get_short_name() == short_option_name) break; @@ -222,7 +222,7 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* return false; } - const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second; + const auto& cppOptionEntry = iterFind->second; if (cppOptionEntry.carg_type_ != G_OPTION_ARG_CALLBACK) { OptionError(OptionError::FAILED, "Glib::OptionGroup::option_arg_callback() " @@ -237,13 +237,13 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar* { if (option_arg->is_filename_option()) { - const OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename(); + const auto the_slot = option_arg->get_slot_filename(); const std::string cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } else { - const OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string(); + const auto the_slot = option_arg->get_slot_string(); const Glib::ustring cpp_value(value ? value : ""); return (*the_slot)(cpp_option_name, cpp_value, has_value); } @@ -288,7 +288,7 @@ OptionGroup::~OptionGroup() //Free any C types that were allocated during add_entry(): for(type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter) { - CppOptionEntry& cpp_entry = iter->second; + auto& cpp_entry = iter->second; cpp_entry.release_c_arg(); } @@ -375,7 +375,7 @@ void OptionGroup::add_entry_filename(const OptionEntry& entry, const SlotOptionA void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg arg_type, void* cpp_arg) { - const Glib::ustring name = entry.get_long_name(); + const auto name = entry.get_long_name(); type_map_entries::iterator iterFind = map_entries_.find(name); if (iterFind == map_entries_.end()) //If we have not added this entry already { @@ -395,7 +395,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar for (type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter) { - const CppOptionEntry& cpp_entry = iter->second; + const auto& cpp_entry = iter->second; if (cpp_entry.cpparg_ == cpp_arg && cpp_entry.carg_type_ == arg_type && cpp_entry.carg_) @@ -429,7 +429,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar { //Delete the OptionArgCallback instance that was allocated by add_entry() //or add_entry_filename(). - OptionArgCallback* option_arg = static_cast<OptionArgCallback*>(cpp_arg); + auto option_arg = static_cast<OptionArgCallback*>(cpp_arg); delete option_arg; } } @@ -454,7 +454,7 @@ void OptionGroup::set_translate_func(const SlotTranslate& slot) // Create a copy of the slot. A pointer to this will be passed through the // callback's data parameter. It will be deleted when // OptionGroup_Translate_glibmm_callback_destroy() is called. - SlotTranslate* slot_copy = new SlotTranslate(slot); + auto slot_copy = new SlotTranslate(slot); g_option_group_set_translate_func(gobj(), &OptionGroup_Translate_glibmm_callback, slot_copy, &OptionGroup_Translate_glibmm_callback_destroy); @@ -658,7 +658,7 @@ void OptionGroup::CppOptionEntry::release_c_arg() { //Delete the OptionArgCallback instance that was allocated by add_entry() //or add_entry_filename(). - OptionArgCallback* option_arg = static_cast<OptionArgCallback*>(cpparg_); + auto option_arg = static_cast<OptionArgCallback*>(cpparg_); delete option_arg; cpparg_ = 0; @@ -687,7 +687,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_STRING: { char** typed_arg = static_cast<char**>(carg_); - Glib::ustring* typed_cpp_arg = static_cast<Glib::ustring*>(cpparg_); + auto typed_cpp_arg = static_cast<Glib::ustring*>(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { *typed_cpp_arg = *typed_arg; @@ -697,7 +697,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_FILENAME: { char** typed_arg = static_cast<char**>(carg_); - std::string* typed_cpp_arg = static_cast<std::string*>(cpparg_); + auto typed_cpp_arg = static_cast<std::string*>(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { *typed_cpp_arg = *typed_arg; @@ -717,7 +717,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_STRING_ARRAY: { char*** typed_arg = static_cast<char***>(carg_); - vecustrings* typed_cpp_arg = static_cast<vecustrings*>(cpparg_); + auto typed_cpp_arg = static_cast<vecustrings*>(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); @@ -757,7 +757,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp() case G_OPTION_ARG_FILENAME_ARRAY: { char*** typed_arg = static_cast<char***>(carg_); - vecstrings* typed_cpp_arg = static_cast<vecstrings*>(cpparg_); + auto typed_cpp_arg = static_cast<vecstrings*>(cpparg_); if(typed_arg && *typed_arg && typed_cpp_arg) { typed_cpp_arg->clear(); diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index ba5b3938..4f565810 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -25,7 +25,7 @@ Glib::RefPtr<Glib::Regex> Regex::create(const Glib::ustring& pattern, RegexMatchFlags match_options) { GError* gerror = 0; - GRegex* regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, + auto regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, (GRegexMatchFlags)match_options, &gerror); if(gerror) @@ -207,7 +207,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; - Glib::ustring 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))); + 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); @@ -218,7 +218,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; - Glib::ustring 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))); + 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); @@ -228,7 +228,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; - Glib::StringArrayHandle retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); + auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(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/spawn.ccg b/glib/src/spawn.ccg index 8e2a2506..ef9eed2d 100644 --- a/glib/src/spawn.ccg +++ b/glib/src/spawn.ccg @@ -74,7 +74,7 @@ void spawn_async_with_pipes(const std::string& working_directory, int* standard_error) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -102,7 +102,7 @@ void spawn_async_with_pipes(const std::string& working_directory, int* standard_error) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async_with_pipes( @@ -127,7 +127,7 @@ void spawn_async(const std::string& working_directory, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -151,7 +151,7 @@ void spawn_async(const std::string& working_directory, Pid* child_pid) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; GError* gerror = 0; g_spawn_async( @@ -177,7 +177,7 @@ void spawn_sync(const std::string& working_directory, int* exit_status) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; Glib::ScopedPtr<char> buf_standard_output; Glib::ScopedPtr<char> buf_standard_error; @@ -211,7 +211,7 @@ void spawn_sync(const std::string& working_directory, int* exit_status) { const bool setup_slot = !child_setup.empty(); - SlotSpawnChildSetup child_setup_ = child_setup; + auto child_setup_ = child_setup; Glib::ScopedPtr<char> buf_standard_output; Glib::ScopedPtr<char> buf_standard_error; diff --git a/glib/src/thread.ccg b/glib/src/thread.ccg index cfc38952..2116b528 100644 --- a/glib/src/thread.ccg +++ b/glib/src/thread.ccg @@ -26,7 +26,7 @@ extern "C" static void* call_thread_entry_slot(void* data) { - sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data); + const auto slot = reinterpret_cast<sigc::slot_base*>(data); try { @@ -71,11 +71,11 @@ void thread_init_impl() Thread* Thread::create(const sigc::slot<void>& slot, bool /* joinable */) { // Make a copy of slot on the heap - sigc::slot_base *const slot_copy = new sigc::slot<void>(slot); + const auto slot_copy = new sigc::slot<void>(slot); GError* error = 0; - GThread *const thread = g_thread_try_new(NULL, + const auto thread = g_thread_try_new(NULL, &call_thread_entry_slot, slot_copy, &error); if(error) @@ -97,11 +97,11 @@ Thread* Thread::create(const sigc::slot<void>& slot, unsigned long stack_size, bool joinable, bool bound, ThreadPriority priority) { // Make a copy of slot on the heap - sigc::slot_base *const slot_copy = new sigc::slot<void>(slot); + const auto slot_copy = new sigc::slot<void>(slot); GError* error = 0; - GThread *const thread = g_thread_create_full( + const auto thread = g_thread_create_full( &call_thread_entry_slot, slot_copy, stack_size, joinable, bound, (GThreadPriority) priority, &error); diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg index 05fc76c4..49ad1079 100644 --- a/glib/src/threads.ccg +++ b/glib/src/threads.ccg @@ -40,7 +40,7 @@ extern "C" static void* call_thread_entry_slot(void* data) { - sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data); + const auto slot = reinterpret_cast<sigc::slot_base*>(data); try { @@ -78,10 +78,10 @@ namespace Threads Thread* Thread::create(const sigc::slot<void>& slot, const std::string& name) { // Make a copy of slot on the heap. - sigc::slot_base *const slot_copy = new sigc::slot<void>(slot); + const auto slot_copy = new sigc::slot<void>(slot); GError* error = 0; - GThread* thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), + auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(), &call_thread_entry_slot, slot_copy, &error); if (error) diff --git a/glib/src/valuearray.ccg b/glib/src/valuearray.ccg index 114e978f..8b82aeda 100644 --- a/glib/src/valuearray.ccg +++ b/glib/src/valuearray.ccg @@ -48,7 +48,7 @@ ValueArray::ValueArray(guint n_preallocated) : bool ValueArray::get_nth(guint index, Glib::ValueBase& value) { - GValue* const g_value = g_value_array_get_nth(gobj(), index); + const auto g_value = g_value_array_get_nth(gobj(), index); if(g_value) { diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 71d34d9a..46153d6d 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -54,14 +54,14 @@ VariantType& VariantType::operator=(const GVariantType* castitem) VariantType VariantType::create_tuple(const std::vector<VariantType>& items) { typedef GVariantType* var_ptr; - var_ptr* const var_array = new var_ptr[items.size()]; + const auto var_array = new var_ptr[items.size()]; for(std::vector<VariantType>::size_type i = 0; i < items.size(); i++) { var_array[i] = const_cast<GVariantType*>(items[i].gobj()); } - VariantType result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size())); + auto result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size())); delete[] var_array; return result; } |