Merge fixes #502, #503, #519, #520, #536 to branch 1.3 1.3
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 02 Apr 2015 13:39:35 +0200
branch1.3
changeset 13296516d9833517
parent 1321 85d6e26096ef
parent 1328 d51126dc39fa
child 1332 f28af6829e54
Merge fixes #502, #503, #519, #520, #536 to branch 1.3
     1.1 --- a/CMakeLists.txt	Mon Jul 07 16:41:54 2014 +0200
     1.2 +++ b/CMakeLists.txt	Thu Apr 02 13:39:35 2015 +0200
     1.3 @@ -1,6 +1,8 @@
     1.4  CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
     1.5  
     1.6 -CMAKE_POLICY(SET CMP0048 OLD)
     1.7 +IF(POLICY CMP0048) 
     1.8 +  CMAKE_POLICY(SET CMP0048 OLD) 
     1.9 +ENDIF(POLICY CMP0048)
    1.10  
    1.11  SET(PROJECT_NAME "LEMON")
    1.12  PROJECT(${PROJECT_NAME})
    1.13 @@ -148,10 +150,13 @@
    1.14      SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
    1.15    ELSEIF(MSVC)
    1.16      # This part is unnecessary 'casue the same is set by the lemon/core.h.
    1.17 -    # Still keep it as an example.
    1.18 -    SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
    1.19 +    # Still kept as an example.
    1.20 +
    1.21 +    # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
    1.22 +
    1.23      # Suppressed warnings:
    1.24      # C4250: 'class1' : inherits 'class2::member' via dominance
    1.25 +    # C4267: conversion from 'size_t' to 'type', possible loss of data
    1.26      # C4355: 'this' : used in base member initializer list
    1.27      # C4503: 'function' : decorated name length exceeded, name was truncated
    1.28      # C4800: 'type' : forcing value to bool 'true' or 'false'
    1.29 @@ -166,6 +171,7 @@
    1.30  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
    1.31  
    1.32  IF(MSVC)
    1.33 +  SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
    1.34    SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    1.35      "Flags used by the C++ compiler during maintainer builds."
    1.36      )
     2.1 --- a/lemon/arg_parser.h	Mon Jul 07 16:41:54 2014 +0200
     2.2 +++ b/lemon/arg_parser.h	Thu Apr 02 13:39:35 2015 +0200
     2.3 @@ -26,6 +26,7 @@
     2.4  #include <iostream>
     2.5  #include <sstream>
     2.6  #include <algorithm>
     2.7 +#include <lemon/core.h>
     2.8  #include <lemon/assert.h>
     2.9  
    2.10  ///\ingroup misc
     3.1 --- a/lemon/core.h	Mon Jul 07 16:41:54 2014 +0200
     3.2 +++ b/lemon/core.h	Thu Apr 02 13:39:35 2015 +0200
     3.3 @@ -29,21 +29,16 @@
     3.4  
     3.5  // Disable the following warnings when compiling with MSVC:
     3.6  // C4250: 'class1' : inherits 'class2::member' via dominance
     3.7 +// C4267: conversion from 'size_t' to 'type', possible loss of data
     3.8  // C4355: 'this' : used in base member initializer list
     3.9  // C4503: 'function' : decorated name length exceeded, name was truncated
    3.10  // C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    3.11  // C4996: 'function': was declared deprecated
    3.12  #ifdef _MSC_VER
    3.13 -#pragma warning( disable : 4250 4355 4503 4800 4996 )
    3.14 +#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
    3.15  #endif
    3.16  
    3.17 -#ifdef __GNUC__
    3.18 -#define GCC_VERSION (__GNUC__ * 10000                   \
    3.19 -                     + __GNUC_MINOR__ * 100             \
    3.20 -                     + __GNUC_PATCHLEVEL__)
    3.21 -#endif
    3.22 -
    3.23 -#if GCC_VERSION >= 40800
    3.24 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
    3.25  // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
    3.26  #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    3.27  #endif
     4.1 --- a/lemon/counter.h	Mon Jul 07 16:41:54 2014 +0200
     4.2 +++ b/lemon/counter.h	Thu Apr 02 13:39:35 2015 +0200
     4.3 @@ -22,6 +22,8 @@
     4.4  #include <string>
     4.5  #include <iostream>
     4.6  
     4.7 +#include <lemon/core.h>
     4.8 +
     4.9  ///\ingroup timecount
    4.10  ///\file
    4.11  ///\brief Tools for counting steps and events
     5.1 --- a/lemon/elevator.h	Mon Jul 07 16:41:54 2014 +0200
     5.2 +++ b/lemon/elevator.h	Thu Apr 02 13:39:35 2015 +0200
     5.3 @@ -167,7 +167,7 @@
     5.4      ///Return the number of items on level \c l.
     5.5      int onLevel(int l) const
     5.6      {
     5.7 -      return _first[l+1]-_first[l];
     5.8 +      return static_cast<int>(_first[l+1]-_first[l]);
     5.9      }
    5.10      ///Return true if level \c l is empty.
    5.11      bool emptyLevel(int l) const
    5.12 @@ -177,12 +177,12 @@
    5.13      ///Return the number of items above level \c l.
    5.14      int aboveLevel(int l) const
    5.15      {
    5.16 -      return _first[_max_level+1]-_first[l+1];
    5.17 +      return static_cast<int>(_first[_max_level+1]-_first[l+1]);
    5.18      }
    5.19      ///Return the number of active items on level \c l.
    5.20      int activesOnLevel(int l) const
    5.21      {
    5.22 -      return _last_active[l]-_first[l]+1;
    5.23 +      return static_cast<int>(_last_active[l]-_first[l]+1);
    5.24      }
    5.25      ///Return true if there is no active item on level \c l.
    5.26      bool activeFree(int l) const
     6.1 --- a/lemon/lp.h	Mon Jul 07 16:41:54 2014 +0200
     6.2 +++ b/lemon/lp.h	Thu Apr 02 13:39:35 2015 +0200
     6.3 @@ -22,15 +22,19 @@
     6.4  #include<lemon/config.h>
     6.5  
     6.6  
     6.7 -#ifdef LEMON_HAVE_GLPK
     6.8 +#if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK
     6.9  #include <lemon/glpk.h>
    6.10 -#elif LEMON_HAVE_CPLEX
    6.11 +#endif
    6.12 +#if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX 
    6.13  #include <lemon/cplex.h>
    6.14 -#elif LEMON_HAVE_SOPLEX
    6.15 +#endif
    6.16 +#if LEMON_DEFAULT_LP == _LEMON_SOPLEX
    6.17  #include <lemon/soplex.h>
    6.18 -#elif LEMON_HAVE_CLP
    6.19 +#endif
    6.20 +#if LEMON_DEFAULT_LP == _LEMON_CLP
    6.21  #include <lemon/clp.h>
    6.22 -#elif LEMON_HAVE_CBC
    6.23 +#endif
    6.24 +#if LEMON_DEFAULT_MIP == _LEMON_CBC
    6.25  #include <lemon/cbc.h>
    6.26  #endif
    6.27  
     7.1 --- a/lemon/radix_sort.h	Mon Jul 07 16:41:54 2014 +0200
     7.2 +++ b/lemon/radix_sort.h	Thu Apr 02 13:39:35 2015 +0200
     7.3 @@ -328,7 +328,7 @@
     7.4        typedef std::allocator<Key> Allocator;
     7.5        Allocator allocator;
     7.6  
     7.7 -      int length = std::distance(first, last);
     7.8 +      int length = static_cast<int>(std::distance(first, last));
     7.9        Key* buffer = allocator.allocate(2 * length);
    7.10        try {
    7.11          bool dir = true;
     8.1 --- a/lemon/random.h	Mon Jul 07 16:41:54 2014 +0200
     8.2 +++ b/lemon/random.h	Thu Apr 02 13:39:35 2015 +0200
     8.3 @@ -199,7 +199,7 @@
     8.4  
     8.5          initState(init);
     8.6  
     8.7 -        num = length > end - begin ? length : end - begin;
     8.8 +        num = static_cast<int>(length > end - begin ? length : end - begin);
     8.9          while (num--) {
    8.10            curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1))
    8.11              + *it + cnt;
    8.12 @@ -213,7 +213,7 @@
    8.13            --curr;
    8.14          }
    8.15  
    8.16 -        num = length - 1; cnt = length - (curr - state) - 1;
    8.17 +        num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1);
    8.18          while (num--) {
    8.19            curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2))
    8.20              - cnt;
     9.1 --- a/lemon/static_graph.h	Mon Jul 07 16:41:54 2014 +0200
     9.2 +++ b/lemon/static_graph.h	Thu Apr 02 13:39:35 2015 +0200
     9.3 @@ -203,7 +203,7 @@
     9.4        built = true;
     9.5  
     9.6        node_num = n;
     9.7 -      arc_num = std::distance(first, last);
     9.8 +      arc_num = static_cast<int>(std::distance(first, last));
     9.9  
    9.10        node_first_out = new int[node_num + 1];
    9.11        node_first_in = new int[node_num];