* src/sanity/style.test: Suggest ++i over i++ when it does not
matter, for consistency. * src/tgbaalgos/tarjan_on_fly.cc, iface/gspn/ssp.cc, src/tgbaalgos/reductgba_sim_del.cc, src/tgbaalgos/reductgba_sim.cc, src/tgbaalgos/minimalce.cc, src/tgba/tgbareduc.cc: Adjust.
This commit is contained in:
parent
3780650ea0
commit
3f2cba6304
9 changed files with 38 additions and 30 deletions
|
|
@ -1,5 +1,11 @@
|
|||
2004-09-23 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* src/sanity/style.test: Suggest ++i over i++ when it does not
|
||||
matter, for consistency.
|
||||
* src/tgbaalgos/tarjan_on_fly.cc, iface/gspn/ssp.cc,
|
||||
src/tgbaalgos/reductgba_sim_del.cc, src/tgbaalgos/reductgba_sim.cc,
|
||||
src/tgbaalgos/minimalce.cc, src/tgba/tgbareduc.cc: Adjust.
|
||||
|
||||
* src/tgbaalgos/ltl2tgba_fm.hh (ltl_to_tgba_fm): New unobs argument.
|
||||
* src/tgbaalgos/ltl2tgba_fm.cc (ltl_to_tgba_fm): Handle unobs.
|
||||
* src/tgbatest/ltl2tgba.cc (syntax, main): New -U option.
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ namespace spot
|
|||
virtual void
|
||||
next()
|
||||
{
|
||||
current_succ_++;
|
||||
++current_succ_;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
|
|
@ -379,13 +379,13 @@ namespace spot
|
|||
bdd_array = bdd_realloc(bdd_array, size_bdd, size_bdd + 1);
|
||||
bdd_array[size_bdd] = i->current_acceptance_conditions();
|
||||
props_[nb_arc_props].arc->curr_acc_conds = size_bdd;
|
||||
size_bdd++;
|
||||
++size_bdd;
|
||||
|
||||
state_array = (state**) realloc(state_array,
|
||||
(size_states + 1) * sizeof(state*));
|
||||
state_array[size_states] = i->current_state();
|
||||
props_[nb_arc_props].arc->curr_state = size_states;
|
||||
size_states++;
|
||||
++size_states;
|
||||
|
||||
while (all_conds_ != bddfalse)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,12 +119,15 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
|
|||
|
||||
# std::list::size() can be O(n). Better use empty() whenever
|
||||
# possible, even for other containers.
|
||||
grep -E '(->|[.])size\(\) [=!]= 0|![a-zA-Z0-9_]*(->|[.])size\(\)|(if |while |assert)\([a-zA-Z0-9_]*(->|[.])size\(\)\)' $tmp &&
|
||||
egrep '(->|[.])size\(\) [=!]= 0|![a-zA-Z0-9_]*(->|[.])size\(\)|(if |while |assert)\([a-zA-Z0-9_]*(->|[.])size\(\)\)' $tmp &&
|
||||
diag 'Prefer empty() to check emptiness.'
|
||||
|
||||
egrep '^[^=]*([+][+]|--);' $tmp &&
|
||||
diag 'Take good habits: use ++i instead of i++ when you have the choice.'
|
||||
|
||||
case $file in
|
||||
*.hh | *.hxx)
|
||||
if grep -E '(cout|cerr|clog)' $tmp >/dev/null; then
|
||||
if egrep '(cout|cerr|clog)' $tmp >/dev/null; then
|
||||
:
|
||||
else
|
||||
grep '#.*include.*<iostream>' $tmp &&
|
||||
|
|
|
|||
|
|
@ -940,7 +940,7 @@ namespace spot
|
|||
while (all != bddfalse)
|
||||
{
|
||||
all -= bdd_satone(all);
|
||||
count++;
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
@ -958,7 +958,7 @@ namespace spot
|
|||
if (((*i)->first)->compare((*i)->second) == 0)
|
||||
continue;
|
||||
|
||||
n++;
|
||||
++n;
|
||||
os << "couple " << n
|
||||
<< std::endl
|
||||
<< " " << " [label=\""
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ namespace spot
|
|||
|
||||
assert(!cycle.empty());
|
||||
is = cycle.end();
|
||||
is--;
|
||||
--is;
|
||||
id = cycle.begin();
|
||||
strs = automata_->format_state(is->first);
|
||||
strd = automata_->format_state(id->first);
|
||||
|
|
@ -647,7 +647,7 @@ namespace spot
|
|||
iter = a->succ_iter(s);
|
||||
iter->first();
|
||||
stack.push_front(state_pair(s, iter));
|
||||
depth_mode++;
|
||||
++depth_mode;
|
||||
}
|
||||
else
|
||||
s = stack.front().first;
|
||||
|
|
@ -722,7 +722,7 @@ namespace spot
|
|||
iter = a->succ_iter(s);
|
||||
iter->first();
|
||||
stack.push_front(state_pair(s, iter));
|
||||
depth_mode++;
|
||||
++depth_mode;
|
||||
goto recurse;
|
||||
}
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ namespace spot
|
|||
iter = a->succ_iter(s);
|
||||
iter->first();
|
||||
stack.push_front(state_pair(s, iter));
|
||||
depth_mode++;
|
||||
++depth_mode;
|
||||
goto recurse;
|
||||
}
|
||||
|
||||
|
|
@ -772,7 +772,7 @@ namespace spot
|
|||
iter = a->succ_iter(s);
|
||||
iter->first();
|
||||
stack.push_front(state_pair(s, iter));
|
||||
depth_mode++;
|
||||
++depth_mode;
|
||||
goto recurse;
|
||||
}
|
||||
else
|
||||
|
|
@ -786,7 +786,7 @@ namespace spot
|
|||
|
||||
delete iter;
|
||||
|
||||
depth_mode--;
|
||||
--depth_mode;
|
||||
if (depth_mode_memory == depth_mode)
|
||||
{
|
||||
depth_mode_memory = -1;
|
||||
|
|
@ -945,7 +945,7 @@ namespace spot
|
|||
{
|
||||
//std::cout << os.str() << "save counter" << std::endl;
|
||||
|
||||
nb_found++;
|
||||
++nb_found;
|
||||
if (min_ce->empty())
|
||||
delete min_ce;
|
||||
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ namespace spot
|
|||
i1 != spoiler_vertice_.end(); ++i1)
|
||||
{
|
||||
os << (*i1)->to_string(automata_);
|
||||
n++;
|
||||
++n;
|
||||
if (n > 20)
|
||||
{
|
||||
n = 0;
|
||||
|
|
@ -326,7 +326,7 @@ namespace spot
|
|||
i2 != duplicator_vertice_.end(); ++i2)
|
||||
{
|
||||
os << (*i2)->to_string(automata_);
|
||||
n++;
|
||||
++n;
|
||||
if (n > 20)
|
||||
{
|
||||
n = 0;
|
||||
|
|
@ -508,7 +508,7 @@ namespace spot
|
|||
si->current_acceptance_conditions()))
|
||||
{
|
||||
(*j)->add_succ(*i);
|
||||
nb_ds++;
|
||||
++nb_ds;
|
||||
}
|
||||
delete s;
|
||||
}
|
||||
|
|
@ -529,7 +529,7 @@ namespace spot
|
|||
si->current_acceptance_conditions()))
|
||||
{
|
||||
(*i)->add_succ(*j);
|
||||
nb_sd++;
|
||||
++nb_sd;
|
||||
}
|
||||
delete s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ namespace spot
|
|||
: spoiler_node(d_node, s_node, num),
|
||||
acceptance_condition_visited_(a)
|
||||
{
|
||||
nb_spoiler++;
|
||||
++nb_spoiler;
|
||||
progress_measure_ = 0;
|
||||
if (acceptance_condition_visited_ != bddfalse)
|
||||
nb_spoiler_loose_++;
|
||||
++nb_spoiler_loose_;
|
||||
lead_2_acc_all_ = false;
|
||||
|
||||
seen_ = false;
|
||||
|
|
@ -62,8 +62,8 @@ namespace spot
|
|||
|
||||
spoiler_node_delayed::~spoiler_node_delayed()
|
||||
{
|
||||
if (acceptance_condition_visited_ != bddfalse)
|
||||
nb_spoiler_loose_--;
|
||||
if (acceptance_condition_visited_ != bddfalse)
|
||||
--nb_spoiler_loose_;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -110,7 +110,7 @@ namespace spot
|
|||
// then we increment the progress measure of 1.
|
||||
if ((acceptance_condition_visited_ != bddfalse) &&
|
||||
(tmpmax < (nb_spoiler_loose_ + 1)))
|
||||
tmpmax++;
|
||||
++tmpmax;
|
||||
|
||||
change = (progress_measure_ < tmpmax);
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ namespace spot
|
|||
int num)
|
||||
: duplicator_node(d_node, s_node, l, a, num)
|
||||
{
|
||||
nb_duplicator++;
|
||||
++nb_duplicator;
|
||||
progress_measure_ = 0;
|
||||
all_acc_cond |= a;
|
||||
lead_2_acc_all_ = false;
|
||||
|
|
@ -348,7 +348,7 @@ namespace spot
|
|||
{
|
||||
sub_set_acc_cond_.push_back(bdd_satone(all));
|
||||
all -= bdd_satone(all);
|
||||
count++;
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
@ -369,7 +369,7 @@ namespace spot
|
|||
i2 != tgba_state_.end(); ++i2)
|
||||
{
|
||||
//std::cout << "add spoiler node" << std::endl;
|
||||
nb_spoiler++;
|
||||
++nb_spoiler;
|
||||
spoiler_node_delayed* n1
|
||||
= new spoiler_node_delayed(*i1, *i2,
|
||||
bddfalse,
|
||||
|
|
|
|||
|
|
@ -109,8 +109,7 @@ namespace spot
|
|||
void
|
||||
tarjan_on_fly::push(const state* s)
|
||||
{
|
||||
h[s] = top;
|
||||
top++;
|
||||
h[s] = top++;
|
||||
|
||||
struct_state ss = { s, 0, top, dftop, 0 };
|
||||
|
||||
|
|
|
|||
|
|
@ -479,12 +479,12 @@ main(int argc, char** argv)
|
|||
unobservables = new spot::ltl::atomic_prop_set;
|
||||
fm_opt = true;
|
||||
// Parse -U's argument.
|
||||
const char* tok = strtok(argv[formula_index] + 2, ",; \t");
|
||||
const char* tok = strtok(argv[formula_index] + 2, ", \t;");
|
||||
while (tok)
|
||||
{
|
||||
unobservables->insert
|
||||
(static_cast<spot::ltl::atomic_prop*>(env.require(tok)));
|
||||
tok = strtok(0, ",; \t");
|
||||
tok = strtok(0, ", \t;");
|
||||
}
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-v"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue