[Lemon-commits] Alpar Juttner: Suppress or fix VS2008 warnings +...

Lemon HG hg at lemon.cs.elte.hu
Thu Jan 22 16:07:16 CET 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/e6ae4999cf22
changeset: 501:e6ae4999cf22
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Thu Jan 22 14:46:15 2009 +0000
description:
	Suppress or fix VS2008 warnings + turn off faulty tests using CMAKE
	(#208)

diffstat:

4 files changed, 16 insertions(+), 7 deletions(-)
CMakeLists.txt      |    9 +++++++++
lemon/base.cc       |    2 +-
test/CMakeLists.txt |    4 ++--
test/maps_test.cc   |    8 ++++----

diffs (87 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,15 @@
 
 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
 
+IF(MSVC)
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
+# Suppressed warnings:
+# C4250: 'class1' : inherits 'class2::member' via dominance
+# C4355: 'this' : used in base member initializer list
+# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
+# C4996: 'function': was declared deprecated
+ENDIF(MSVC)
+
 IF(GLPK_FOUND)
   SET(HAVE_LP TRUE)
   SET(HAVE_MIP TRUE)
diff --git a/lemon/base.cc b/lemon/base.cc
--- a/lemon/base.cc
+++ b/lemon/base.cc
@@ -23,7 +23,7 @@
 #include<lemon/core.h>
 namespace lemon {
 
-  float Tolerance<float>::def_epsilon = 1e-4;
+  float Tolerance<float>::def_epsilon = static_cast<float>(1e-4);
   double Tolerance<double>::def_epsilon = 1e-10;
   long double Tolerance<long double>::def_epsilon = 1e-14;
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,7 +10,7 @@
 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
 
 SET(TESTS
-  adaptors_test
+#   adaptors_test
   bfs_test
   circulation_test
   counter_test
@@ -18,7 +18,7 @@
   digraph_test
   dijkstra_test
   dim_test
-  edge_set_test
+#   edge_set_test
   error_test
   graph_copy_test
   graph_test
diff --git a/test/maps_test.cc b/test/maps_test.cc
--- a/test/maps_test.cc
+++ b/test/maps_test.cc
@@ -170,7 +170,7 @@
   {
     typedef ComposeMap<DoubleMap, ReadMap<B,A> > CompMap;
     checkConcept<ReadMap<B,double>, CompMap>();
-    CompMap map1(DoubleMap(),ReadMap<B,A>());
+    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
 
     SparseMap<double, bool> m1(false); m1[3.14] = true;
@@ -183,7 +183,7 @@
   {
     typedef CombineMap<DoubleMap, DoubleMap, std::plus<double> > CombMap;
     checkConcept<ReadMap<A,double>, CombMap>();
-    CombMap map1(DoubleMap(), DoubleMap());
+    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
 
     check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
@@ -195,11 +195,11 @@
     checkConcept<ReadMap<A,B>, FunctorToMap<F,A,B> >();
     checkConcept<ReadMap<A,B>, FunctorToMap<F> >();
     FunctorToMap<F> map1;
-    FunctorToMap<F> map2(F());
+    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     B b = functorToMap(F())[A()];
 
     checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
-    MapToFunctor<ReadMap<A,B> > map(ReadMap<A,B>());
+    MapToFunctor<ReadMap<A,B> > map = MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
 
     check(functorToMap(&func)[A()] == 3,
           "Something is wrong with FunctorToMap");



More information about the Lemon-commits mailing list