Commit 9f63bb66 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

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.
parent 12783ff7
2011-03-31 Alexandre Duret-Lutz <adl@lrde.epita.fr>
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.
2011-03-31 Alexandre Duret-Lutz <adl@va-et-vient.net>
Cosmetics.
......
......@@ -107,7 +107,7 @@ namespace spot
{
if (this == other)
return 0;
const dve2_state* o = dynamic_cast<const dve2_state*>(other);
const dve2_state* o = down_cast<const dve2_state*>(other);
assert(o);
if (hash_value < o->hash_value)
return -1;
......@@ -650,7 +650,7 @@ namespace spot
succ_iter(const state* local_state,
const state*, const tgba*) const
{
const dve2_state* s = dynamic_cast<const dve2_state*>(local_state);
const dve2_state* s = down_cast<const dve2_state*>(local_state);
assert(s);
// This may also compute successors in state_condition_last_cc
......@@ -682,7 +682,7 @@ namespace spot
bdd
state_condition(const state* st) const
{
const dve2_state* s = dynamic_cast<const dve2_state*>(st);
const dve2_state* s = down_cast<const dve2_state*>(st);
assert(s);
return compute_state_condition(s);
}
......@@ -690,7 +690,7 @@ namespace spot
virtual
std::string format_state(const state *st) const
{
const dve2_state* s = dynamic_cast<const dve2_state*>(st);
const dve2_state* s = down_cast<const dve2_state*>(st);
assert(s);
std::stringstream res;
......
......@@ -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);
......
......@@ -74,13 +74,14 @@ namespace spot
virtual int
compare(const state* other) const
{
const state_gspn_ssp* o = dynamic_cast<const state_gspn_ssp*>(other);
const state_gspn_ssp* o = down_cast<const state_gspn_ssp*>(other);
assert(o);
int res = (reinterpret_cast<char*>(o->left())
- reinterpret_cast<char*>(left()));
if (res != 0)
return res;
return right_->compare(o->right());
if (o->left() == left())
return right_->compare(o->right());
if (o->left() < left())
return -1;
else
return 1;
}
virtual size_t
......@@ -349,7 +350,7 @@ namespace spot
const state* global_state,
const tgba* global_automaton) const
{
const state_gspn_ssp* s = dynamic_cast<const state_gspn_ssp*>(state_);
const state_gspn_ssp* s = down_cast<const state_gspn_ssp*>(state_);
assert(s);
(void) global_state;
(void) global_automaton;
......@@ -485,7 +486,7 @@ namespace spot
std::string
tgba_gspn_ssp::format_state(const state* state) const
{
const state_gspn_ssp* s = dynamic_cast<const state_gspn_ssp*>(state);
const state_gspn_ssp* s = down_cast<const state_gspn_ssp*>(state);
assert(s);
char* str;
State gs = s->left();
......@@ -512,7 +513,7 @@ namespace spot
state*
tgba_gspn_ssp::project_state(const state* s, const tgba* t) const
{
const state_gspn_ssp* s2 = dynamic_cast<const state_gspn_ssp*>(s);
const state_gspn_ssp* s2 = down_cast<const state_gspn_ssp*>(s);
assert(s2);
if (t == this)
return s2->clone();
......@@ -681,7 +682,7 @@ namespace spot
virtual numbered_state_heap::state_index
find(const state* s) const
{
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
const state_gspn_ssp* s_ = down_cast<const state_gspn_ssp*>(s);
const void* cont = container_(s_->left());
contained_map::const_iterator i = contained.find(cont);
if (i != contained.end())
......@@ -695,9 +696,9 @@ namespace spot
for (j = l.begin(); j != l.end(); ++j)
{
const state_gspn_ssp* old_state =
dynamic_cast<const state_gspn_ssp*>(*j);
down_cast<const state_gspn_ssp*>(*j);
const state_gspn_ssp* new_state =
dynamic_cast<const state_gspn_ssp*>(s);
down_cast<const state_gspn_ssp*>(s);
assert(old_state);
assert(new_state);
......@@ -756,7 +757,7 @@ namespace spot
virtual numbered_state_heap::state_index_p
find(const state* s)
{
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
const state_gspn_ssp* s_ = down_cast<const state_gspn_ssp*>(s);
const void* cont = container_(s_->left());
contained_map::const_iterator i = contained.find(cont);
if (i != contained.end())
......@@ -770,9 +771,9 @@ namespace spot
for (j = l.begin(); j != l.end(); ++j)
{
const state_gspn_ssp* old_state =
dynamic_cast<const state_gspn_ssp*>(*j);
down_cast<const state_gspn_ssp*>(*j);
const state_gspn_ssp* new_state =
dynamic_cast<const state_gspn_ssp*>(s);
down_cast<const state_gspn_ssp*>(s);
assert(old_state);
assert(new_state);
......@@ -875,7 +876,7 @@ namespace spot
{
h[s] = index;
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
const state_gspn_ssp* s_ = down_cast<const state_gspn_ssp*>(s);
State sg = s_->left();
if (sg)
{
......@@ -1058,7 +1059,7 @@ namespace spot
get_contained_map_size() const
{
return
dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained.size();
down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained.size();
}
// If a new state includes an older state, we may have to add new
......@@ -1069,14 +1070,14 @@ namespace spot
find_state(const state* s)
{
typedef numbered_state_heap_ssp_semi::hash_type hash_type;
hash_type& h = dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->h;
hash_type& h = down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->h;
typedef numbered_state_heap_ssp_semi::contained_map contained_map;
typedef numbered_state_heap_ssp_semi::f_map f_map;
typedef numbered_state_heap_ssp_semi::state_list state_list;
const contained_map& contained =
dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained;
down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained;
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
const state_gspn_ssp* s_ = down_cast<const state_gspn_ssp*>(s);
const void* cont = container_(s_->left());
contained_map::const_iterator i = contained.find(cont);
......@@ -1092,9 +1093,9 @@ namespace spot
for (j = l.begin(); j != l.end(); ++j)
{
const state_gspn_ssp* old_state =
dynamic_cast<const state_gspn_ssp*>(*j);
down_cast<const state_gspn_ssp*>(*j);
const state_gspn_ssp* new_state =
dynamic_cast<const state_gspn_ssp*>(s);
down_cast<const state_gspn_ssp*>(s);
assert(old_state);
assert(new_state);
......@@ -1106,9 +1107,9 @@ namespace spot
for (j = l.begin(); j != l.end(); ++j)
{
const state_gspn_ssp* old_state =
dynamic_cast<const state_gspn_ssp*>(*j);
down_cast<const state_gspn_ssp*>(*j);
const state_gspn_ssp* new_state =
dynamic_cast<const state_gspn_ssp*>(s);
down_cast<const state_gspn_ssp*>(s);
assert(old_state);
assert(new_state);
......@@ -1279,7 +1280,7 @@ namespace spot
static_cast<spot::unsigned_statistics::unsigned_fun>
(&couvreur99_check_shy_semi_ssp::get_inclusion_count);
//dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->stats = this;
//down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->stats = this;
}
private:
......@@ -1296,7 +1297,7 @@ namespace spot
get_inclusion_count() const
{
return
dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->inclusions;
down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->inclusions;
};
......@@ -1304,7 +1305,7 @@ namespace spot
get_contained_map_size() const
{
return
dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained.size();
down_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained.size();
}
virtual numbered_state_heap::state_index_p
......
// Copyright (C) 2011 Laboratoire de Recherche et Dveloppement de
// l'Epita (LRDE)
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// dpartement Systmes Rpartis Coopratifs (SRC), Universit Pierre
// et Marie Curie.
......@@ -35,7 +37,7 @@ namespace spot
state_evtgba_explicit::compare(const spot::state* other) const
{
const state_evtgba_explicit* o =
dynamic_cast<const state_evtgba_explicit*>(other);
down_cast<const state_evtgba_explicit*>(other);
assert(o);
return o->get_state() - get_state();
}
......@@ -179,7 +181,7 @@ namespace spot
evtgba_explicit::succ_iter(const spot::state* s) const
{
const state_evtgba_explicit* u =
dynamic_cast<const state_evtgba_explicit*>(s);
down_cast<const state_evtgba_explicit*>(s);
assert(u);
return new evtgba_explicit_iterator_fw(&u->get_state()->out);
}
......@@ -188,7 +190,7 @@ namespace spot
evtgba_explicit::pred_iter(const spot::state* s) const
{
const state_evtgba_explicit* u =
dynamic_cast<const state_evtgba_explicit*>(s);
down_cast<const state_evtgba_explicit*>(s);
assert(u);
return new evtgba_explicit_iterator_fw(&u->get_state()->in);
}
......@@ -197,7 +199,7 @@ namespace spot
evtgba_explicit::format_state(const spot::state* s) const
{
const state_evtgba_explicit* u =
dynamic_cast<const state_evtgba_explicit*>(s);
down_cast<const state_evtgba_explicit*>(s);
assert(u);
sn_map::const_iterator i = state_name_map_.find(u->get_state());
assert(i != state_name_map_.end());
......
// Copyright (C) 2011 Laboratoire de Recherche et Dveloppement de
// l'Epita (LRDE)
// Copyright (C) 2008, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
......@@ -64,7 +66,7 @@ namespace spot
compare(const state* other) const
{
const evtgba_product_state* s =
dynamic_cast<const evtgba_product_state*>(other);
down_cast<const evtgba_product_state*>(other);
assert(s);
assert(s->n_ == n_);
for (int i = 0; i < n_; ++i)
......@@ -404,7 +406,7 @@ namespace spot
evtgba_product::succ_iter(const state* st) const
{
const evtgba_product_state* s =
dynamic_cast<const evtgba_product_state*>(st);
down_cast<const evtgba_product_state*>(st);
assert(s);
int n = op_.size();
......@@ -420,7 +422,7 @@ namespace spot
evtgba_product::pred_iter(const state* st) const
{
const evtgba_product_state* s =
dynamic_cast<const evtgba_product_state*>(st);
down_cast<const evtgba_product_state*>(st);
assert(s);
int n = op_.size();
......@@ -436,7 +438,7 @@ namespace spot
evtgba_product::format_state(const state* st) const
{
const evtgba_product_state* s =
dynamic_cast<const evtgba_product_state*>(st);
down_cast<const evtgba_product_state*>(st);
int n = op_.size();
std::string res = "<" + op_[0]->format_state(s->nth(0));
......
## Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
## dpartement Systmes Rpartis Coopratifs (SRC), Universit Pierre
## et Marie Curie.
## Copyright (C) 2011 Laboratoire de Recherche et Dveloppement
## de l'Epita (LRDE).
## Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
## Paris 6 (LIP6), dpartement Systmes Rpartis Coopratifs (SRC),
## Universit Pierre et Marie Curie.
##
## This file is part of Spot, a model checking library.
##
......@@ -29,6 +31,7 @@ misc_HEADERS = \
bddalloc.hh \
bddlt.hh \
bddop.hh \
casts.hh \
escape.hh \
freelist.hh \
hash.hh \
......
// Copyright (C) 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#ifndef SPOT_MISC_CASTS_HH
# define SPOT_MISC_CASTS_HH
// We usually write code like
// subclass* i = down_cast<subclass*>(m);
// assert(i);
// ... use i ...
// When NDEBUG is set, the down_cast is a fast static_cast
// and the assert has no effect.
// Otherwise, the down_cast is a dynamic_cast and may return 0
// on error, which the assert catches.
#if NDEBUG
# define down_cast static_cast
#else
# define down_cast dynamic_cast
#endif
#endif // SPOT_MISC_CASTS_HH
......@@ -29,6 +29,7 @@
#include <cassert>
#include <functional>
#include <boost/shared_ptr.hpp>
#include "misc/casts.hh"
namespace spot
{
......
// Copyright (C) 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
......@@ -32,7 +34,7 @@ namespace spot
// This method should not be called to compare states from different
// automata, and all states from the same automaton will use the same
// state class.
const state_bdd* o = dynamic_cast<const state_bdd*>(other);
const state_bdd* o = down_cast<const state_bdd*>(other);
assert(o);
return o->as_bdd().id() - state_.id();
}
......
......@@ -70,7 +70,7 @@ namespace spot
const spot::state* global_state,
const tgba* global_automaton) const
{
const spot::state_set* s = dynamic_cast<const spot::state_set*>(state);
const spot::state_set* s = down_cast<const spot::state_set*>(state);
assert(s);
(void) global_state;
(void) global_automaton;
......@@ -104,7 +104,7 @@ namespace spot
bdd
taa_tgba::compute_support_conditions(const spot::state* s) const
{
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
const spot::state_set* se = down_cast<const spot::state_set*>(s);
assert(se);
const state_set* ss = se->get_state();
......@@ -120,7 +120,7 @@ namespace spot
bdd
taa_tgba::compute_support_variables(const spot::state* s) const
{
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
const spot::state_set* se = down_cast<const spot::state_set*>(s);
assert(se);
const state_set* ss = se->get_state();
......@@ -146,7 +146,7 @@ namespace spot
int
state_set::compare(const spot::state* other) const
{
const state_set* o = dynamic_cast<const state_set*>(other);
const state_set* o = down_cast<const state_set*>(other);
assert(o);
const taa_tgba::state_set* s1 = get_state();
......
// Copyright (C) 2009 Laboratoire de Recherche et Développement
// Copyright (C) 2009, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -227,7 +227,7 @@ namespace spot
/// e.g. like {string_1,...,string_n}.
virtual std::string format_state(const spot::state* s) const
{
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
const spot::state_set* se = down_cast<const spot::state_set*>(s);
assert(se);
const state_set* ss = se->get_state();
return format_state_set(ss);
......
......@@ -98,7 +98,7 @@ namespace spot
const state* global_state,
const tgba* global_automaton) const
{
const state_bdd* s = dynamic_cast<const state_bdd*>(local_state);
const state_bdd* s = down_cast<const state_bdd*>(local_state);
assert(s);
bdd succ_set = data_.relation & s->as_bdd();
// If we are in a product, inject the local conditions of
......@@ -115,7 +115,7 @@ namespace spot
bdd
tgba_bdd_concrete::compute_support_conditions(const state* st) const
{
const state_bdd* s = dynamic_cast<const state_bdd*>(st);
const state_bdd* s = down_cast<const state_bdd*>(st);
assert(s);
return bdd_relprod(s->as_bdd(), data_.relation, data_.notvar_set);
}
......@@ -123,7 +123,7 @@ namespace spot
bdd
tgba_bdd_concrete::compute_support_variables(const state* st) const
{
const state_bdd* s = dynamic_cast<const state_bdd*>(st);
const state_bdd* s = down_cast<const state_bdd*>(st);
assert(s);
bdd succ_set = data_.relation & s->as_bdd();
// bdd_support must be called BEFORE bdd_exist
......@@ -144,7 +144,7 @@ namespace spot
std::string
tgba_bdd_concrete::format_state(const state* state) const
{
const state_bdd* s = dynamic_cast<const state_bdd*>(state);
const state_bdd* s = down_cast<const state_bdd*>(state);
assert(s);
return bdd_format_set(get_dict(), s->as_bdd());
}
......
......@@ -88,7 +88,7 @@ namespace spot
int
state_explicit::compare(const spot::state* other) const
{
const state_explicit* o = dynamic_cast<const state_explicit*>(other);
const state_explicit* o = down_cast<const state_explicit*>(other);
assert(o);
// Do not simply return "o - this", it might not fit in an int.
if (o < this)
......@@ -222,7 +222,7 @@ namespace spot
const spot::state* global_state,
const tgba* global_automaton) const
{
const state_explicit* s = dynamic_cast<const state_explicit*>(state);
const state_explicit* s = down_cast<const state_explicit*>(state);
assert(s);
(void) global_state;
(void) global_automaton;
......@@ -233,7 +233,7 @@ namespace spot
bdd
tgba_explicit::compute_support_conditions(const spot::state* in) const
{
const state_explicit* s = dynamic_cast<const state_explicit*>(in);
const state_explicit* s = down_cast<const state_explicit*>(in);
assert(s);
const state_explicit::transitions_t& st = s->successors;
......@@ -247,7 +247,7 @@ namespace spot
bdd
tgba_explicit::compute_support_variables(const spot::state* in) const
{
const state_explicit* s = dynamic_cast<const state_explicit*>(in);
const state_explicit* s = down_cast<const state_explicit*>(in);
assert(s);
const state_explicit::transitions_t& st = s->successors;
......@@ -304,7 +304,7 @@ namespace spot
std::string
tgba_explicit_string::format_state(const spot::state* s) const
{
const state_explicit* se = dynamic_cast<const state_explicit*>(s);
const state_explicit* se = down_cast<const state_explicit*>(s);
assert(se);
sn_map::const_iterator i = state_name_map_.find(se);
assert(i != state_name_map_.end());
......@@ -332,7 +332,7 @@ namespace spot
std::string
tgba_explicit_formula::format_state(const spot::state* s) const
{
const state_explicit* se = dynamic_cast<const state_explicit*>(s);
const state_explicit* se = down_cast<const state_explicit*>(s);
assert(se);
sn_map::const_iterator i = state_name_map_.find(se);
assert(i != state_name_map_.end());
......@@ -357,7 +357,7 @@ namespace spot
std::string
tgba_explicit_number::format_state(const spot::state* s) const
{
const state_explicit* se = dynamic_cast<const state_explicit*>(s);
const state_explicit* se = down_cast<const state_explicit*>(s);
assert(se);
sn_map::const_iterator i = state_name_map_.find(se);
assert(i != state_name_map_.end());
......
......@@ -206,7 +206,7 @@ namespace spot
const label& get_label(const spot::state* s) const
{
const state_explicit* se = dynamic_cast<const state_explicit*>(s);
const state_explicit* se = down_cast<const state_explicit*>(s);
assert(se);
return get_label(se);
}
......
......@@ -137,7 +137,7 @@ namespace spot
state_kv_complement::compare(const state* o) const
{
const state_kv_complement* other =
dynamic_cast<const state_kv_complement*>(o);
down_cast<const state_kv_complement*>(o);
if (other == 0)
return 1;
......@@ -632,7 +632,7 @@ namespace spot
const tgba*) const
{
const state_kv_complement* state =
dynamic_cast<const state_kv_complement*>(local_state);
down_cast<const state_kv_complement*>(local_state);
assert(state);
return new tgba_kv_complement_succ_iterator(automaton_,
......@@ -650,7 +650,7 @@ namespace spot
tgba_kv_complement::format_state(const state* state) const
{
const state_kv_complement* s =
dynamic_cast<const state_kv_complement*>(state);
down_cast<const state_kv_complement*>(state);
assert(s);
std::ostringstream ss;
ss << "{ set: {" << std::endl;
......
......@@ -49,7 +49,7 @@ namespace spot
int
state_product::compare(const state* other) const
{
const state_product* o = dynamic_cast<const state_product*>(other);
const state_product* o = down_cast<const state_product*>(other);