diff -r 096d83158d41 -r 81b47fc5c444 lemon/dfs.h --- a/lemon/dfs.h Fri Mar 02 17:56:22 2007 +0000 +++ b/lemon/dfs.h Fri Mar 02 18:04:28 2007 +0000 @@ -858,8 +858,8 @@ /// \param g is the initial value of \ref _g /// \param s is the initial value of \ref _source DfsWizardBase(const GR &g, Node s=INVALID) : - _g((void *)&g), _reached(0), _processed(0), _pred(0), - _dist(0), _source(s) {} + _g(reinterpret_cast(const_cast(&g))), + _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {} }; @@ -933,11 +933,15 @@ void run() { if(Base::_source==INVALID) throw UninitializedParameter(); - Dfs alg(*(Graph*)Base::_g); - if(Base::_reached) alg.reachedMap(*(ReachedMap*)Base::_reached); - if(Base::_processed) alg.processedMap(*(ProcessedMap*)Base::_processed); - if(Base::_pred) alg.predMap(*(PredMap*)Base::_pred); - if(Base::_dist) alg.distMap(*(DistMap*)Base::_dist); + Dfs alg(*reinterpret_cast(Base::_g)); + if(Base::_reached) + alg.reachedMap(*reinterpret_cast(Base::_reached)); + if(Base::_processed) + alg.processedMap(*reinterpret_cast(Base::_processed)); + if(Base::_pred) + alg.predMap(*reinterpret_cast(Base::_pred)); + if(Base::_dist) + alg.distMap(*reinterpret_cast(Base::_dist)); alg.run(Base::_source); } @@ -967,7 +971,7 @@ template DfsWizard > predMap(const T &t) { - Base::_pred=(void *)&t; + Base::_pred=reinterpret_cast(const_cast(&t)); return DfsWizard >(*this); } @@ -988,7 +992,7 @@ template DfsWizard > reachedMap(const T &t) { - Base::_pred=(void *)&t; + Base::_pred=reinterpret_cast(const_cast(&t)); return DfsWizard >(*this); } @@ -1009,7 +1013,7 @@ template DfsWizard > processedMap(const T &t) { - Base::_pred=(void *)&t; + Base::_pred=reinterpret_cast(const_cast(&t)); return DfsWizard >(*this); } @@ -1029,7 +1033,7 @@ template DfsWizard > distMap(const T &t) { - Base::_dist=(void *)&t; + Base::_dist=reinterpret_cast(const_cast(&t)); return DfsWizard >(*this); }