Backport [e6ae4999cf22] from main (Suppress or fix VS2008 warnings) (#208) 1.0
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 22 Jan 2009 15:15:51 +0000
branch1.0
changeset 5002b6a20528f35
parent 499 227f36959519
child 504 29cbdb01d5f0
Backport [e6ae4999cf22] from main (Suppress or fix VS2008 warnings) (#208)
CMakeLists.txt
lemon/base.cc
test/maps_test.cc
     1.1 --- a/CMakeLists.txt	Wed Jan 21 18:17:28 2009 +0000
     1.2 +++ b/CMakeLists.txt	Thu Jan 22 15:15:51 2009 +0000
     1.3 @@ -7,6 +7,15 @@
     1.4  
     1.5  SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
     1.6  
     1.7 +IF(MSVC)
     1.8 +  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
     1.9 +# Suppressed warnings:
    1.10 +# C4250: 'class1' : inherits 'class2::member' via dominance
    1.11 +# C4355: 'this' : used in base member initializer list
    1.12 +# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    1.13 +# C4996: 'function': was declared deprecated
    1.14 +ENDIF(MSVC)
    1.15 +
    1.16  INCLUDE(FindDoxygen)
    1.17  INCLUDE(FindGhostscript)
    1.18  
     2.1 --- a/lemon/base.cc	Wed Jan 21 18:17:28 2009 +0000
     2.2 +++ b/lemon/base.cc	Thu Jan 22 15:15:51 2009 +0000
     2.3 @@ -23,7 +23,7 @@
     2.4  #include<lemon/core.h>
     2.5  namespace lemon {
     2.6  
     2.7 -  float Tolerance<float>::def_epsilon = 1e-4;
     2.8 +  float Tolerance<float>::def_epsilon = static_cast<float>(1e-4);
     2.9    double Tolerance<double>::def_epsilon = 1e-10;
    2.10    long double Tolerance<long double>::def_epsilon = 1e-14;
    2.11  
     3.1 --- a/test/maps_test.cc	Wed Jan 21 18:17:28 2009 +0000
     3.2 +++ b/test/maps_test.cc	Thu Jan 22 15:15:51 2009 +0000
     3.3 @@ -170,7 +170,7 @@
     3.4    {
     3.5      typedef ComposeMap<DoubleMap, ReadMap<B,A> > CompMap;
     3.6      checkConcept<ReadMap<B,double>, CompMap>();
     3.7 -    CompMap map1(DoubleMap(),ReadMap<B,A>());
     3.8 +    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     3.9      CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
    3.10  
    3.11      SparseMap<double, bool> m1(false); m1[3.14] = true;
    3.12 @@ -183,7 +183,7 @@
    3.13    {
    3.14      typedef CombineMap<DoubleMap, DoubleMap, std::plus<double> > CombMap;
    3.15      checkConcept<ReadMap<A,double>, CombMap>();
    3.16 -    CombMap map1(DoubleMap(), DoubleMap());
    3.17 +    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
    3.18      CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
    3.19  
    3.20      check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
    3.21 @@ -195,11 +195,11 @@
    3.22      checkConcept<ReadMap<A,B>, FunctorToMap<F,A,B> >();
    3.23      checkConcept<ReadMap<A,B>, FunctorToMap<F> >();
    3.24      FunctorToMap<F> map1;
    3.25 -    FunctorToMap<F> map2(F());
    3.26 +    FunctorToMap<F> map2 = FunctorToMap<F>(F());
    3.27      B b = functorToMap(F())[A()];
    3.28  
    3.29      checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    3.30 -    MapToFunctor<ReadMap<A,B> > map(ReadMap<A,B>());
    3.31 +    MapToFunctor<ReadMap<A,B> > map = MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
    3.32  
    3.33      check(functorToMap(&func)[A()] == 3,
    3.34            "Something is wrong with FunctorToMap");