# HG changeset patch # User Alpar Juttner # Date 2009-01-22 16:15:51 # Node ID 2b6a20528f35d8eb5e321db359447dfb07668c6b # Parent 227f36959519c435c42e439705e5dfef2ffdd9e2 Backport [e6ae4999cf22] from main (Suppress or fix VS2008 warnings) (#208) diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,15 @@ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +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) + INCLUDE(FindDoxygen) INCLUDE(FindGhostscript) diff --git a/lemon/base.cc b/lemon/base.cc --- a/lemon/base.cc +++ b/lemon/base.cc @@ -23,7 +23,7 @@ #include namespace lemon { - float Tolerance::def_epsilon = 1e-4; + float Tolerance::def_epsilon = static_cast(1e-4); double Tolerance::def_epsilon = 1e-10; long double Tolerance::def_epsilon = 1e-14; 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 > CompMap; checkConcept, CompMap>(); - CompMap map1(DoubleMap(),ReadMap()); + CompMap map1 = CompMap(DoubleMap(),ReadMap()); CompMap map2 = composeMap(DoubleMap(), ReadMap()); SparseMap m1(false); m1[3.14] = true; @@ -183,7 +183,7 @@ { typedef CombineMap > CombMap; checkConcept, CombMap>(); - CombMap map1(DoubleMap(), DoubleMap()); + CombMap map1 = CombMap(DoubleMap(), DoubleMap()); CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus()); check(combineMap(constMap(), identityMap(), &binc)[B()] == 3, @@ -195,11 +195,11 @@ checkConcept, FunctorToMap >(); checkConcept, FunctorToMap >(); FunctorToMap map1; - FunctorToMap map2(F()); + FunctorToMap map2 = FunctorToMap(F()); B b = functorToMap(F())[A()]; checkConcept, MapToFunctor > >(); - MapToFunctor > map(ReadMap()); + MapToFunctor > map = MapToFunctor >(ReadMap()); check(functorToMap(&func)[A()] == 3, "Something is wrong with FunctorToMap");