From: Petr Machata Date: Fri, 27 Aug 2010 16:14:36 +0000 (+0200) Subject: dwarflint: Change registrar::item::list to registrar::item::descriptor X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1eb04c68e68b5c066d51ea8982efe7c1446382fe;p=thirdparty%2Felfutils.git dwarflint: Change registrar::item::list to registrar::item::descriptor - with appropriate change in semantics - change the way the checks are listed --- diff --git a/dwarflint/checks.hh b/dwarflint/checks.hh index 08591b602..c819b46f0 100644 --- a/dwarflint/checks.hh +++ b/dwarflint/checks.hh @@ -148,9 +148,9 @@ struct reg lint.toplev_check (stack); } - virtual void list () const + virtual checkdescriptor descriptor () const { - dwarflint::list_check (T::descriptor ()); + return T::descriptor (); } }; diff --git a/dwarflint/dwarflint.cc b/dwarflint/dwarflint.cc index 20ec0410b..b15c3f816 100644 --- a/dwarflint/dwarflint.cc +++ b/dwarflint/dwarflint.cc @@ -101,13 +101,10 @@ dwarflint::check_registrar::list_checks () const { for (std::vector ::const_iterator it = _m_items.begin (); it != _m_items.end (); ++it) - (*it)->list (); -} - -void -dwarflint::list_check (checkdescriptor const &cd) -{ - std::cout << cd.name << std::endl; + { + checkdescriptor const &cd = (*it)->descriptor (); + std::cout << cd.name << ' ' << cd.groups << std::endl; + } } namespace diff --git a/dwarflint/dwarflint.hh b/dwarflint/dwarflint.hh index 421703890..9acd2f767 100644 --- a/dwarflint/dwarflint.hh +++ b/dwarflint/dwarflint.hh @@ -86,7 +86,7 @@ public: struct item { virtual void run (checkstack &stack, dwarflint &lint) = 0; - virtual void list () const = 0; + virtual checkdescriptor descriptor () const = 0; }; static check_registrar *inst () @@ -126,8 +126,6 @@ public: template T *toplev_check (checkstack &stack, T *tag = NULL); - - static void list_check (checkdescriptor const &cd); }; #endif//DWARFLINT_HH