]> sourceware.org Git - libabigail.git/commitdiff
Fix a few remarks made by cppcheck
authorOndrej Oprala <ondrej.oprala@gmail.com>
Mon, 12 Dec 2016 14:44:29 +0000 (15:44 +0100)
committerOndrej Oprala <ondrej.oprala@gmail.com>
Mon, 12 Dec 2016 20:24:28 +0000 (21:24 +0100)
* src/abg-comparison.cc (types_or_decls_equal::operator()): Pass
arguments by reference.
        (class_diff::ensure_lookup_tables_populated): Expression
        !A || (A && B) can be reduced to !A || B.
* src/abg-suppression.cc (suppression_matches_type_no_name):
Likewise.

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
src/abg-comparison.cc
src/abg-suppression.cc

index 8656bc3c071a334b589de996c4fc35042a712e6a..24822775c68d7c73e936677fd5a4a5b1184a67a9 100644 (file)
@@ -151,7 +151,7 @@ struct types_or_decls_hash
 struct types_or_decls_equal
 {
   bool
-  operator()(const types_or_decls_type d1, const types_or_decls_type d2) const
+  operator()(const types_or_decls_type &d1, const types_or_decls_type &d2) const
   {return d1.first == d2.first && d1.second == d2.second;}
 };
 
@@ -6326,8 +6326,7 @@ class_diff::ensure_lookup_tables_populated(void) const
        // We assume that all the functions we look at here have ELF
        // symbols.
        if (!i->second->get_symbol()
-           || (i->second->get_symbol()
-               && s->lookup_function_symbol(*i->second->get_symbol())))
+               || s->lookup_function_symbol(*i->second->get_symbol()))
          to_delete.push_back(i->first);
 
 
index e8895d6eb7437c72af524b261596061ddb0faca8..69304c9ce7c0edd16291e5a0c4a8ec21355fdd41 100644 (file)
@@ -807,7 +807,7 @@ suppression_matches_type_no_name(const type_suppression&     s,
        case type_suppression::STRUCT_TYPE_KIND:
          {
            class_decl_sptr klass = is_class_type(type);
-           if (!klass || (klass && !klass->is_struct()))
+           if (!klass || !klass->is_struct())
              matches = false;
          }
          break;
This page took 0.04384 seconds and 5 git commands to generate.