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
|
|
@ -51,7 +51,7 @@ namespace spot
|
|||
virtual int
|
||||
compare(const state* other) const
|
||||
{
|
||||
const state_gspn* o = dynamic_cast<const state_gspn*>(other);
|
||||
const state_gspn* o = down_cast<const state_gspn*>(other);
|
||||
assert(o);
|
||||
return reinterpret_cast<char*>(o->get_state())
|
||||
- reinterpret_cast<char*>(get_state());
|
||||
|
|
@ -389,7 +389,7 @@ namespace spot
|
|||
const state* global_state,
|
||||
const tgba* global_automaton) const
|
||||
{
|
||||
const state_gspn* s = dynamic_cast<const state_gspn*>(local_state);
|
||||
const state_gspn* s = down_cast<const state_gspn*>(local_state);
|
||||
assert(s);
|
||||
(void) global_state;
|
||||
(void) global_automaton;
|
||||
|
|
@ -402,7 +402,7 @@ namespace spot
|
|||
bdd
|
||||
tgba_gspn::compute_support_conditions(const spot::state* state) const
|
||||
{
|
||||
const state_gspn* s = dynamic_cast<const state_gspn*>(state);
|
||||
const state_gspn* s = down_cast<const state_gspn*>(state);
|
||||
assert(s);
|
||||
return data_->state_conds(s);
|
||||
}
|
||||
|
|
@ -434,7 +434,7 @@ namespace spot
|
|||
std::string
|
||||
tgba_gspn::format_state(const state* state) const
|
||||
{
|
||||
const state_gspn* s = dynamic_cast<const state_gspn*>(state);
|
||||
const state_gspn* s = down_cast<const state_gspn*>(state);
|
||||
assert(s);
|
||||
char* str;
|
||||
int err = print_state(s->get_state(), &str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue