aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2023-06-06 09:51:33 +0100
committerGiuliano Procida <gprocida@google.com>2023-11-14 12:02:36 +0000
commit0a2b2bba9d1da6ab751a1c25e6c1a738145fc41a (patch)
treee59daa2ee6b2ea31ec70f9423bd9a1df7e570608
parente28c02f1a6213eef294b06a9d9183e1890ca69de (diff)
downloadlibabigail-0a2b2bba9d1da6ab751a1c25e6c1a738145fc41a.tar.gz
symtab reader: use C++11 `using` syntax instead of typedefs
That is to increase readability and to incrementally modernize the code base. * abg-symtab-reader.h: replace typedefs by corresponding using declarations. Change-Id: Iafb1e83e0ca8b6d27ade94b3cd7ebb8c2540393a Signed-off-by: Matthias Maennich <maennich@google.com>
-rw-r--r--src/abg-symtab-reader.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/abg-symtab-reader.h b/src/abg-symtab-reader.h
index 948fc270..e773cdda 100644
--- a/src/abg-symtab-reader.h
+++ b/src/abg-symtab-reader.h
@@ -99,7 +99,7 @@ private:
/// Base iterator for our custom iterator based on whatever the const_iterator
/// is for a vector of symbols.
/// As of writing this, std::vector<elf_symbol_sptr>::const_iterator.
-typedef elf_symbols::const_iterator base_iterator;
+using base_iterator = elf_symbols::const_iterator;
/// An iterator to walk a vector of elf_symbols filtered by symtab_filter.
///
@@ -110,11 +110,11 @@ typedef elf_symbols::const_iterator base_iterator;
class symtab_iterator : public base_iterator
{
public:
- typedef base_iterator::value_type value_type;
- typedef base_iterator::reference reference;
- typedef base_iterator::pointer pointer;
- typedef base_iterator::difference_type difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ using value_type = base_iterator::value_type;
+ using reference = base_iterator::reference;
+ using pointer = base_iterator::pointer;
+ using difference_type = base_iterator::difference_type;
+ using iterator_category = std::forward_iterator_tag;
/// Construct the iterator based on a pair of underlying iterators and a
/// symtab_filter object. Immediately fast forward to the next element that
@@ -172,7 +172,7 @@ private:
/// Convenience declaration of a unique_ptr<symtab>
class symtab;
-typedef std::unique_ptr<symtab> symtab_ptr;
+using symtab_ptr = std::unique_ptr<symtab>;
/// symtab is the actual data container of the symtab_reader implementation.
///
@@ -201,7 +201,7 @@ typedef std::unique_ptr<symtab> symtab_ptr;
class symtab
{
public:
- typedef std::function<bool(const elf_symbol_sptr&)> symbol_predicate;
+ using symbol_predicate = std::function<bool(const elf_symbol_sptr&)>;
/// Indicate whether any (kernel) symbols have been seen at construction.
///
@@ -215,7 +215,7 @@ public:
/// The (only) iterator type we offer is a const_iterator implemented by the
/// symtab_iterator.
- typedef symtab_iterator const_iterator;
+ using const_iterator = symtab_iterator;
/// Obtain an iterator to the beginning of the symtab according to the filter
/// criteria. Whenever this iterator advances, it skips elements that do not
@@ -271,12 +271,12 @@ private:
bool has_ksymtab_entries_;
/// Lookup map name->symbol(s)
- typedef std::unordered_map<std::string, std::vector<elf_symbol_sptr>>
- name_symbol_map_type;
+ using name_symbol_map_type =
+ std::unordered_map<std::string, std::vector<elf_symbol_sptr>>;
name_symbol_map_type name_symbol_map_;
/// Lookup map addr->symbol
- typedef std::unordered_map<GElf_Addr, elf_symbol_sptr> addr_symbol_map_type;
+ using addr_symbol_map_type = std::unordered_map<GElf_Addr, elf_symbol_sptr>;
addr_symbol_map_type addr_symbol_map_;
/// Lookup map function entry address -> symbol