[Lemon-commits] Alpar Juttner: Fix gcc-4.3 compilation errors an...
Lemon HG
hg at lemon.cs.elte.hu
Sat Jun 21 13:09:20 CEST 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/716b220697a0
changeset: 184:716b220697a0
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Thu Mar 27 16:27:23 2008 +0100
description:
Fix gcc-4.3 compilation errors and warnings
diffstat:
6 files changed, 13 insertions(+), 12 deletions(-)
lemon/bits/bezier.h | 2 +-
lemon/bits/traits.h | 8 ++++----
lemon/dijkstra.h | 1 +
lemon/graph_to_eps.h | 5 +++--
lemon/list_graph.h | 6 +++---
test/test_tools.h | 3 +--
diffs (120 lines):
diff -r 0c6556a8e105 -r 716b220697a0 lemon/bits/bezier.h
--- a/lemon/bits/bezier.h Fri Jun 20 11:09:30 2008 +0100
+++ b/lemon/bits/bezier.h Thu Mar 27 16:27:23 2008 +0100
@@ -32,7 +32,7 @@
class BezierBase {
public:
- typedef Point<double> Point;
+ typedef lemon::dim2::Point<double> Point;
protected:
static Point conv(Point x,Point y,double t) {return (1-t)*x+t*y;}
};
diff -r 0c6556a8e105 -r 716b220697a0 lemon/bits/traits.h
--- a/lemon/bits/traits.h Fri Jun 20 11:09:30 2008 +0100
+++ b/lemon/bits/traits.h Thu Mar 27 16:27:23 2008 +0100
@@ -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 <typename Map>
@@ -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 <typename MatrixMap>
diff -r 0c6556a8e105 -r 716b220697a0 lemon/dijkstra.h
--- a/lemon/dijkstra.h Fri Jun 20 11:09:30 2008 +0100
+++ b/lemon/dijkstra.h Thu Mar 27 16:27:23 2008 +0100
@@ -23,6 +23,7 @@
///\file
///\brief Dijkstra algorithm.
+#include <limits>
#include <lemon/list_graph.h>
#include <lemon/bin_heap.h>
#include <lemon/bits/path_dump.h>
diff -r 0c6556a8e105 -r 716b220697a0 lemon/graph_to_eps.h
--- a/lemon/graph_to_eps.h Fri Jun 20 11:09:30 2008 +0100
+++ b/lemon/graph_to_eps.h Thu Mar 27 16:27:23 2008 +0100
@@ -1015,7 +1015,7 @@
}
else for(ArcIt e(g);e!=INVALID;++e)
if((!_undirected||g.source(e)<g.target(e))&&_arcWidths[e]>0
- &&g.source(e)!=g.target(e))
+ &&g.source(e)!=g.target(e)) {
if(_drawArrows) {
dim2::Point<double> 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 -r 0c6556a8e105 -r 716b220697a0 lemon/list_graph.h
--- a/lemon/list_graph.h Fri Jun 20 11:09:30 2008 +0100
+++ b/lemon/list_graph.h Thu Mar 27 16:27:23 2008 +0100
@@ -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 -r 0c6556a8e105 -r 716b220697a0 test/test_tools.h
--- a/test/test_tools.h Fri Jun 20 11:09:30 2008 +0100
+++ b/test/test_tools.h Thu Mar 27 16:27:23 2008 +0100
@@ -24,6 +24,7 @@
///\brief Some utilities to write test programs.
#include <iostream>
+#include <stdlib.h>
///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; \
More information about the Lemon-commits
mailing list