COIN-OR::LEMON - Graph Library

Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/dfs.h


Ignore:
Timestamp:
03/02/07 19:04:28 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
Message:

Hard Warning checking

  • based on the remark of the ZIB user
  • we do not use -Winline
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dfs.h

    r2376 r2386  
    859859    /// \param s is the initial value of  \ref _source
    860860    DfsWizardBase(const GR &g, Node s=INVALID) :
    861       _g((void *)&g), _reached(0), _processed(0), _pred(0),
    862       _dist(0), _source(s) {}
     861      _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
     862      _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {}
    863863
    864864  };
     
    934934    {
    935935      if(Base::_source==INVALID) throw UninitializedParameter();
    936       Dfs<Graph,TR> alg(*(Graph*)Base::_g);
    937       if(Base::_reached) alg.reachedMap(*(ReachedMap*)Base::_reached);
    938       if(Base::_processed) alg.processedMap(*(ProcessedMap*)Base::_processed);
    939       if(Base::_pred) alg.predMap(*(PredMap*)Base::_pred);
    940       if(Base::_dist) alg.distMap(*(DistMap*)Base::_dist);
     936      Dfs<Graph,TR> alg(*reinterpret_cast<const Graph*>(Base::_g));
     937      if(Base::_reached)
     938        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
     939      if(Base::_processed)
     940        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
     941      if(Base::_pred)
     942        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
     943      if(Base::_dist)
     944        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
    941945      alg.run(Base::_source);
    942946    }
     
    968972    DfsWizard<DefPredMapBase<T> > predMap(const T &t)
    969973    {
    970       Base::_pred=(void *)&t;
     974      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    971975      return DfsWizard<DefPredMapBase<T> >(*this);
    972976    }
     
    989993    DfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
    990994    {
    991       Base::_pred=(void *)&t;
     995      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    992996      return DfsWizard<DefReachedMapBase<T> >(*this);
    993997    }
     
    10101014    DfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
    10111015    {
    1012       Base::_pred=(void *)&t;
     1016      Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
    10131017      return DfsWizard<DefProcessedMapBase<T> >(*this);
    10141018    }
     
    10301034    DfsWizard<DefDistMapBase<T> > distMap(const T &t)
    10311035    {
    1032       Base::_dist=(void *)&t;
     1036      Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
    10331037      return DfsWizard<DefDistMapBase<T> >(*this);
    10341038    }
Note: See TracChangeset for help on using the changeset viewer.