]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Change registrar::item::list to registrar::item::descriptor
authorPetr Machata <pmachata@redhat.com>
Fri, 27 Aug 2010 16:14:36 +0000 (18:14 +0200)
committerPetr Machata <pmachata@redhat.com>
Fri, 27 Aug 2010 16:14:36 +0000 (18:14 +0200)
- with appropriate change in semantics
- change the way the checks are listed

dwarflint/checks.hh
dwarflint/dwarflint.cc
dwarflint/dwarflint.hh

index 08591b60222e82994b6fa71c324153d387c61fc3..c819b46f0b1567357d9fd8d9a9952d879390502a 100644 (file)
@@ -148,9 +148,9 @@ struct reg
     lint.toplev_check <T> (stack);
   }
 
-  virtual void list () const
+  virtual checkdescriptor descriptor () const
   {
-    dwarflint::list_check (T::descriptor ());
+    return T::descriptor ();
   }
 };
 
index 20ec0410b8797e7cb0bb4587c1ddcaf0a98a4a3c..b15c3f816fcce106a0ad7198a88b2be6c4407b38 100644 (file)
@@ -101,13 +101,10 @@ dwarflint::check_registrar::list_checks () const
 {
   for (std::vector <item *>::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
index 421703890f335425e1893616b5320ef42eabf62e..9acd2f7675c289a51795506255a73fd12fc1c61f 100644 (file)
@@ -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 <class T>
   T *toplev_check (checkstack &stack, T *tag = NULL);
-
-  static void list_check (checkdescriptor const &cd);
 };
 
 #endif//DWARFLINT_HH