Fix gcc-4.3 compilation errors and warnings
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 27 Mar 2008 16:27:23 +0100
changeset 184716b220697a0
parent 183 0c6556a8e105
child 185 33e45a9b868c
Fix gcc-4.3 compilation errors and warnings
lemon/bits/bezier.h
lemon/bits/traits.h
lemon/dijkstra.h
lemon/graph_to_eps.h
lemon/list_graph.h
test/test_tools.h
     1.1 --- a/lemon/bits/bezier.h	Fri Jun 20 11:09:30 2008 +0100
     1.2 +++ b/lemon/bits/bezier.h	Thu Mar 27 16:27:23 2008 +0100
     1.3 @@ -32,7 +32,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	Fri Jun 20 11:09:30 2008 +0100
     2.2 +++ b/lemon/bits/traits.h	Thu Mar 27 16:27:23 2008 +0100
     2.3 @@ -150,8 +150,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 @@ -178,8 +178,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/dijkstra.h	Fri Jun 20 11:09:30 2008 +0100
     3.2 +++ b/lemon/dijkstra.h	Thu Mar 27 16:27:23 2008 +0100
     3.3 @@ -23,6 +23,7 @@
     3.4  ///\file
     3.5  ///\brief Dijkstra algorithm.
     3.6  
     3.7 +#include <limits>
     3.8  #include <lemon/list_graph.h>
     3.9  #include <lemon/bin_heap.h>
    3.10  #include <lemon/bits/path_dump.h>
     4.1 --- a/lemon/graph_to_eps.h	Fri Jun 20 11:09:30 2008 +0100
     4.2 +++ b/lemon/graph_to_eps.h	Thu Mar 27 16:27:23 2008 +0100
     4.3 @@ -1015,7 +1015,7 @@
     4.4        }
     4.5        else for(ArcIt e(g);e!=INVALID;++e)
     4.6  	if((!_undirected||g.source(e)<g.target(e))&&_arcWidths[e]>0
     4.7 -	   &&g.source(e)!=g.target(e))
     4.8 +	   &&g.source(e)!=g.target(e)) {
     4.9  	  if(_drawArrows) {
    4.10  	    dim2::Point<double> d(mycoords[g.target(e)]-mycoords[g.source(e)]);
    4.11  	    double rn=_nodeSizes[g.target(e)]*_nodeScale;
    4.12 @@ -1035,7 +1035,7 @@
    4.13  	       << _arcColors[e].red() << ' '
    4.14  	       << _arcColors[e].green() << ' '
    4.15  	       << _arcColors[e].blue() << " arr\n";
    4.16 -	  }
    4.17 +	  } 
    4.18  	  else os << mycoords[g.source(e)].x << ' '
    4.19  		  << mycoords[g.source(e)].y << ' '
    4.20  		  << mycoords[g.target(e)].x << ' '
    4.21 @@ -1044,6 +1044,7 @@
    4.22  		  << _arcColors[e].green() << ' '
    4.23  		  << _arcColors[e].blue() << ' '
    4.24  		  << _arcWidths[e]*_arcWidthScale << " l\n";
    4.25 +	}
    4.26        os << "grestore\n";
    4.27      }
    4.28      if(_showNodes) {
     5.1 --- a/lemon/list_graph.h	Fri Jun 20 11:09:30 2008 +0100
     5.2 +++ b/lemon/list_graph.h	Thu Mar 27 16:27:23 2008 +0100
     5.3 @@ -115,7 +115,7 @@
     5.4        int n;
     5.5        for(n = first_node; 
     5.6  	  n!=-1 && nodes[n].first_in == -1; 
     5.7 -	  n = nodes[n].next);
     5.8 +	  n = nodes[n].next) {}
     5.9        arc.id = (n == -1) ? -1 : nodes[n].first_in;
    5.10      }
    5.11  
    5.12 @@ -125,8 +125,8 @@
    5.13        } else {
    5.14  	int n;
    5.15  	for(n = nodes[arcs[arc.id].target].next;
    5.16 -	  n!=-1 && nodes[n].first_in == -1; 
    5.17 -	  n = nodes[n].next);
    5.18 +	    n!=-1 && nodes[n].first_in == -1; 
    5.19 +	    n = nodes[n].next) {}
    5.20  	arc.id = (n == -1) ? -1 : nodes[n].first_in;
    5.21        }      
    5.22      }
     6.1 --- a/test/test_tools.h	Fri Jun 20 11:09:30 2008 +0100
     6.2 +++ b/test/test_tools.h	Thu Mar 27 16:27:23 2008 +0100
     6.3 @@ -24,6 +24,7 @@
     6.4  ///\brief Some utilities to write test programs.
     6.5  
     6.6  #include <iostream>
     6.7 +#include <stdlib.h>
     6.8  
     6.9  ///If \c rc is fail, writes an error message and exits.
    6.10  
    6.11 @@ -36,8 +37,6 @@
    6.12  ///\code check(0==1,"This is obviously false.");\endcode will
    6.13  ///print something like this (and then exits).
    6.14  ///\verbatim file_name.cc:123: error: This is obviously false. \endverbatim
    6.15 -///
    6.16 -///\todo It should be in \c assert.h
    6.17  #define check(rc, msg) \
    6.18    if(!(rc)) { \
    6.19      std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \