# HG changeset patch # User Alpar Juttner # Date 1427974775 -7200 # Node ID 6516d9833517c413f89c4c5ffe6ea2e3e554f9d3 # Parent 85d6e26096efce41d4af8452e13c53a6d3d2d2a7# Parent d51126dc39fa518a6a872da52f1ab92b16f44459 Merge fixes #502, #503, #519, #520, #536 to branch 1.3 diff -r 85d6e26096ef -r 6516d9833517 CMakeLists.txt --- a/CMakeLists.txt Mon Jul 07 16:41:54 2014 +0200 +++ b/CMakeLists.txt Thu Apr 02 13:39:35 2015 +0200 @@ -1,6 +1,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -CMAKE_POLICY(SET CMP0048 OLD) +IF(POLICY CMP0048) + CMAKE_POLICY(SET CMP0048 OLD) +ENDIF(POLICY CMP0048) SET(PROJECT_NAME "LEMON") PROJECT(${PROJECT_NAME}) @@ -148,10 +150,13 @@ SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") ELSEIF(MSVC) # This part is unnecessary 'casue the same is set by the lemon/core.h. - # Still keep it as an example. - SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996") + # Still kept as an example. + + # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996") + # Suppressed warnings: # C4250: 'class1' : inherits 'class2::member' via dominance + # C4267: conversion from 'size_t' to 'type', possible loss of data # C4355: 'this' : used in base member initializer list # C4503: 'function' : decorated name length exceeded, name was truncated # C4800: 'type' : forcing value to bool 'true' or 'false' @@ -166,6 +171,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}") IF(MSVC) + SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "Flags used by the C++ compiler during maintainer builds." ) diff -r 85d6e26096ef -r 6516d9833517 lemon/arg_parser.h --- a/lemon/arg_parser.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/arg_parser.h Thu Apr 02 13:39:35 2015 +0200 @@ -26,6 +26,7 @@ #include #include #include +#include #include ///\ingroup misc diff -r 85d6e26096ef -r 6516d9833517 lemon/core.h --- a/lemon/core.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/core.h Thu Apr 02 13:39:35 2015 +0200 @@ -29,21 +29,16 @@ // Disable the following warnings when compiling with MSVC: // C4250: 'class1' : inherits 'class2::member' via dominance +// C4267: conversion from 'size_t' to 'type', possible loss of data // C4355: 'this' : used in base member initializer list // C4503: 'function' : decorated name length exceeded, name was truncated // C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) // C4996: 'function': was declared deprecated #ifdef _MSC_VER -#pragma warning( disable : 4250 4355 4503 4800 4996 ) +#pragma warning( disable : 4250 4267 4355 4503 4800 4996 ) #endif -#ifdef __GNUC__ -#define GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) -#endif - -#if GCC_VERSION >= 40800 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #endif diff -r 85d6e26096ef -r 6516d9833517 lemon/counter.h --- a/lemon/counter.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/counter.h Thu Apr 02 13:39:35 2015 +0200 @@ -22,6 +22,8 @@ #include #include +#include + ///\ingroup timecount ///\file ///\brief Tools for counting steps and events diff -r 85d6e26096ef -r 6516d9833517 lemon/elevator.h --- a/lemon/elevator.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/elevator.h Thu Apr 02 13:39:35 2015 +0200 @@ -167,7 +167,7 @@ ///Return the number of items on level \c l. int onLevel(int l) const { - return _first[l+1]-_first[l]; + return static_cast(_first[l+1]-_first[l]); } ///Return true if level \c l is empty. bool emptyLevel(int l) const @@ -177,12 +177,12 @@ ///Return the number of items above level \c l. int aboveLevel(int l) const { - return _first[_max_level+1]-_first[l+1]; + return static_cast(_first[_max_level+1]-_first[l+1]); } ///Return the number of active items on level \c l. int activesOnLevel(int l) const { - return _last_active[l]-_first[l]+1; + return static_cast(_last_active[l]-_first[l]+1); } ///Return true if there is no active item on level \c l. bool activeFree(int l) const diff -r 85d6e26096ef -r 6516d9833517 lemon/lp.h --- a/lemon/lp.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/lp.h Thu Apr 02 13:39:35 2015 +0200 @@ -22,15 +22,19 @@ #include -#ifdef LEMON_HAVE_GLPK +#if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK #include -#elif LEMON_HAVE_CPLEX +#endif +#if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX #include -#elif LEMON_HAVE_SOPLEX +#endif +#if LEMON_DEFAULT_LP == _LEMON_SOPLEX #include -#elif LEMON_HAVE_CLP +#endif +#if LEMON_DEFAULT_LP == _LEMON_CLP #include -#elif LEMON_HAVE_CBC +#endif +#if LEMON_DEFAULT_MIP == _LEMON_CBC #include #endif diff -r 85d6e26096ef -r 6516d9833517 lemon/radix_sort.h --- a/lemon/radix_sort.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/radix_sort.h Thu Apr 02 13:39:35 2015 +0200 @@ -328,7 +328,7 @@ typedef std::allocator Allocator; Allocator allocator; - int length = std::distance(first, last); + int length = static_cast(std::distance(first, last)); Key* buffer = allocator.allocate(2 * length); try { bool dir = true; diff -r 85d6e26096ef -r 6516d9833517 lemon/random.h --- a/lemon/random.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/random.h Thu Apr 02 13:39:35 2015 +0200 @@ -199,7 +199,7 @@ initState(init); - num = length > end - begin ? length : end - begin; + num = static_cast(length > end - begin ? length : end - begin); while (num--) { curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1)) + *it + cnt; @@ -213,7 +213,7 @@ --curr; } - num = length - 1; cnt = length - (curr - state) - 1; + num = length - 1; cnt = static_cast(length - (curr - state) - 1); while (num--) { curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2)) - cnt; diff -r 85d6e26096ef -r 6516d9833517 lemon/static_graph.h --- a/lemon/static_graph.h Mon Jul 07 16:41:54 2014 +0200 +++ b/lemon/static_graph.h Thu Apr 02 13:39:35 2015 +0200 @@ -203,7 +203,7 @@ built = true; node_num = n; - arc_num = std::distance(first, last); + arc_num = static_cast(std::distance(first, last)); node_first_out = new int[node_num + 1]; node_first_in = new int[node_num];