Introduct a down_cast macro.
* src/misc/casts.hh: New file. * src/misc/Makefile.am: Add it. * iface/dve2/dve2.cc, iface/gspn/gspn.cc, iface/gspn/ssp.cc, src/evtgba/explicit.cc, src/evtgba/product.cc, src/misc/casts.hh, src/tgba/state.hh, src/tgba/statebdd.cc, src/tgba/taatgba.cc, src/tgba/taatgba.hh, src/tgba/tgbabddconcrete.cc, src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbakvcomplement.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbasafracomplement.cc, src/tgba/tgbasgba.cc, src/tgba/tgbatba.cc, src/tgba/tgbaunion.cc, src/tgba/wdbacomp.cc, src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/reductgba_sim.cc, src/tgbaalgos/reductgba_sim_del.cc: Use down_cast when appropriate.
This commit is contained in:
parent
12783ff784
commit
9f63bb6637
25 changed files with 193 additions and 124 deletions
|
|
@ -80,7 +80,7 @@ namespace spot
|
|||
virtual int
|
||||
compare(const state* other) const
|
||||
{
|
||||
const state_tba_proxy* o = dynamic_cast<const state_tba_proxy*>(other);
|
||||
const state_tba_proxy* o = down_cast<const state_tba_proxy*>(other);
|
||||
assert(o);
|
||||
int res = s_->compare(o->real_state());
|
||||
if (res != 0)
|
||||
|
|
@ -334,7 +334,7 @@ namespace spot
|
|||
const tgba* global_automaton) const
|
||||
{
|
||||
const state_tba_proxy* s =
|
||||
dynamic_cast<const state_tba_proxy*>(local_state);
|
||||
down_cast<const state_tba_proxy*>(local_state);
|
||||
assert(s);
|
||||
|
||||
tgba_succ_iterator* it = a_->succ_iter(s->real_state(),
|
||||
|
|
@ -374,7 +374,7 @@ namespace spot
|
|||
std::string
|
||||
tgba_tba_proxy::format_state(const state* state) const
|
||||
{
|
||||
const state_tba_proxy* s = dynamic_cast<const state_tba_proxy*>(state);
|
||||
const state_tba_proxy* s = down_cast<const state_tba_proxy*>(state);
|
||||
assert(s);
|
||||
std::string a = bdd_format_accset(get_dict(), s->acceptance_cond());
|
||||
if (a != "")
|
||||
|
|
@ -385,7 +385,7 @@ namespace spot
|
|||
state*
|
||||
tgba_tba_proxy::project_state(const state* s, const tgba* t) const
|
||||
{
|
||||
const state_tba_proxy* s2 = dynamic_cast<const state_tba_proxy*>(s);
|
||||
const state_tba_proxy* s2 = down_cast<const state_tba_proxy*>(s);
|
||||
assert(s2);
|
||||
if (t == this)
|
||||
return s2->clone();
|
||||
|
|
@ -409,7 +409,7 @@ namespace spot
|
|||
tgba_tba_proxy::compute_support_conditions(const state* state) const
|
||||
{
|
||||
const state_tba_proxy* s =
|
||||
dynamic_cast<const state_tba_proxy*>(state);
|
||||
down_cast<const state_tba_proxy*>(state);
|
||||
assert(s);
|
||||
return a_->support_conditions(s->real_state());
|
||||
}
|
||||
|
|
@ -418,7 +418,7 @@ namespace spot
|
|||
tgba_tba_proxy::compute_support_variables(const state* state) const
|
||||
{
|
||||
const state_tba_proxy* s =
|
||||
dynamic_cast<const state_tba_proxy*>(state);
|
||||
down_cast<const state_tba_proxy*>(state);
|
||||
assert(s);
|
||||
return a_->support_variables(s->real_state());
|
||||
}
|
||||
|
|
@ -481,7 +481,7 @@ namespace spot
|
|||
tgba_sba_proxy::state_is_accepting(const state* state) const
|
||||
{
|
||||
const state_tba_proxy* s =
|
||||
dynamic_cast<const state_tba_proxy*>(state);
|
||||
down_cast<const state_tba_proxy*>(state);
|
||||
assert(s);
|
||||
return bddtrue == s->acceptance_cond();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue