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:
parent
a3b49f1108
commit
a577850eb3
36 changed files with 117 additions and 123 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2011 Laboratoire de Recherche et Developpement
|
||||
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement
|
||||
// de l'Epita (LRDE)
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -153,7 +153,7 @@ namespace spot
|
|||
{
|
||||
dict_->unregister_all_my_variables(this);
|
||||
std::map<const std::string, state_kripke*>::iterator it;
|
||||
for (it = ns_nodes_.begin(); it != ns_nodes_.end(); it++)
|
||||
for (it = ns_nodes_.begin(); it != ns_nodes_.end(); ++it)
|
||||
{
|
||||
state_kripke* del_me = it->second;
|
||||
delete del_me;
|
||||
|
|
@ -195,7 +195,7 @@ namespace spot
|
|||
}
|
||||
|
||||
bdd
|
||||
kripke_explicit::state_condition(const std::string name) const
|
||||
kripke_explicit::state_condition(const std::string& name) const
|
||||
{
|
||||
std::map<const std::string, state_kripke*>::const_iterator it;
|
||||
it = ns_nodes_.find(name);
|
||||
|
|
@ -247,13 +247,12 @@ namespace spot
|
|||
void kripke_explicit::add_transition(std::string source,
|
||||
std::string dest)
|
||||
{
|
||||
state_kripke* neo = 0;
|
||||
std::map<std::string, state_kripke*>::iterator destination
|
||||
= ns_nodes_.find(dest);
|
||||
|
||||
if (ns_nodes_.find(dest) == ns_nodes_.end())
|
||||
{
|
||||
neo = new state_kripke;
|
||||
state_kripke* neo = new state_kripke;
|
||||
add_state(dest, neo);
|
||||
add_transition(source, neo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue