From fb9f840e18edaa54f6c51762b2b9aa67f6fcd85b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 31 Mar 2016 11:09:44 +0200 Subject: C++11: .hg/.ccg files: Replace typedefs with using. --- glib/src/balancedtree.hg | 4 ++-- glib/src/binding.hg | 6 +++--- glib/src/date.hg | 4 ++-- glib/src/datetime.hg | 2 +- glib/src/fileutils.hg | 4 ++-- glib/src/markup.hg | 6 +++--- glib/src/nodetree.hg | 8 ++++---- glib/src/optiongroup.hg | 4 ++-- glib/src/spawn.hg | 4 ++-- glib/src/thread.hg | 4 ++-- glib/src/threads.hg | 2 +- glib/src/valuearray.hg | 2 +- glib/src/variant.ccg | 6 +++--- glib/src/variant.hg | 52 ++++++++++++++++++++++++------------------------ glib/src/variantdict.hg | 4 ++-- glib/src/varianttype.ccg | 2 +- 16 files changed, 57 insertions(+), 57 deletions(-) (limited to 'glib') diff --git a/glib/src/balancedtree.hg b/glib/src/balancedtree.hg index f9190e55..47073204 100644 --- a/glib/src/balancedtree.hg +++ b/glib/src/balancedtree.hg @@ -57,8 +57,8 @@ class BalancedTree { _CLASS_GENERIC(BalancedTree, GTree) public: - typedef sigc::slot TraverseFunc; - typedef sigc::slot CompareFunc; + using TraverseFunc = sigc::slot; + using CompareFunc = sigc::slot; protected: BalancedTree() : diff --git a/glib/src/binding.hg b/glib/src/binding.hg index bc8cc369..b30cba18 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -106,7 +106,7 @@ public: * * @return true if the transformation was successful, and false otherwise. */ - typedef sigc::slot SlotTransform; + using SlotTransform = sigc::slot; /** Creates a binding between @a source_property and @a target_property, * allowing you to set the transformation functions to be used by the binding. @@ -394,8 +394,8 @@ private: class TransformProp : public sigc::functor_base { public: - typedef bool result_type; - typedef sigc::slot SlotTypedTransform; + using result_type = bool; + using SlotTypedTransform = sigc::slot; TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {} diff --git a/glib/src/date.hg b/glib/src/date.hg index 5a307e61..228272a8 100644 --- a/glib/src/date.hg +++ b/glib/src/date.hg @@ -34,8 +34,8 @@ namespace Glib class Date { public: - typedef guint8 Day; - typedef guint16 Year; + using Day = guint8 ; + using Year = guint16; _WRAP_ENUM(Month, GDateMonth, s#^DATE_##, NO_GTYPE, get_type_func=) _WRAP_ENUM(Weekday, GDateWeekday, s#^DATE_##, NO_GTYPE) diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg index 82bcd56f..023cca31 100644 --- a/glib/src/datetime.hg +++ b/glib/src/datetime.hg @@ -35,7 +35,7 @@ class TimeZone; /** A value representing an interval of time, in microseconds. As GTimeSpan, * its underlying type is gint64. */ -typedef GTimeSpan TimeSpan; +using TimeSpan = GTimeSpan; /** DateTime - A structure representing Date and Time. * DateTime is a structure that combines a Gregorian date and time into a diff --git a/glib/src/fileutils.hg b/glib/src/fileutils.hg index 4320c420..b8792b60 100644 --- a/glib/src/fileutils.hg +++ b/glib/src/fileutils.hg @@ -257,8 +257,8 @@ private: class Dir { public: - typedef DirIterator iterator; - typedef DirIterator const_iterator; + using iterator = DirIterator; + using const_iterator = DirIterator; /** Opens a directory for reading. The names of the files in the * directory can then be retrieved using read_name(). diff --git a/glib/src/markup.hg b/glib/src/markup.hg index 14c4163b..1075f690 100644 --- a/glib/src/markup.hg +++ b/glib/src/markup.hg @@ -97,7 +97,7 @@ namespace Markup class ParseContext; /** @ingroup Markup */ -typedef Glib::MarkupError Error; +using Error = Glib::MarkupError; /** Escapes text so that the markup parser will parse it verbatim. @@ -132,8 +132,8 @@ _WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, s#^MARKUP_##) class AttributeKeyLess { public: - typedef Glib::ustring first_argument_type; - typedef Glib::ustring second_argument_type; + using first_argument_type = Glib::ustring; + using second_argument_type = Glib::ustring; typedef bool result_type; bool operator()(const Glib::ustring& lhs, const Glib::ustring& rhs) const; diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg index ec6a5456..75b63c04 100644 --- a/glib/src/nodetree.hg +++ b/glib/src/nodetree.hg @@ -69,8 +69,8 @@ class NodeTree { _CLASS_GENERIC(NodeTree, GNode) public: - typedef sigc::slot&> TraverseFunc; - typedef sigc::slot&> ForeachFunc; + using TraverseFunc = sigc::slot&>; + using ForeachFunc = sigc::slot&>; private: static NodeTree* wrap(GNode* node) @@ -340,7 +340,7 @@ public: sigc::slot real_slot = sigc::ptr_fun(on_compare_child); GNode* child = nullptr; - typedef sigc::slot type_foreach_gnode_slot; + using type_foreach_gnode_slot = sigc::slot; type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach_compare_child, reinterpret_cast(&bound_slot)); @@ -374,7 +374,7 @@ public: sigc::slot real_slot = sigc::ptr_fun(on_compare_node); GNode* child = nullptr; - typedef sigc::slot type_traverse_gnode_slot; + using type_traverse_gnode_slot = sigc::slot; type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); g_node_traverse(const_cast(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast(&bound_slot)); diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg index 5cfe0e5e..b4e08464 100644 --- a/glib/src/optiongroup.hg +++ b/glib/src/optiongroup.hg @@ -85,8 +85,8 @@ public: _IGNORE(g_option_group_add_entries) - typedef std::vector vecustrings; - typedef std::vector vecstrings; + using vecustrings = std::vector; + using vecstrings = std::vector; /** Add a boolean option @a entry. * The @arg parameter will be set to the option's extra argument diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg index 830ad9eb..09490482 100644 --- a/glib/src/spawn.hg +++ b/glib/src/spawn.hg @@ -26,7 +26,7 @@ _DEFS(glibmm,glib) namespace Glib { -typedef GPid Pid; +using Pid = GPid; _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE) @@ -42,7 +42,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#) /** For instance,
* void on_child_setup(); */ -typedef sigc::slot SlotSpawnChildSetup; +using SlotSpawnChildSetup = sigc::slot; /** Executes a child program asynchronously (your program will not * block waiting for the child to exit). The child program is diff --git a/glib/src/thread.hg b/glib/src/thread.hg index 24df5de3..57b940f2 100644 --- a/glib/src/thread.hg +++ b/glib/src/thread.hg @@ -719,7 +719,7 @@ private: template struct StaticPrivate { - typedef void (*DestroyNotifyFunc) (void*); + using DestroyNotifyFunc = void (*) (void*); static void delete_ptr(void* data); @@ -746,7 +746,7 @@ public: Private(const Private&) = delete; Private& operator=(const Private&) = delete; - typedef void (*DestructorFunc) (void*); + using DestructorFunc = void (*) (void*); static void delete_ptr(void* data); diff --git a/glib/src/threads.hg b/glib/src/threads.hg index 51decfc6..6340f45f 100644 --- a/glib/src/threads.hg +++ b/glib/src/threads.hg @@ -596,7 +596,7 @@ public: Private(const Private&) = delete; Private& operator=(const Private&) = delete; - typedef void (*DestructorFunc) (void*); + using DestructorFunc = void (*) (void*); /** Deletes static_cast(data) */ diff --git a/glib/src/valuearray.hg b/glib/src/valuearray.hg index 518123f6..c1b56385 100644 --- a/glib/src/valuearray.hg +++ b/glib/src/valuearray.hg @@ -55,7 +55,7 @@ public: * The compare function should return -1 if v1 < v2, 0 if v1 == v2, and 1 if * v1 > v2. */ - typedef sigc::slot SlotCompare; + using SlotCompare = sigc::slot; /** Default constructor. Constructs a new array with no pre-allocation. */ diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index 3093dfa2..bde8b4b7 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -154,7 +154,7 @@ VariantContainerBase::VariantContainerBase(GVariant* castitem, bool take_a_refer VariantContainerBase VariantContainerBase::create_tuple(const std::vector& children) { - typedef GVariant* var_ptr; + using var_ptr = GVariant*; var_ptr* const var_array = new var_ptr[children.size()]; for (std::vector::size_type i = 0; i < children.size(); i++) @@ -417,7 +417,7 @@ Variant::get() const /*--------------------Variant< std::vector >---------------------*/ -typedef std::vector type_vec_ustring; +using type_vec_ustring = std::vector; Variant::Variant() : VariantContainerBase() { @@ -501,7 +501,7 @@ Variant::get_iter() const /*--------------------Variant< std::vector >---------------------*/ -typedef std::vector type_vec_string; +using type_vec_string = std::vector; Variant::Variant() : VariantContainerBase() { diff --git a/glib/src/variant.hg b/glib/src/variant.hg index c73fc8ed..c90fa550 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -98,7 +98,7 @@ public: /** This typedef is just to make it more obvious that * our operator const void* should be used like operator bool(). */ - typedef const void* BoolExpr; + using BoolExpr = const void*; /** Test whether the Variant has an underlying instance. * @@ -285,8 +285,8 @@ class VariantStringBase : public VariantBase _CLASS_GENERIC(VariantStringBase, GVariant) public: - typedef GVariant* CType; - typedef VariantStringBase CppType; + using CType = GVariant*; + using CppType = VariantStringBase; /// Default constructor. VariantStringBase(); @@ -340,8 +340,8 @@ class VariantContainerBase : public VariantBase _CLASS_GENERIC(VariantContainerBase, GVariant) public: - typedef GVariant* CType; - typedef VariantContainerBase CppType; + using CType = GVariant*; + using CppType = VariantContainerBase; /// Default constructor. VariantContainerBase(); @@ -430,7 +430,7 @@ template class Variant : public VariantBase { public: - typedef T CppType; + using CppType = T; }; /****************** Specializations ***********************************/ @@ -446,9 +446,9 @@ class Variant : public VariantContainerBase _CLASS_GENERIC(Variant, GVariant) public: - typedef GVariant* CType; - typedef VariantBase CppType; - typedef Variant CppContainerType; + using CType = GVariant*; + using CppType = VariantBase; + using CppContainerType = Variant; /// Default constructor. Variant(); @@ -492,9 +492,9 @@ template class Variant< Variant > : public VariantContainerBase { public: - typedef GVariant* CType; - typedef Variant CppType; - typedef Variant CppContainerType; + using CType = GVariant*; + using CppType = Variant; + using CppContainerType = Variant; /// Default constructor. Variant< Variant >(); @@ -539,8 +539,8 @@ class Variant : public VariantStringBase // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant, GVariant) public: - typedef char* CType; - typedef Glib::ustring CppType; + using CType = char*; + using CppType = Glib::ustring; /// Default constructor. Variant(); @@ -592,8 +592,8 @@ class Variant : public VariantStringBase // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant, GVariant) public: - typedef char* CType; - typedef std::string CppType; + using CType = char* ; + using CppType = std::string; /// Default constructor. Variant(); @@ -638,8 +638,8 @@ template class Variant< std::pair > : public VariantContainerBase { public: - typedef std::pair CppType; - typedef Variant CppContainerType; + using CppType = std::pair; + using CppContainerType = Variant; /// Default constructor. Variant< std::pair >() @@ -687,8 +687,8 @@ template class Variant< std::vector > : public VariantContainerBase { public: - typedef T CppType; - typedef std::vector CppContainerType; + using CppType = T ; + using CppContainerType = std::vector; /// Default constructor. Variant< std::vector >() @@ -756,8 +756,8 @@ template<> class Variant< std::vector > : public VariantContainerBase { public: - typedef Glib::ustring CppType; - typedef std::vector CppContainerType; + using CppType = Glib::ustring ; + using CppContainerType = std::vector; /// Default constructor. Variant< std::vector >(); @@ -820,8 +820,8 @@ template<> class Variant< std::vector > : public VariantContainerBase { public: - typedef std::string CppType; - typedef std::vector CppContainerType; + using CppType = std::string ; + using CppContainerType = std::vector; /// Default constructor. Variant< std::vector >(); @@ -896,8 +896,8 @@ template class Variant< std::map >: public VariantContainerBase { public: - typedef std::pair CppType; - typedef std::map CppContainerType; + using CppType = std::pair; + using CppContainerType = std::map; /// Default constructor. Variant< std::map >() diff --git a/glib/src/variantdict.hg b/glib/src/variantdict.hg index 7b668691..296f1e2d 100644 --- a/glib/src/variantdict.hg +++ b/glib/src/variantdict.hg @@ -102,7 +102,7 @@ public: template void VariantDict::insert_value(const Glib::ustring& key, const T_Value& value) { - typedef Glib::Variant type_glib_variant; + using type_glib_variant = Glib::Variant; //TODO: Can we do any check like this here, before glib does? //g_return_val_if_fail( @@ -116,7 +116,7 @@ bool VariantDict::lookup_value(const Glib::ustring& key, T_Value& value) const { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant type_glib_variant; + using type_glib_variant = Glib::Variant; //TODO: Can we do any check like this here, before glib does? //g_variant_type_equal(g_action_group_get_action_state_type(const_cast(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj())); diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 4f43b569..8274c931 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -54,7 +54,7 @@ VariantType::operator=(const GVariantType* castitem) VariantType VariantType::create_tuple(const std::vector& items) { - typedef GVariantType* var_ptr; + using var_ptr = GVariantType*; const auto var_array = new var_ptr[items.size()]; for (std::vector::size_type i = 0; i < items.size(); i++) -- cgit v1.2.1