Address several issues reported by cppcheck all over the place.

* src/bin/common_finput.cc, src/tgbaalgos/lbtt.cc: Use !empty() instead
of size() > 0.
* src/bin/ltl2tgta.cc, src/kripke/kripkeexplicit.cc,
src/tgbatest/complementation.cc: Avoid useless assignments.
* src/bin/ltlcross.cc: Correct mistaken assignment inside assert().
* src/evtgba/symbol.hh, src/tgba/tgbabddcoredata.cc,
src/tgba/tgbabddcoredata.hh,
src/tgba/tgbasafracomplement.cc (operator=): Do not return a const
reference.
* src/evtgbatest/ltl2evtgba.cc, src/evtgbatest/product.cc,
src/evtgbatest/product.cc: Check indices before using them, not after.
* src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/tgbatest/randtgba.cc: Pass constant strings by reference.
* src/kripke/kripkeprint.cc, src/tgbaalgos/simulation.cc:
Remove a useless operation.
* src/ltlvisit/simplify.cc: Remove a duplicate condition.
* src/misc/formater.hh: Remove unused attribute.
* src/misc/modgray.cc: Initialize done_ in the constructor.
* src/saba/explicitstateconjunction.cc,
src/saba/explicitstateconjunction.hh (operator=): Fix prototype.
* src/saba/sabacomplementtgba.cc: Remove unused default constructor.
* src/ta/taexplicit.cc, src/ta/taproduct.cc, src/ta/tgtaproduct.cc,
src/ta/tgtaproduct.hh, src/taalgos/emptinessta.cc,
src/taalgos/minimize.cc, src/taalgos/reachiter.cc,
src/taalgos/tgba2ta.cc, src/tgbaalgos/cutscc.cc: Use C++ casts, and
++it instead of it++.
* src/taalgos/dotty.cc, src/tgbatest/ltl2tgba.cc: Refine the scope of
variables.
* src/tgba/tgbakvcomplement.hh (bdd_order): Always initialize bdd_.
* src/tgba/tgbasgba.cc, src/tgba/wdbacomp.cc: Use the initialization
line to initialize all members.
This commit is contained in:
Alexandre Duret-Lutz 2012-12-20 17:18:56 +01:00
parent a3b49f1108
commit a577850eb3
36 changed files with 117 additions and 123 deletions

View file

@ -90,7 +90,7 @@ namespace spot
assert(dict == right.dict);
}
const tgba_bdd_core_data&
tgba_bdd_core_data&
tgba_bdd_core_data::operator=(const tgba_bdd_core_data& copy)
{
if (this != &copy)

View file

@ -134,7 +134,7 @@ namespace spot
tgba_bdd_core_data(const tgba_bdd_core_data& left,
const tgba_bdd_core_data& right);
const tgba_bdd_core_data& operator=(const tgba_bdd_core_data& copy);
tgba_bdd_core_data& operator=(const tgba_bdd_core_data& copy);
/// \brief Update the variable sets to take a new pair of variables into
/// account.

View file

@ -1,5 +1,6 @@
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -30,7 +31,7 @@ namespace spot
{
public:
bdd_ordered()
: order_(0)
: bdd_(0), order_(0)
{};
bdd_ordered(int bdd_, unsigned order_)
@ -77,7 +78,7 @@ namespace spot
/// \endverbatim
///
/// The original automaton is used as a States-based Generalized
/// Büchi Automaton.
/// Büchi Automaton.
///
/// The construction is done on-the-fly, by the
/// \c tgba_kv_complement_succ_iterator class.

View file

@ -1,3 +1,4 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
@ -104,7 +105,7 @@ namespace spot
safra_tree(const subset_t& nodes, safra_tree* p, int n);
~safra_tree();
const safra_tree& operator=(const safra_tree& other);
safra_tree& operator=(const safra_tree& other);
int compare(const safra_tree* other) const;
size_t hash() const;
@ -177,7 +178,7 @@ namespace spot
(*i)->destroy();
}
const safra_tree&
safra_tree&
safra_tree::operator=(const safra_tree& other)
{
if (this != &other)
@ -816,7 +817,6 @@ namespace spot
void print_safra_automaton(safra_tree_automaton* a)
{
safra_tree_automaton::automaton_t node_list = a->automaton;
typedef safra_tree_automaton::automaton_t::reverse_iterator
automaton_cit;
typedef safra_tree_automaton::transition_list::const_iterator

View file

@ -1,4 +1,4 @@
// Copyright (C) 2009, 2011 Laboratoire de Recherche et Développement
// Copyright (C) 2009, 2011, 2012 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -101,9 +101,8 @@ namespace spot
}
tgba_sgba_proxy_succ_iterator(tgba_succ_iterator* it, bdd acc)
: it_(it), emulate_acc_cond_(true)
: it_(it), emulate_acc_cond_(true), acceptance_condition_(acc)
{
acceptance_condition_ = acc;
}
virtual

View file

@ -166,9 +166,8 @@ namespace spot
{
public:
tgba_wdba_comp_proxy(const tgba* a)
: a_(a)
: a_(a), the_acceptance_cond_(a->all_acceptance_conditions())
{
the_acceptance_cond_ = a->all_acceptance_conditions();
if (the_acceptance_cond_ == bddfalse)
{
int v = get_dict()