Rework the 'down_cast' macro, closing #196.

* spot/misc/casts.hh: New inline functions and compile-time checks.
* spot/kripke/kripkegraph.hh, spot/ta/taexplicit.cc,
  spot/ta/taproduct.cc, spot/ta/tgtaproduct.cc, spot/taalgos/tgba2ta.cc,
  spot/twa/taatgba.hh, spot/twa/taatgba.cc, spot/twa/twagraph.hh,
  spot/twa/twaproduct.cc, spot/twaalgos/emptiness.cc,
  spot/twaalgos/stutter.cc, spot/ltsmin/ltsmin.cc, tests/core/ikwiad.cc,
  tests/core/ngraph.cc: Remove downcast checks from code.
This commit is contained in:
Maximilien Colange 2017-02-01 17:50:01 +01:00
parent 07a76e4d93
commit 3f5470898d
15 changed files with 143 additions and 89 deletions

View file

@ -121,7 +121,6 @@ namespace spot
if (this == other)
return 0;
const spins_state* o = down_cast<const spins_state*>(other);
assert(o);
if (hash_value < o->hash_value)
return -1;
if (hash_value > o->hash_value)
@ -182,7 +181,6 @@ namespace spot
return 0;
const spins_compressed_state* o =
down_cast<const spins_compressed_state*>(other);
assert(o);
if (hash_value < o->hash_value)
return -1;
if (hash_value > o->hash_value)
@ -833,7 +831,6 @@ namespace spot
{
const spins_compressed_state* s =
down_cast<const spins_compressed_state*>(st);
assert(s);
decompress_(s->vars, s->size, uncompressed_, state_size_);
vars = uncompressed_;
@ -841,7 +838,6 @@ namespace spot
else
{
const spins_state* s = down_cast<const spins_state*>(st);
assert(s);
vars = s->vars;
}
return vars;