# HG changeset patch # User Alpar Juttner # Date 2008-03-27 16:27:23 # Node ID 716b220697a00d88556c5c9138c8bad2ecc40def # Parent 0c6556a8e1053e483f829338b701d57536183886 Fix gcc-4.3 compilation errors and warnings diff --git a/lemon/bits/bezier.h b/lemon/bits/bezier.h --- a/lemon/bits/bezier.h +++ b/lemon/bits/bezier.h @@ -32,7 +32,7 @@ class BezierBase { public: - typedef Point Point; + typedef lemon::dim2::Point Point; protected: static Point conv(Point x,Point y,double t) {return (1-t)*x+t*y;} }; diff --git a/lemon/bits/traits.h b/lemon/bits/traits.h --- a/lemon/bits/traits.h +++ b/lemon/bits/traits.h @@ -150,8 +150,8 @@ typedef typename Map::Key Key; typedef typename Map::Value Value; - typedef const Value ConstReturnValue; - typedef const Value ReturnValue; + typedef Value ConstReturnValue; + typedef Value ReturnValue; }; template @@ -178,8 +178,8 @@ typedef typename MatrixMap::SecondKey SecondKey; typedef typename MatrixMap::Value Value; - typedef const Value ConstReturnValue; - typedef const Value ReturnValue; + typedef Value ConstReturnValue; + typedef Value ReturnValue; }; template diff --git a/lemon/dijkstra.h b/lemon/dijkstra.h --- a/lemon/dijkstra.h +++ b/lemon/dijkstra.h @@ -23,6 +23,7 @@ ///\file ///\brief Dijkstra algorithm. +#include #include #include #include diff --git a/lemon/graph_to_eps.h b/lemon/graph_to_eps.h --- a/lemon/graph_to_eps.h +++ b/lemon/graph_to_eps.h @@ -1015,7 +1015,7 @@ } else for(ArcIt e(g);e!=INVALID;++e) if((!_undirected||g.source(e)0 - &&g.source(e)!=g.target(e)) + &&g.source(e)!=g.target(e)) { if(_drawArrows) { dim2::Point d(mycoords[g.target(e)]-mycoords[g.source(e)]); double rn=_nodeSizes[g.target(e)]*_nodeScale; @@ -1035,7 +1035,7 @@ << _arcColors[e].red() << ' ' << _arcColors[e].green() << ' ' << _arcColors[e].blue() << " arr\n"; - } + } else os << mycoords[g.source(e)].x << ' ' << mycoords[g.source(e)].y << ' ' << mycoords[g.target(e)].x << ' ' @@ -1044,6 +1044,7 @@ << _arcColors[e].green() << ' ' << _arcColors[e].blue() << ' ' << _arcWidths[e]*_arcWidthScale << " l\n"; + } os << "grestore\n"; } if(_showNodes) { diff --git a/lemon/list_graph.h b/lemon/list_graph.h --- a/lemon/list_graph.h +++ b/lemon/list_graph.h @@ -115,7 +115,7 @@ int n; for(n = first_node; n!=-1 && nodes[n].first_in == -1; - n = nodes[n].next); + n = nodes[n].next) {} arc.id = (n == -1) ? -1 : nodes[n].first_in; } @@ -125,8 +125,8 @@ } else { int n; for(n = nodes[arcs[arc.id].target].next; - n!=-1 && nodes[n].first_in == -1; - n = nodes[n].next); + n!=-1 && nodes[n].first_in == -1; + n = nodes[n].next) {} arc.id = (n == -1) ? -1 : nodes[n].first_in; } } diff --git a/test/test_tools.h b/test/test_tools.h --- a/test/test_tools.h +++ b/test/test_tools.h @@ -24,6 +24,7 @@ ///\brief Some utilities to write test programs. #include +#include ///If \c rc is fail, writes an error message and exits. @@ -36,8 +37,6 @@ ///\code check(0==1,"This is obviously false.");\endcode will ///print something like this (and then exits). ///\verbatim file_name.cc:123: error: This is obviously false. \endverbatim -/// -///\todo It should be in \c assert.h #define check(rc, msg) \ if(!(rc)) { \ std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \