G++-4.3 compatibility changes
authordeba
Fri, 19 Sep 2008 15:14:41 +0000
changeset 26186aa6fcaeaea5
parent 2617 5222a3c470ed
child 2619 30fb4d68b0e8
G++-4.3 compatibility changes
lemon/bits/bezier.h
lemon/bits/traits.h
lemon/circulation.h
lemon/dijkstra.h
lemon/edge_set.h
lemon/graph_to_eps.h
lemon/lemon_reader.h
lemon/list_graph.h
lemon/lp_base.h
lemon/min_mean_cycle.h
lemon/preflow.h
lemon/random.h
test/bipartite_matching_test.cc
tools/lgf-gen.cc
     1.1 --- a/lemon/bits/bezier.h	Tue Jul 22 11:29:57 2008 +0000
     1.2 +++ b/lemon/bits/bezier.h	Fri Sep 19 15:14:41 2008 +0000
     1.3 @@ -34,7 +34,7 @@
     1.4  
     1.5  class BezierBase {
     1.6  public:
     1.7 -  typedef Point<double> Point;
     1.8 +  typedef lemon::dim2::Point<double> Point;
     1.9  protected:
    1.10    static Point conv(Point x,Point y,double t) {return (1-t)*x+t*y;}
    1.11  };
     2.1 --- a/lemon/bits/traits.h	Tue Jul 22 11:29:57 2008 +0000
     2.2 +++ b/lemon/bits/traits.h	Fri Sep 19 15:14:41 2008 +0000
     2.3 @@ -224,8 +224,8 @@
     2.4      typedef typename Map::Key Key;
     2.5      typedef typename Map::Value Value;
     2.6  
     2.7 -    typedef const Value ConstReturnValue;
     2.8 -    typedef const Value ReturnValue;
     2.9 +    typedef Value ConstReturnValue;
    2.10 +    typedef Value ReturnValue;
    2.11    };
    2.12  
    2.13    template <typename Map>
    2.14 @@ -252,8 +252,8 @@
    2.15      typedef typename MatrixMap::SecondKey SecondKey;
    2.16      typedef typename MatrixMap::Value Value;
    2.17  
    2.18 -    typedef const Value ConstReturnValue;
    2.19 -    typedef const Value ReturnValue;
    2.20 +    typedef Value ConstReturnValue;
    2.21 +    typedef Value ReturnValue;
    2.22    };
    2.23  
    2.24    template <typename MatrixMap>
     3.1 --- a/lemon/circulation.h	Tue Jul 22 11:29:57 2008 +0000
     3.2 +++ b/lemon/circulation.h	Fri Sep 19 15:14:41 2008 +0000
     3.3 @@ -88,7 +88,7 @@
     3.4      ///
     3.5      /// \sa Elevator
     3.6      /// \sa LinkedElevator
     3.7 -    typedef Elevator<Graph, typename Graph::Node> Elevator;
     3.8 +    typedef lemon::Elevator<Graph, typename Graph::Node> Elevator;
     3.9      
    3.10      /// \brief Instantiates an Elevator.
    3.11      ///
    3.12 @@ -102,7 +102,7 @@
    3.13      /// \brief The tolerance used by the algorithm
    3.14      ///
    3.15      /// The tolerance used by the algorithm to handle inexact computation.
    3.16 -    typedef Tolerance<Value> Tolerance;
    3.17 +    typedef lemon::Tolerance<Value> Tolerance;
    3.18  
    3.19    };
    3.20    
     4.1 --- a/lemon/dijkstra.h	Tue Jul 22 11:29:57 2008 +0000
     4.2 +++ b/lemon/dijkstra.h	Fri Sep 19 15:14:41 2008 +0000
     4.3 @@ -31,6 +31,8 @@
     4.4  #include <lemon/error.h>
     4.5  #include <lemon/maps.h>
     4.6  
     4.7 +#include <limits>
     4.8 +
     4.9  
    4.10  namespace lemon {
    4.11  
     5.1 --- a/lemon/edge_set.h	Tue Jul 22 11:29:57 2008 +0000
     5.2 +++ b/lemon/edge_set.h	Fri Sep 19 15:14:41 2008 +0000
     5.3 @@ -154,7 +154,7 @@
     5.4      void first(Edge& edge) const {
     5.5        Node node;
     5.6        for (first(node); node != INVALID && (*nodes)[node].first_in == -1; 
     5.7 -	   next(node));
     5.8 +	   next(node)) { }
     5.9        edge.id = (node == INVALID) ? -1 : (*nodes)[node].first_in;
    5.10      }
    5.11  
    5.12 @@ -164,7 +164,7 @@
    5.13        } else {
    5.14  	Node node = edges[edge.id].target;
    5.15  	for (next(node); node != INVALID && (*nodes)[node].first_in == -1; 
    5.16 -	     next(node));
    5.17 +	     next(node)) { }
    5.18  	edge.id = (node == INVALID) ? -1 : (*nodes)[node].first_in;
    5.19        }      
    5.20      }
     6.1 --- a/lemon/graph_to_eps.h	Tue Jul 22 11:29:57 2008 +0000
     6.2 +++ b/lemon/graph_to_eps.h	Fri Sep 19 15:14:41 2008 +0000
     6.3 @@ -1001,7 +1001,7 @@
     6.4        }
     6.5        else for(EdgeIt e(g);e!=INVALID;++e)
     6.6  	if((!_undirected||g.source(e)<g.target(e))&&_edgeWidths[e]>0
     6.7 -	   &&g.source(e)!=g.target(e))
     6.8 +	   &&g.source(e)!=g.target(e)) {
     6.9  	  if(_drawArrows) {
    6.10  	    dim2::Point<double> d(mycoords[g.target(e)]-mycoords[g.source(e)]);
    6.11  	    double rn=_nodeSizes[g.target(e)]*_nodeScale;
    6.12 @@ -1030,6 +1030,7 @@
    6.13  		  << _edgeColors[e].green() << ' '
    6.14  		  << _edgeColors[e].blue() << ' '
    6.15  		  << _edgeWidths[e]*_edgeWidthScale << " l\n";
    6.16 +	}
    6.17        os << "grestore\n";
    6.18      }
    6.19      if(_showNodes) {
     7.1 --- a/lemon/lemon_reader.h	Tue Jul 22 11:29:57 2008 +0000
     7.2 +++ b/lemon/lemon_reader.h	Fri Sep 19 15:14:41 2008 +0000
     7.3 @@ -3472,7 +3472,7 @@
     7.4        while (ls >> name) {
     7.5  	maps.push_back(name);
     7.6        }
     7.7 -      while (getline(is, line));
     7.8 +      while (getline(is, line)) { }
     7.9      }
    7.10  
    7.11      void readItemNames(std::istream& is, std::vector<std::string>& maps) {
     8.1 --- a/lemon/list_graph.h	Tue Jul 22 11:29:57 2008 +0000
     8.2 +++ b/lemon/list_graph.h	Fri Sep 19 15:14:41 2008 +0000
     8.3 @@ -118,7 +118,7 @@
     8.4        int n;
     8.5        for(n = first_node; 
     8.6  	  n!=-1 && nodes[n].first_in == -1; 
     8.7 -	  n = nodes[n].next);
     8.8 +	  n = nodes[n].next) { }
     8.9        e.id = (n == -1) ? -1 : nodes[n].first_in;
    8.10      }
    8.11  
    8.12 @@ -128,8 +128,8 @@
    8.13        } else {
    8.14  	int n;
    8.15  	for(n = nodes[edges[edge.id].target].next;
    8.16 -	  n!=-1 && nodes[n].first_in == -1; 
    8.17 -	  n = nodes[n].next);
    8.18 +	    n!=-1 && nodes[n].first_in == -1; 
    8.19 +	    n = nodes[n].next) { }
    8.20  	edge.id = (n == -1) ? -1 : nodes[n].first_in;
    8.21        }      
    8.22      }
     9.1 --- a/lemon/lp_base.h	Tue Jul 22 11:29:57 2008 +0000
     9.2 +++ b/lemon/lp_base.h	Fri Sep 19 15:14:41 2008 +0000
     9.3 @@ -43,9 +43,9 @@
     9.4    bool isFinite(T value)
     9.5    {
     9.6      typedef std::numeric_limits<T> Lim;
     9.7 -    if (Lim::has_infinity && (value == Lim::infinity() || value ==
     9.8 -          -Lim::infinity()) ||
     9.9 -        (Lim::has_quiet_NaN || Lim::has_signaling_NaN) && value != value)
    9.10 +    if ((Lim::has_infinity && (value == Lim::infinity() || value ==
    9.11 +			       -Lim::infinity())) ||
    9.12 +        ((Lim::has_quiet_NaN || Lim::has_signaling_NaN) && value != value))
    9.13      {
    9.14        return false;
    9.15      }
    10.1 --- a/lemon/min_mean_cycle.h	Tue Jul 22 11:29:57 2008 +0000
    10.2 +++ b/lemon/min_mean_cycle.h	Fri Sep 19 15:14:41 2008 +0000
    10.3 @@ -55,7 +55,7 @@
    10.4      GRAPH_TYPEDEFS(typename Graph);
    10.5  
    10.6      typedef typename LengthMap::Value Length;
    10.7 -    typedef Path<Graph> Path;
    10.8 +    typedef lemon::Path<Graph> Path;
    10.9  
   10.10    private:
   10.11  
    11.1 --- a/lemon/preflow.h	Tue Jul 22 11:29:57 2008 +0000
    11.2 +++ b/lemon/preflow.h	Fri Sep 19 15:14:41 2008 +0000
    11.3 @@ -86,7 +86,7 @@
    11.4      /// \brief The tolerance used by the algorithm
    11.5      ///
    11.6      /// The tolerance used by the algorithm to handle inexact computation.
    11.7 -    typedef Tolerance<Value> Tolerance;
    11.8 +    typedef lemon::Tolerance<Value> Tolerance;
    11.9  
   11.10    };
   11.11    
    12.1 --- a/lemon/random.h	Tue Jul 22 11:29:57 2008 +0000
    12.2 +++ b/lemon/random.h	Fri Sep 19 15:14:41 2008 +0000
    12.3 @@ -67,6 +67,7 @@
    12.4  #include <vector>
    12.5  
    12.6  #include <ctime>
    12.7 +#include <limits>
    12.8  
    12.9  #include <lemon/math.h>
   12.10  #include <lemon/dim2.h>
    13.1 --- a/test/bipartite_matching_test.cc	Tue Jul 22 11:29:57 2008 +0000
    13.2 +++ b/test/bipartite_matching_test.cc	Fri Sep 19 15:14:41 2008 +0000
    13.3 @@ -195,7 +195,7 @@
    13.4      MaxBipartiteMatching<Graph> bpmatch(graph);
    13.5  
    13.6      bpmatch.greedyInit();
    13.7 -    while (bpmatch.simpleAugment());
    13.8 +    while (bpmatch.simpleAugment()) { }
    13.9      
   13.10      Graph::UEdgeMap<bool> mm(graph);
   13.11      Graph::NodeMap<bool> cs(graph);
    14.1 --- a/tools/lgf-gen.cc	Tue Jul 22 11:29:57 2008 +0000
    14.2 +++ b/tools/lgf-gen.cc	Fri Sep 19 15:14:41 2008 +0000
    14.3 @@ -120,7 +120,7 @@
    14.4    Node v2=v;
    14.5    do {
    14.6      Node n;
    14.7 -    for(IncEdgeIt e(g,v2);(n=g.runningNode(e))==u2;++e);
    14.8 +    for(IncEdgeIt e(g,v2);(n=g.runningNode(e))==u2;++e) { }
    14.9      u2=v2;
   14.10      v2=n;
   14.11      if(luv+std::sqrt((coords[v2]-coords[u2]).normSquare())-EPSILON>