You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(63) |
Nov
(40) |
Dec
(26) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(7) |
Mar
(11) |
Apr
(15) |
May
|
Jun
(13) |
Jul
(2) |
Aug
(16) |
Sep
(8) |
Oct
(1) |
Nov
|
Dec
(13) |
2011 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(5) |
May
(10) |
Jun
(4) |
Jul
(5) |
Aug
(25) |
Sep
(11) |
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(22) |
Feb
(10) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
(5) |
Sep
(8) |
Oct
(8) |
Nov
(26) |
Dec
(27) |
2013 |
Jan
(37) |
Feb
(20) |
Mar
(15) |
Apr
|
May
(10) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(28) |
Nov
(19) |
Dec
(18) |
2014 |
Jan
(1) |
Feb
|
Mar
(30) |
Apr
(22) |
May
(1) |
Jun
|
Jul
(10) |
Aug
(25) |
Sep
(28) |
Oct
(9) |
Nov
(5) |
Dec
(23) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
(20) |
Jul
(42) |
Aug
(48) |
Sep
(15) |
Oct
(14) |
Nov
(24) |
Dec
(36) |
2016 |
Jan
(9) |
Feb
(12) |
Mar
(57) |
Apr
(8) |
May
(20) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
(14) |
Nov
(4) |
Dec
(2) |
2017 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(6) |
Nov
(13) |
Dec
|
From: Enblend <enb...@li...> - 2019-11-26 13:00:47
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/b236375ad1a8 changeset: 1542:b236375ad1a8 user: Chris <cs...@us...> date: Tue Nov 26 14:00:20 2019 +0100 description: Clean up some pedantic warnings. diffstat: VERSION | 2 +- src/anneal.h | 2 +- src/bounds.h | 4 ++-- src/enblend.cc | 8 +++----- src/enfuse.cc | 8 +++----- src/enfuse.h | 2 +- src/pyramid.h | 2 +- 7 files changed, 12 insertions(+), 16 deletions(-) diffs (117 lines): diff -r 209eafc9748b -r b236375ad1a8 VERSION --- a/VERSION Sat Nov 23 16:26:14 2019 +0100 +++ b/VERSION Tue Nov 26 14:00:20 2019 +0100 @@ -1,1 +1,1 @@ -4.3-6f2e65239bf0 +4.3-209eafc9748b diff -r 209eafc9748b -r b236375ad1a8 src/anneal.h --- a/src/anneal.h Sat Nov 23 16:26:14 2019 +0100 +++ b/src/anneal.h Tue Nov 26 14:00:20 2019 +0100 @@ -612,7 +612,7 @@ // Weight factors for the distance of a point from the initial // seam line and the total mismatch accumulated along the seam // line segment. - double distanceWeight;; + double distanceWeight; double mismatchWeight; omp::lock cerrLock; diff -r 209eafc9748b -r b236375ad1a8 src/bounds.h --- a/src/bounds.h Sat Nov 23 16:26:14 2019 +0100 +++ b/src/bounds.h Tue Nov 26 14:00:20 2019 +0100 @@ -75,7 +75,7 @@ return NoOverlap; } -}; +} // Argument object factory version. template <typename SrcImageIterator, typename SrcAccessor> @@ -85,7 +85,7 @@ { return inspectOverlap(src1.first, src1.second, src1.third, src2.first, src2.second); -}; +} /** Determine the region-of-interest and number of blending levels to use, * given the current mask-bounding-box and intersection-bounding-box. diff -r 209eafc9748b -r b236375ad1a8 src/enblend.cc --- a/src/enblend.cc Sat Nov 23 16:26:14 2019 +0100 +++ b/src/enblend.cc Tue Nov 26 14:00:20 2019 +0100 @@ -231,12 +231,10 @@ } -#define DUMP_GLOBAL_VARIABLES(...) dump_global_variables(__FILE__, __LINE__, ##__VA_ARGS__) -void dump_global_variables(const char* file, unsigned line, - std::ostream& out = std::cout) +void dump_global_variables(std::ostream& out = std::cout) { out << - "+ " << file << ":" << line << ": state of global variables\n" << + "+ State of global variables\n" << "+ Verbose = " << Verbose << ", option \"--verbose\"\n" << "+ OutputFileName = <" << OutputFileName << ">\n" << "+ OutputMaskFileName = <" << OutputMaskFileName.value_or("<not defined>") << ">\n" << @@ -1805,7 +1803,7 @@ } if (parameter::as_boolean("dump-global-variables", false)) { - DUMP_GLOBAL_VARIABLES(); + dump_global_variables(); } sig.check(); diff -r 209eafc9748b -r b236375ad1a8 src/enfuse.cc --- a/src/enfuse.cc Sat Nov 23 16:26:14 2019 +0100 +++ b/src/enfuse.cc Tue Nov 26 14:00:20 2019 +0100 @@ -204,12 +204,10 @@ double* enblend::Histogram<InputPixelType, ResultPixelType>::precomputedEntropy = nullptr; -#define DUMP_GLOBAL_VARIABLES(...) dump_global_variables(__FILE__, __LINE__, ##__VA_ARGS__) -void dump_global_variables(const char* file, unsigned line, - std::ostream& out = std::cout) +void dump_global_variables(std::ostream& out = std::cout) { out << - "+ " << file << ":" << line << ": state of global variables\n" << + "+ State of global variables\n" << "+ Verbose = " << Verbose << ", option \"--verbose\"\n" << "+ OutputFileName = <" << OutputFileName << ">\n" << "+ OutputMaskFileName = <" << OutputMaskFileName.value_or("<not defined>") << ">\n" << @@ -2029,7 +2027,7 @@ } if (parameter::as_boolean("dump-global-variables", false)) { - DUMP_GLOBAL_VARIABLES(); + dump_global_variables(); } sig.check(); diff -r 209eafc9748b -r b236375ad1a8 src/enfuse.h --- a/src/enfuse.h Sat Nov 23 16:26:14 2019 +0100 +++ b/src/enfuse.h Tue Nov 26 14:00:20 2019 +0100 @@ -1209,7 +1209,7 @@ [&ef](PixelType x, const MaskValueType& y) {return ef(x) + y;}); #endif } -}; +} /** Enfuse's main blending loop. Templatized to handle different image types. diff -r 209eafc9748b -r b236375ad1a8 src/pyramid.h --- a/src/pyramid.h Sat Nov 23 16:26:14 2019 +0100 +++ b/src/pyramid.h Tue Nov 26 14:00:20 2019 +0100 @@ -591,7 +591,7 @@ mask.first, mask.second, dest.first, dest.second, dest.third, destMask.first, destMask.second, destMask.third); -}; +} |
From: Enblend <enb...@li...> - 2019-11-23 15:26:49
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/6f2e65239bf0 changeset: 1540:6f2e65239bf0 user: Chris <cs...@us...> date: Sat Nov 23 16:25:02 2019 +0100 description: Drop the test for std::as_const<> because C++17 unconditionally requires this template anyhow. diffstat: VERSION | 2 +- configure.ac | 1 - m4/ax_cxx_as_const.m4 | 41 ----------------------------------------- 3 files changed, 1 insertions(+), 43 deletions(-) diffs (62 lines): diff -r 84b3d25e55eb -r 6f2e65239bf0 VERSION --- a/VERSION Sat Nov 23 15:55:15 2019 +0100 +++ b/VERSION Sat Nov 23 16:25:02 2019 +0100 @@ -1,1 +1,1 @@ -4.3-85361528635a +4.3-84b3d25e55eb diff -r 84b3d25e55eb -r 6f2e65239bf0 configure.ac --- a/configure.ac Sat Nov 23 15:55:15 2019 +0100 +++ b/configure.ac Sat Nov 23 16:25:02 2019 +0100 @@ -14,7 +14,6 @@ AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11(ext) -AC_CXX_AS_CONST AC_PROG_CC AC_PROG_AR AM_PROG_AR diff -r 84b3d25e55eb -r 6f2e65239bf0 m4/ax_cxx_as_const.m4 --- a/m4/ax_cxx_as_const.m4 Sat Nov 23 15:55:15 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -# SYNOPSIS -# -# AX_CXX_AS_CONST -# -# DESCRIPTION -# -# If the C++ compiler supports std::as_const(), define HAVE_AS_CONST. -# -# LICENSE -# -# Copyright (c) 2015 Christoph L. Spiel <cs...@us...> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - -AU_ALIAS([AC_CXX_AS_CONST], [AX_CXX_AS_CONST]) -AC_DEFUN([AX_CXX_AS_CONST], -[dnl - AC_CACHE_CHECK([whether the compiler supports as_const()], ax_cv_cxx_as_const, - [dnl - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([dnl - AC_LANG_PROGRAM(dnl - [ -#include <string> -#include <type_traits> -#include <utility> - ], - [std::string s("foo"); -const std::string& const_s = std::as_const(s)])], - ax_cv_cxx_as_const=yes, - ax_cv_cxx_as_const=no) - AC_LANG_POP([C++]) - ]) - AS_IF([test "X$ax_cv_cxx_as_const" = Xyes], - [AC_DEFINE(HAVE_AS_CONST,,[define if the compiler supports as_const()])]) -]) |
From: Enblend <enb...@li...> - 2019-11-23 15:26:49
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/209eafc9748b changeset: 1541:209eafc9748b user: Chris <cs...@us...> date: Sat Nov 23 16:26:14 2019 +0100 description: Substitute "ax_cxx_compile_stdcxx_17.m4" for "ax_cxx_compile_stdcxx_11.m4" and add dependency "ax_cxx_compile_stdcxx.m4". diffstat: VERSION | 2 +- configure.ac | 2 +- m4/ax_cxx_compile_stdcxx.m4 | 981 +++++++++++++++++++++++++++++++++++++++++ m4/ax_cxx_compile_stdcxx_11.m4 | 129 ----- m4/ax_cxx_compile_stdcxx_17.m4 | 35 + 5 files changed, 1018 insertions(+), 131 deletions(-) diffs (truncated from 1175 to 500 lines): diff -r 6f2e65239bf0 -r 209eafc9748b VERSION --- a/VERSION Sat Nov 23 16:25:02 2019 +0100 +++ b/VERSION Sat Nov 23 16:26:14 2019 +0100 @@ -1,1 +1,1 @@ -4.3-84b3d25e55eb +4.3-6f2e65239bf0 diff -r 6f2e65239bf0 -r 209eafc9748b configure.ac --- a/configure.ac Sat Nov 23 16:25:02 2019 +0100 +++ b/configure.ac Sat Nov 23 16:26:14 2019 +0100 @@ -13,7 +13,7 @@ AM_SILENT_RULES() AC_PROG_CXX -AX_CXX_COMPILE_STDCXX_11(ext) +AX_CXX_COMPILE_STDCXX_17(ext) AC_PROG_CC AC_PROG_AR AM_PROG_AR diff -r 6f2e65239bf0 -r 209eafc9748b m4/ax_cxx_compile_stdcxx.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/ax_cxx_compile_stdcxx.m4 Sat Nov 23 16:26:14 2019 +0100 @@ -0,0 +1,981 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik <bk...@re...> +# Copyright (c) 2012 Zack Weinberg <za...@pa...> +# Copyright (c) 2013 Roy Stogner <roy...@ic...> +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <so...@go...> +# Copyright (c) 2015 Paul Norman <pen...@ma...> +# Copyright (c) 2015 Moritz Klammler <mo...@kl...> +# Copyright (c) 2016 Krzesimir Nowak <qd...@gm...> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template <typename T> + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check<void> single_type; + typedef check<check<void>> double_type; + typedef check<check<check<void>>> triple_type; + typedef check<check<check<check<void>>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same<T, T> + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same<int, decltype(0)>::value == true, ""); + static_assert(is_same<int, decltype(c)>::value == false, ""); + static_assert(is_same<int, decltype(v)>::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same<int, decltype(ac)>::value == true, ""); + static_assert(is_same<int, decltype(av)>::value == true, ""); + static_assert(is_same<int, decltype(sumi)>::value == true, ""); + static_assert(is_same<int, decltype(sumf)>::value == false, ""); + static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template <int...> + struct sum; + + template <int N0, int... N1toN> + struct sum<N0, N1toN...> + { + static constexpr auto value = N0 + sum<N1toN...>::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template<typename T> + using member = typename T::member_type; + + template<typename T> + void func(...) {} + + template<typename T> + void func(member<T>*) {} + + void test(); + + void test() { func<foo>(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() |
From: Enblend <enb...@li...> - 2019-11-23 14:55:35
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/84b3d25e55eb changeset: 1539:84b3d25e55eb user: tmodes <tm...@us...> date: Sat Nov 23 15:55:15 2019 +0100 description: CMake: Remove now obsolete tests diffstat: ConfigureChecks.cmake | 36 ------------------------------------ VERSION | 2 +- 2 files changed, 1 insertions(+), 37 deletions(-) diffs (49 lines): diff -r 85361528635a -r 84b3d25e55eb ConfigureChecks.cmake --- a/ConfigureChecks.cmake Sat Nov 23 15:03:53 2019 +0100 +++ b/ConfigureChecks.cmake Sat Nov 23 15:55:15 2019 +0100 @@ -186,39 +186,3 @@ int main(){char b;char *a = strerror_r(0, &b, 0); return(0);} " STRERROR_R_CHAR_P) - -SET(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") -SET(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS}") -check_cxx_source_compiles( - " - #include <string> - #include <type_traits> - #include <utility> - - int main() - { - std::string s(\"foo\"); - const std::string& const_s = std::as_const(s); - return 0; - } - " - - HAVE_AS_CONST -) - -check_cxx_source_compiles( - " - #include <filesystem> - #include <string> - - int main() - { - std::tr2::sys::path filepath; - std::string s=filepath.filename().string(); - return 0; - }; - " - HAVE_STD_FILESYSTEM -) - -SET(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") diff -r 85361528635a -r 84b3d25e55eb VERSION --- a/VERSION Sat Nov 23 15:03:53 2019 +0100 +++ b/VERSION Sat Nov 23 15:55:15 2019 +0100 @@ -1,1 +1,1 @@ -4.3-b7ed254a9d70 +4.3-85361528635a |
From: Enblend <enb...@li...> - 2019-11-23 14:04:13
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/b7ed254a9d70 changeset: 1537:b7ed254a9d70 user: tmodes <tm...@us...> date: Sat Nov 23 15:02:34 2019 +0100 description: CMake: Use now C++17 standard in all builds diffstat: CMakeLists.txt | 61 ++++------------------- CMakeModules/FindCXX11Compiler.cmake | 89 ------------------------------------ CMakeModules/FindOptional.cmake | 19 ------- VERSION | 2 +- config.h.cmake | 15 ------ src/CMakeLists.txt | 1 - 6 files changed, 13 insertions(+), 174 deletions(-) diffs (253 lines): diff -r 1f882f1c83ef -r b7ed254a9d70 CMakeLists.txt --- a/CMakeLists.txt Sat Nov 23 13:45:52 2019 +0100 +++ b/CMakeLists.txt Sat Nov 23 15:02:34 2019 +0100 @@ -122,22 +122,13 @@ SET(ENABLE_DMALLOC_FUNC_CHECK OFF CACHE INTERNAL "") ENDIF(NOT WIN32) -IF(MSVC) - # Check CXX17 compiler - # MSVC needs c++17 switch for some constructs - SET(CMAKE_CXX_STANDARD 17) - SET(CMAKE_CXX_STANDARD_REQUIRED ON) - # MSVC 2017 has removed some deprecated functions with C++17 - # but there are still used by vigra, so bring they back for now - IF(MSVC_VERSION GREATER 1900) - ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC=1) - ENDIF() -ELSE() - # other compiler e.g. gcc complain about some constructs - # in depended libs when compiled with C++17 - # so for now keep at C++11 - SET(CMAKE_CXX_STANDARD 11) - SET(CMAKE_CXX_STANDARD_REQUIRED ON) +# we need a C++17 compliant compiler +SET(CMAKE_CXX_STANDARD 17) +SET(CMAKE_CXX_STANDARD_REQUIRED ON) +# MSVC 2017 has removed some deprecated functions with C++17 +# but there are still used by vigra, so bring they back for now +IF(MSVC_VERSION GREATER 1900) + ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC=1) ENDIF() IF(CMAKE_COMPILER_IS_GNUCXX) @@ -200,6 +191,7 @@ # Required Libraries first FIND_PACKAGE(LCMS2 REQUIRED) ADD_DEFINITIONS(-DHAVE_LIBLCMS2) +ADD_DEFINITIONS(-DCMS_NO_REGISTER_KEYWORD) FIND_PACKAGE(TIFF REQUIRED) FIND_PACKAGE(Perl REQUIRED) # this one is needed in doc. (Especially the program "convert") @@ -208,6 +200,10 @@ ADD_DEFINITIONS(-DHAVE_LIBGSL) ADD_DEFINITIONS(-DHAVE_LIBGSLCBLAS) LIST(APPEND common_libs ${LCMS2_LIBRARIES} ${TIFF_LIBRARIES} ${GSL_LIBRARIES}) +IF(CMAKE_COMPILER_IS_GNUCXX) +# gnu c++ requires -lstdc++fs for C++17 <filesystem> support +LIST(APPEND common_libs stdc++fs) +ENDIF() include_directories(${TIFF_INCLUDE_DIR} ${LCMS2_INCLUDE_DIR}) # Platform specifics required libraries @@ -216,42 +212,9 @@ INCLUDE_DIRECTORIES(${TOP_SRC_DIR}/src/win32helpers) ENDIF(WIN32) -# search for optional header -INCLUDE(CheckIncludeFileCXX) -CHECK_INCLUDE_FILE_CXX(optional HAVE_OPTIONAL) -IF(HAVE_OPTIONAL) - MESSAGE(STATUS "Using <optional> from compiler suite") -ELSE() - FIND_PACKAGE(Optional) - IF(OPTIONAL_FOUND) - MESSAGE(STATUS "Optional header found") - SET(HAVE_OPTIONAL_HPP 1) - INCLUDE_DIRECTORIES(${OPTIONAL_INCLUDE_DIR}) - ELSE() - MESSAGE(STATUS "No optional headers found, fall back to boost") - # search for boost - if(WIN32) - SET(Boost_USE_STATIC_LIBS ON) - IF( NOT Boost_root_suffix ) - SET( Boost_root_suffix _1_51_0 CACHE STRING "suffix of boost root dir." FORCE ) - ENDIF( NOT Boost_root_suffix ) - SET(Boost_USE_STATIC_LIBS ON) - if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOST_ROOT}) - else(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT ${SOURCE_BASE_DIR}/boost${Boost_root_suffix}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - endif() - FIND_PACKAGE(Boost 1.55 REQUIRED) - SET(HAVE_BOOST_OPTIONAL_HPP 1) - ENDIF() -ENDIF() - #check some header and functions include(ConfigureChecks.cmake) -include_directories(${Boost_INCLUDE_DIR}) - # Optional Libraries FIND_PACKAGE(ZLIB) FIND_PACKAGE(JPEG) diff -r 1f882f1c83ef -r b7ed254a9d70 CMakeModules/FindCXX11Compiler.cmake --- a/CMakeModules/FindCXX11Compiler.cmake Sat Nov 23 13:45:52 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -# Check if compiler supports C++11 features -# and which compiler switches are necessary -# CXX11_FLAG : contains the necessary compiler flag - -# -# Copyright (c) 2013 Thomas Modes <tmodes@@users.sourceforge.net> -# -# This file is part of Enblend. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# This file is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Enblend; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -INCLUDE(CheckCXXSourceCompiles) -INCLUDE(FindPackageHandleStandardArgs) - -SET(CXX11_FLAG_CANDIDATES - "--std=gnu++11" - "--std=c++11" - "--std=gnu++0x" -) - -# sample openmp source code to test -SET(CXX11_TEST_SOURCE -" -template <typename T> -struct check -{ - static_assert(sizeof(int) <= sizeof(T), \"not big enough\"); -}; - -typedef check<check<bool>> right_angle_brackets; - -class TestDeleted -{ -public: - TestDeleted() = delete; -}; - - -int a; -decltype(a) b; - -typedef check<int> check_type; -check_type c; -check_type&& cr = static_cast<check_type&&>(c); - -auto d = a; - -int main() { - return 0; -}; -") - -# check c compiler -FOREACH(FLAG ${CXX11_FLAG_CANDIDATES}) - SET(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - SET(CMAKE_REQUIRED_FLAGS "${FLAG}") - UNSET(CXX11_FLAG_DETECTED CACHE) - CHECK_CXX_SOURCE_COMPILES("${CXX11_TEST_SOURCE}" CXX11_FLAG_DETECTED) - SET(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") - IF(CXX11_FLAG_DETECTED) - SET(CXX11_FLAG "${FLAG}") - BREAK() - ENDIF() -ENDFOREACH() - -# handle the standard arguments for find_package -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CXX11Compiler DEFAULT_MSG CXX11_FLAG) - -MARK_AS_ADVANCED(CXX11_FLAG) diff -r 1f882f1c83ef -r b7ed254a9d70 CMakeModules/FindOptional.cmake --- a/CMakeModules/FindOptional.cmake Sat Nov 23 13:45:52 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -IF (OPTIONAL_INCLUDE_DIR) - # Already in cache, be silent - SET(OPTIONAL_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(OPTIONAL_INCLUDE_DIR optional.hpp - /usr/local/include - /usr/include - ${SOURCE_BASE_DIR}/Optional-master -) - - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Optional DEFAULT_MSG - OPTIONAL_INCLUDE_DIR) - -MARK_AS_ADVANCED( - OPTIONAL_INCLUDE_DIR -) diff -r 1f882f1c83ef -r b7ed254a9d70 VERSION --- a/VERSION Sat Nov 23 13:45:52 2019 +0100 +++ b/VERSION Sat Nov 23 15:02:34 2019 +0100 @@ -1,1 +1,1 @@ -4.3-2a3eed753859 +4.3-1f882f1c83ef diff -r 1f882f1c83ef -r b7ed254a9d70 config.h.cmake --- a/config.h.cmake Sat Nov 23 13:45:52 2019 +0100 +++ b/config.h.cmake Sat Nov 23 15:02:34 2019 +0100 @@ -77,21 +77,6 @@ /* Define to 1 if strerror_r returns char *. */ #cmakedefine STRERROR_R_CHAR_P 1 -/* Define to 1 if std::as_const (C++ 17) is available */ -#cmakedefine HAVE_AS_CONST 1 - -/* Define to 1 if <filesystem> is available */ -#cmakedefine HAVE_STD_FILESYSTEM 1 - -/* Define to 1 if <optional> is available */ -#cmakedefine HAVE_OPTIONAL 1 - -/* Define to 1 if <optional.hpp> is available */ -#cmakedefine HAVE_OPTIONAL_HPP 1 - -/* Define to 1 if <boost/optional.hpp> should be used */ -#cmakedefine HAVE_BOOST_OPTIONAL_HPP 1 - /* Version number of package */ #define VERSION "${ENBLEND_VERSION_ONLY}" diff -r 1f882f1c83ef -r b7ed254a9d70 src/CMakeLists.txt --- a/src/CMakeLists.txt Sat Nov 23 13:45:52 2019 +0100 +++ b/src/CMakeLists.txt Sat Nov 23 15:02:34 2019 +0100 @@ -120,7 +120,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) -message(STATUS "Boost_FOUND = ${Boost_FOUND}") message(STATUS "OpenMP_CXX_FLAGS = ${OpenMP_CXX_FLAGS}") add_executable(enblend ${ENBLEND_SOURCES}) |
From: Enblend <enb...@li...> - 2019-11-23 14:04:13
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/85361528635a changeset: 1538:85361528635a user: tmodes <tm...@us...> date: Sat Nov 23 15:03:53 2019 +0100 description: Remove our as_const implementation because it is now included in C++17 diffstat: VERSION | 2 +- src/opencl.h | 30 ------------------------------ 2 files changed, 1 insertions(+), 31 deletions(-) diffs (46 lines): diff -r b7ed254a9d70 -r 85361528635a VERSION --- a/VERSION Sat Nov 23 15:02:34 2019 +0100 +++ b/VERSION Sat Nov 23 15:03:53 2019 +0100 @@ -1,1 +1,1 @@ -4.3-1f882f1c83ef +4.3-b7ed254a9d70 diff -r b7ed254a9d70 -r 85361528635a src/opencl.h --- a/src/opencl.h Sat Nov 23 15:02:34 2019 +0100 +++ b/src/opencl.h Sat Nov 23 15:03:53 2019 +0100 @@ -63,36 +63,6 @@ #define UNUSEDVAR __attribute__((unused)) #endif - -#ifndef HAVE_AS_CONST -namespace std -{ - // Available in C++17 - // See for example: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0007r0.html - - template <typename t> - inline static - const t& - as_const(const t& x) noexcept - { - return x; - } - - template <typename t> - inline static - const t -#if (defined _MSC_VER) && (_MSC_VER <= 1800) - as_const(t&& x) -#else - as_const(t&& x) noexcept(noexcept(t(x))) -#endif - { - return x; - } -} -#endif - - namespace cl { // forward declarations |
From: Enblend <enb...@li...> - 2019-11-23 13:00:13
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/1f882f1c83ef changeset: 1536:1f882f1c83ef user: Chris <cs...@us...> date: Sat Nov 23 13:45:52 2019 +0100 description: Remove the last remaining dependencies on Boost mainly on the autotools side. diffstat: NEWS | 8 +- README | 10 +- VERSION | 2 +- configure.ac | 3 - m4/ax_boost_base.m4 | 272 -------------------------------------------------- m4/ax_boost_system.m4 | 120 ---------------------- src/enblend.cc | 1 - src/enfuse.cc | 1 - 8 files changed, 5 insertions(+), 412 deletions(-) diffs (496 lines): diff -r 2a3eed753859 -r 1f882f1c83ef NEWS --- a/NEWS Sat Nov 23 13:45:09 2019 +0100 +++ b/NEWS Sat Nov 23 13:45:52 2019 +0100 @@ -40,13 +40,7 @@ ** Package Maintainer Stuff -- Boost header <boost/optional.hpp> is not a mandatory header file - anymore. If the C++ standard library already supports C++17 - <optional> it will be preferred by configure(1). A working - standalone implementation of a C++11-compatiblle <optional> can be - found at - https://github.com/akrzemi1/Optional - where only "optional.hpp" is needed. +- All Boost dependencies have been scrapped. - The environment variable SOURCE_DATE_EPOCH overrides the build timestamp as recorded by the signatures. See diff -r 2a3eed753859 -r 1f882f1c83ef README --- a/README Sat Nov 23 13:45:09 2019 +0100 +++ b/README Sat Nov 23 13:45:52 2019 +0100 @@ -1,5 +1,5 @@ Copyright (C) 2004-2009 Andrew Mihal. -Copyright (C) 2009-2017 Christoph Spiel. +Copyright (C) 2009-2019 Christoph Spiel. This file is part of Enblend. @@ -522,13 +522,13 @@ From the command line: - $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial + $ sudo port install make lcms jpeg tiff libpng OpenEXR mercurial Note that Enblend/Enfuse can be build via AutoConf/AutoMake and via CMake. The latter is experimental. If you want to build via CMake, add "cmake" to the previous command line after "mercurial" like this: - $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial cmake + $ sudo port install make lcms jpeg tiff libpng OpenEXR mercurial cmake **** Compile @@ -607,10 +607,6 @@ Enblend/Enfuse also depend on the following libraries: -- Boost [1.60 in boost_1_60_0] - - Only header files are used by default. - - Optionally, Enblend/Enfuse can use the Filesystem Library. - However, this library needs to compiled against STLport. - Little-CMS2 [2.4 in lcm2-2.4] diff -r 2a3eed753859 -r 1f882f1c83ef VERSION --- a/VERSION Sat Nov 23 13:45:09 2019 +0100 +++ b/VERSION Sat Nov 23 13:45:52 2019 +0100 @@ -1,1 +1,1 @@ -4.3-affc3d4dcc67 +4.3-2a3eed753859 diff -r 2a3eed753859 -r 1f882f1c83ef configure.ac --- a/configure.ac Sat Nov 23 13:45:09 2019 +0100 +++ b/configure.ac Sat Nov 23 13:45:52 2019 +0100 @@ -302,9 +302,6 @@ AC_CHECK_HEADER(vigra/basicimage.hxx, [], AC_MSG_ERROR([Vigra "basicimage.hxx" header file is required to compile Enblend.])) -AX_BOOST_BASE([1.55], [], - AC_MSG_ERROR([Boost version 1.55 or later is required to compile Enblend.])) - AC_CHECK_HEADER(gsl/gsl_errno.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_errno" is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_min.h, [], diff -r 2a3eed753859 -r 1f882f1c83ef m4/ax_boost_base.m4 --- a/m4/ax_boost_base.m4 Sat Nov 23 13:45:09 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# <http://randspringer.de/boost/index.html>. -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg <th...@ra...> -# Copyright (c) 2009 Peter Adolphs -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 23 - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=<path>), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), - [ - if test -d "$withval" - then - ac_boost_lib_path="$withval" - else - AC_MSG_ERROR(--with-boost-libdir expected directory name) - fi - ], - [ac_boost_lib_path=""] -) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl On 64-bit systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - libsubdirs="lib" - ax_arch=`uname -m` - case $ax_arch in - x86_64|ppc64|s390x|sparc64|aarch64) - libsubdirs="lib64 lib lib64" - ;; - esac - - dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give - dnl them priority over the other paths since, if libs are found there, they - dnl are almost assuredly the ones desired. - AC_REQUIRE([AC_CANONICAL_HOST]) - libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" - - case ${host_cpu} in - i?86) - libsubdirs="lib/i386-${host_os} $libsubdirs" - ;; - esac - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_CPPFLAGS="-I$ac_boost_path/include" - for ac_boost_path_tmp in $libsubdirs; do - if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then - BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" - break - fi - done - elif test "$cross_compiling" != yes; then - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - for libsubdir in $libsubdirs ; do - if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - if test "$ac_boost_lib_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_lib_path" - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include <boost/version.hpp> - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - if test "$cross_compiling" != yes; then - for ac_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test "$ac_boost_lib_path" = ""; then - for libsubdir in $libsubdirs ; do - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$best_path/$libsubdir" - fi - fi - - if test "x$BOOST_ROOT" != "x"; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include <boost/version.hpp> - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) diff -r 2a3eed753859 -r 1f882f1c83ef m4/ax_boost_system.m4 --- a/m4/ax_boost_system.m4 Sat Nov 23 13:45:09 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_SYSTEM -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# <http://randspringer.de/boost/index.html>. -# -# This macro calls: -# -# AC_SUBST(BOOST_SYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_SYSTEM -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg <th...@ra...> -# Copyright (c) 2008 Michael Tindal -# Copyright (c) 2008 Daniel Casimiro <dan...@gm...> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 17 - -AC_DEFUN([AX_BOOST_SYSTEM], -[ - AC_ARG_WITH([boost-system], - AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], - [use the System library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-system=boost_system-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_system_lib="" - else - want_boost="yes" - ax_boost_user_system_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::System library is available, - ax_cv_boost_system, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]], - [[boost::system::system_category]])], - ax_cv_boost_system=yes, ax_cv_boost_system=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_system" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_system_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - if test "x$link_system" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_system" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff -r 2a3eed753859 -r 1f882f1c83ef src/enblend.cc --- a/src/enblend.cc Sat Nov 23 13:45:09 2019 +0100 +++ b/src/enblend.cc Sat Nov 23 13:45:52 2019 +0100 @@ -41,7 +41,6 @@ #ifdef __GW32C__ #undef malloc -#define BOOST_NO_STDC_NAMESPACE 1 #endif #include <algorithm> diff -r 2a3eed753859 -r 1f882f1c83ef src/enfuse.cc --- a/src/enfuse.cc Sat Nov 23 13:45:09 2019 +0100 +++ b/src/enfuse.cc Sat Nov 23 13:45:52 2019 +0100 @@ -41,7 +41,6 @@ #ifdef __GW32C__ #undef malloc -#define BOOST_NO_STDC_NAMESPACE 1 #endif #include <algorithm> |
From: Enblend <enb...@li...> - 2019-11-23 13:00:12
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/affc3d4dcc67 changeset: 1534:affc3d4dcc67 user: Chris <cs...@us...> date: Sat Nov 23 13:41:24 2019 +0100 description: Remove "optional_transitional.hpp" as it is no longer needed with C++17. diffstat: VERSION | 2 +- configure.ac | 2 - src/CMakeLists.txt | 2 - src/Makefile.am | 4 +- src/enblend.cc | 4 +- src/enfuse.cc | 4 +- src/minimizer.h | 5 +- src/optional_transitional.hpp | 71 ------------------------------------------- 8 files changed, 9 insertions(+), 85 deletions(-) diffs (214 lines): diff -r 51a1e6b03cc6 -r affc3d4dcc67 VERSION --- a/VERSION Fri Nov 08 16:49:12 2019 +0100 +++ b/VERSION Sat Nov 23 13:41:24 2019 +0100 @@ -1,1 +1,1 @@ -4.3-561d2f7b156b +4.3-51a1e6b03cc6 diff -r 51a1e6b03cc6 -r affc3d4dcc67 configure.ac --- a/configure.ac Fri Nov 08 16:49:12 2019 +0100 +++ b/configure.ac Sat Nov 23 13:41:24 2019 +0100 @@ -279,8 +279,6 @@ AC_CHECK_HEADERS([fenv.h limits.h stdlib.h string.h unistd.h]) -AC_CHECK_HEADERS([optional optional.hpp boost/optional.hpp], break) - AC_CHECK_HEADER(sys/times.h, [AC_DEFINE([HAVE_SYS_TIMES_H], [1], [Define if <sys/times.h> exists.])]) AC_CHECK_HEADER(tiffio.h, [], diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/CMakeLists.txt --- a/src/CMakeLists.txt Fri Nov 08 16:49:12 2019 +0100 +++ b/src/CMakeLists.txt Sat Nov 23 13:41:24 2019 +0100 @@ -73,7 +73,6 @@ timer.h timer.cc minimizer.h minimizer.cc muopt.h - optional_transitional.hpp ) set(ENFUSE_SOURCES functoraccessor.hxx rect2d.hxx stride.hxx @@ -100,7 +99,6 @@ timer.h timer.cc minimizer.h minimizer.cc muopt.h - optional_transitional.hpp ) set(additional_libs) diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/Makefile.am --- a/src/Makefile.am Fri Nov 08 16:49:12 2019 +0100 +++ b/src/Makefile.am Sat Nov 23 13:41:24 2019 +0100 @@ -30,7 +30,7 @@ tiff_message.h tiff_message.cc \ timer.h timer.cc \ minimizer.h minimizer.cc \ - muopt.h optional_transitional.hpp + muopt.h enblend_LDFLAGS = $(AM_LDFLAGS) enblend_LDADD = layer_selection/liblayersel.a \ $(GSL_LIBS) $(STATIC_LIBS) \ @@ -64,7 +64,7 @@ tiff_message.h tiff_message.cc \ timer.h timer.cc \ minimizer.h minimizer.cc \ - muopt.h optional_transitional.hpp + muopt.h enfuse_LDFLAGS = $(AM_LDFLAGS) enfuse_LDADD = dynamic_loader/libdynamic_loader.a \ layer_selection/liblayersel.a \ diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/enblend.cc --- a/src/enblend.cc Fri Nov 08 16:49:12 2019 +0100 +++ b/src/enblend.cc Sat Nov 23 13:41:24 2019 +0100 @@ -1,6 +1,6 @@ /* * Copyright (C) 2004-2009 Andrew Mihal - * Copyright (C) 2009-2017 Christoph Spiel + * Copyright (C) 2009-2019 Christoph Spiel * * This file is part of Enblend. * @@ -48,6 +48,7 @@ #include <iostream> #include <list> #include <memory> // std::unique_ptr +#include <optional> #include <set> #include <vector> @@ -82,7 +83,6 @@ #include "alternativepercentage.h" #include "global.h" #include "layer_selection.h" -#include "optional_transitional.hpp" #include "parameter.h" #include "selector.h" #include "self_test.h" diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/enfuse.cc --- a/src/enfuse.cc Fri Nov 08 16:49:12 2019 +0100 +++ b/src/enfuse.cc Sat Nov 23 13:41:24 2019 +0100 @@ -1,6 +1,6 @@ /* * Copyright (C) 2004-2009 Andrew Mihal - * Copyright (C) 2009-2017 Christoph Spiel + * Copyright (C) 2009-2019 Christoph Spiel * * This file is part of Enblend. * @@ -48,6 +48,7 @@ #include <iostream> #include <list> #include <memory> // std::unique_ptr +#include <optional> #include <set> #include <vector> @@ -86,7 +87,6 @@ #include "exposure_weight.h" #include "global.h" #include "layer_selection.h" -#include "optional_transitional.hpp" #include "parameter.h" #include "selector.h" #include "self_test.h" diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/minimizer.h --- a/src/minimizer.h Fri Nov 08 16:49:12 2019 +0100 +++ b/src/minimizer.h Sat Nov 23 13:41:24 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2017 Dr. Christoph L. Spiel + * Copyright (C) 2012-2019 Dr. Christoph L. Spiel * * This file is part of Enblend. * @@ -26,6 +26,7 @@ #include <config.h> #endif +#include <optional> #include <string> #include <stdexcept> #include <vector> @@ -34,8 +35,6 @@ #include <gsl/gsl_multimin.h> #include <gsl/gsl_vector.h> -#include "optional_transitional.hpp" - class Minimizer { diff -r 51a1e6b03cc6 -r affc3d4dcc67 src/optional_transitional.hpp --- a/src/optional_transitional.hpp Fri Nov 08 16:49:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -// Copyright (C) 2016, 2017 Christoph L. Spiel -// -// This file is part of Enblend. -// -// Enblend is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// Enblend is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Enblend; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -#ifndef OPTIONAL_TRANSITIONAL_HEADER_INCLUDED -#define OPTIONAL_TRANSITIONAL_HEADER_INCLUDED - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - - -#if defined(HAVE_OPTIONAL) || defined(HAVE_OPTIONAL_HPP) - -#if defined(HAVE_OPTIONAL) -#include <optional> -#elif defined(HAVE_OPTIONAL_HPP) -#include <optional.hpp> -#endif - -#if __cplusplus < 201500L && (!defined _MSC_VER || _MSC_VER<1916) -namespace std -{ - template <typename t> using optional = ::std::experimental::optional<t>; - using experimental::nullopt; -} -#endif - -#elif defined(HAVE_BOOST_OPTIONAL_HPP) - -#include <boost/optional.hpp> -#include <boost/version.hpp> -namespace std -{ - template <typename t> using optional = ::boost::optional<t>; -#if defined(BOOST_VERSION) && (BOOST_VERSION >= 106000) - const ::boost::none_t nullopt((::boost::none_t::init_tag())); -#else - constexpr ::boost::none_t nullopt; -#endif -} - -#else - -#error "no viable, C++-17-compatible <optional> header file defined" - -#endif - - -#endif // OPTIONAL_TRANSITIONAL_HEADER_INCLUDED - - -// Local Variables: -// mode: c++ -// End: |
From: Enblend <enb...@li...> - 2019-11-23 13:00:12
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/2a3eed753859 changeset: 1535:2a3eed753859 user: Chris <cs...@us...> date: Sat Nov 23 13:45:09 2019 +0100 description: Update "filenameparse.cc" module to reflect the C++17 Standard. Path manipulation is vastly simplified, however some compilers need an additional library to support <filesystem>, for example "stdc++fs" for g++-8.3.0. diffstat: VERSION | 2 +- configure.ac | 13 +- src/filenameparse.cc | 303 +++++++++----------------------------------------- 3 files changed, 66 insertions(+), 252 deletions(-) diffs (445 lines): diff -r affc3d4dcc67 -r 2a3eed753859 VERSION --- a/VERSION Sat Nov 23 13:41:24 2019 +0100 +++ b/VERSION Sat Nov 23 13:45:09 2019 +0100 @@ -1,1 +1,1 @@ -4.3-51a1e6b03cc6 +4.3-affc3d4dcc67 diff -r affc3d4dcc67 -r 2a3eed753859 configure.ac --- a/configure.ac Sat Nov 23 13:41:24 2019 +0100 +++ b/configure.ac Sat Nov 23 13:45:09 2019 +0100 @@ -46,8 +46,8 @@ AC_MSG_CHECKING([for on-demand dynamic linking]) save_ldflags="$LDFLAGS" LDFLAGS="-Wl,--as-needed -Wl,--no-copy-dt-needed-entries ${LDFLAGS}" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], - [[strlen("foo")]])], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cstring>]], + [[std::strlen("foo")]])], [AC_MSG_RESULT(yes); have_on_demand_dynamic_linking=yes], AC_MSG_RESULT(no)) @@ -60,6 +60,15 @@ # Checks for libraries. +STDCXX_FILESYSTEM_LIBRARY='-lstdc++fs' +AC_MSG_CHECKING([whether we must link with an extra library to get C++17 filesystem support]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <filesystem>]], + [[std::filesystem::path p; + p.parent_path()]])], + [AC_MSG_RESULT(no)], + [AC_MSG_RESULT(yes) + LIBS="$LIBS $STDCXX_FILESYSTEM_LIBRARY"]) + # We check for TCMalloc so early to make it the last user library on # the linker command line. It will then gobble all undefined # references to malloc(3) and free(3) and thus relieve the O/S even diff -r affc3d4dcc67 -r 2a3eed753859 src/filenameparse.cc --- a/src/filenameparse.cc Sat Nov 23 13:41:24 2019 +0100 +++ b/src/filenameparse.cc Sat Nov 23 13:45:09 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2017 Dr. Christoph L. Spiel + * Copyright (C) 2009-2019 Dr. Christoph L. Spiel * * This file is part of Enblend. * @@ -22,12 +22,11 @@ // Life is tough and then you die. -- Jack Dempsey -#include <list> +#include <filesystem> +#include <numeric> #include <string> +#include <vector> -#if _WIN32 -#include <ctype.h> // isalpha -#endif #ifdef HAVE_CONFIG_H #include <config.h> @@ -35,332 +34,138 @@ #include "filenameparse.h" -#if defined(_MSC_VER) || defined(HAVE_WINDOWS_H) -#define PATH_SEPARATOR "\\" -#else -#define PATH_SEPARATOR "/" -#endif -#define DOT "." -#define DOTDOT ".." +#define CURRENT_DIRECTORY "." +#define PARENT_DIRECTORY ".." -#ifdef HAVE_STD_FILESYSTEM -#include <filesystem> -#if defined _MSC_VER && _MSC_VER>=1912 -typedef std::experimental::filesystem::path basic_path; -#else -typedef std::tr2::sys::path basic_path; -#endif -#endif + +typedef std::filesystem::path basic_path; + namespace enblend { bool isRelativePath(const std::string& aFilename) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path path(aFilename); - return !path.has_root_directory(); -#else - const std::string::size_type separator = aFilename.find(PATH_SEPARATOR); -#if defined(_MSC_VER) || defined(HAVE_WINDOWS_H) - return !(aFilename.size() >= 3 && - isalpha(aFilename[0]) && - aFilename[1] == ':' && - separator == 2); -#else - return separator != 0; -#endif -#endif + const basic_path path {aFilename}; + + return path.is_relative(); } std::string extractDirname(const std::string& aFilename) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path path(aFilename); - const std::string directory(path.parent_path().string()); - return directory.empty() ? DOT : directory; -#else - const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); - return (separator == std::string::npos) ? DOT : aFilename.substr(0, separator); -#endif + const basic_path path {aFilename}; + const std::string directory {path.parent_path().string()}; + + return directory.empty() ? CURRENT_DIRECTORY : directory; } std::string extractBasename(const std::string& aFilename) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path path(aFilename); + const basic_path path {aFilename}; + return path.filename().string(); -#else - const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); - return - (separator == std::string::npos) ? - aFilename : - aFilename.substr(separator + 1, aFilename.length() - separator - 1); -#endif } std::string extractFilename(const std::string& aFilename) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path path(aFilename); + const basic_path path {aFilename}; + return path.stem().string(); -#else - const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); - const std::string::size_type dot = aFilename.rfind(DOT); - if (separator == std::string::npos) - { - return (dot == std::string::npos) ? aFilename : aFilename.substr(0, dot); - } - else - { - return - (dot == std::string::npos) ? - aFilename.substr(separator + 1, aFilename.length() - separator - 1) : - aFilename.substr(separator + 1, dot - separator - 1); - } -#endif } std::string extractExtension(const std::string& aFilename) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path path(aFilename); + const basic_path path {aFilename}; + return path.extension().string(); -#else - const std::string::size_type dot = aFilename.rfind(DOT); - return - (dot == std::string::npos) ? - "" : - aFilename.substr(dot, aFilename.length() - dot); -#endif } -typedef std::list<std::string> list_t; - - -#if defined(HAVE_STD_FILESYSTEM) - -inline basic_path -removeDotsBoost(const basic_path& aPath) +static +basic_path +removeDotsInPath(const basic_path& aPath) { basic_path result; - for (basic_path::const_iterator p = aPath.begin(); p != aPath.end(); ++p) + + for (const auto& p : aPath) { - if (*p != DOT) + if (p != CURRENT_DIRECTORY) { - result /= *p; + result /= p; } } + return result; } -inline basic_path -removeDotDotsBoost(const basic_path& aPath) +static +basic_path +removeDotDotsInPath(const basic_path& aPath) { - list_t directories; - for (basic_path::const_iterator p = aPath.begin(); p != aPath.end(); ++p) + std::vector<std::string> directories; + + for (const auto& p : aPath) { - if (*p == DOTDOT && - !directories.empty() && directories.back() != DOTDOT) + if (p == PARENT_DIRECTORY && + !directories.empty() && directories.back() != PARENT_DIRECTORY) { directories.pop_back(); } else { - directories.push_back(p->string()); + directories.push_back(p.string()); } } - basic_path result; - for (list_t::const_iterator p = directories.begin(); p != directories.end(); ++p) - { - result /= *p; - } - return result; + + return std::accumulate(directories.begin(), directories.end(), + basic_path {}, + [](const basic_path& parent, const basic_path& leaf) + { + return basic_path {parent} /= leaf; + }); } -#else - -inline -std::string -removeDotsCxx(const std::string& aPathname) -{ - std::string path(aPathname); - std::string::size_type predecessor = std::string::npos; - std::string::size_type separator = path.find(PATH_SEPARATOR); - while (separator != std::string::npos) - { - const std::string::size_type begin = - predecessor == std::string::npos ? 0 : predecessor + 1; - const std::string component = - path.substr(begin, separator - predecessor - 1); - if (component == DOT) - { - path.erase(begin, 2); - } - else - { - predecessor = separator; - } - separator = path.find(PATH_SEPARATOR, predecessor + 1); - } - if (predecessor == std::string::npos) - { - if (path == DOT) - { - path.clear(); - } - } - else - { - const std::string component = path.substr(predecessor + 1); - if (component == DOT) - { - path.erase(predecessor); - } - } - return path; -} - - -inline std::string -removeDotDotsCxx(const std::string& aPathname) -{ - std::string path(aPathname); - list_t directories; - std::string::size_type predecessor = std::string::npos; - std::string::size_type separator = path.find(PATH_SEPARATOR); - while (separator != std::string::npos) - { - const std::string::size_type begin = - predecessor == std::string::npos ? 0 : predecessor + 1; - const std::string component = - path.substr(begin, separator - predecessor - 1); - if (component == DOTDOT && - !directories.empty() && directories.back() != DOTDOT) - { - directories.pop_back(); - } - else - { - directories.push_back(component); - } - - predecessor = separator; - separator = path.find(PATH_SEPARATOR, predecessor + 1); - } - if (predecessor == std::string::npos) - { - directories.push_back(path); - } - else - { - const std::string component = path.substr(predecessor + 1); - if (component == DOTDOT && - !directories.empty() && directories.back() != DOTDOT) - { - directories.pop_back(); - } - else - { - directories.push_back(component); - } - } - std::string result; - for (list_t::const_iterator p = directories.begin(); p != directories.end(); ++p) - { - if (p != directories.begin()) - { - result.append(PATH_SEPARATOR); - } - result.append(*p); - } - return result; -} -#endif - std::string canonicalizePath(const std::string& aPathname, bool keepDot) { -#if defined(HAVE_STD_FILESYSTEM) - const basic_path result = removeDotDotsBoost(removeDotsBoost(basic_path(aPathname))); + const basic_path result {removeDotDotsInPath(removeDotsInPath(basic_path(aPathname)))}; + if (keepDot && result.empty()) { - return std::string(DOT); + return CURRENT_DIRECTORY; } else { return result.string(); } -#else - std::string result = removeDotDotsCxx(removeDotsCxx(aPathname)); - - // For compatibility with the Boost implementation: Remove a - // trailing PATH_SEPARATOR unless we reference the root directory. - const size_t size = result.size(); - if (size >= 2 && result.substr(size - 1, 1) == PATH_SEPARATOR) - { - result.erase(size - 1, 1); - } - if (keepDot && result.empty()) - { - return std::string(DOT); - } - else - { - return result; - } -#endif } std::string concatPath(const std::string& aPathname, const std::string& anotherPathname) { -#if defined(HAVE_STD_FILESYSTEM) - basic_path path(aPathname); - basic_path leaf(anotherPathname); + basic_path path {aPathname}; + basic_path leaf {anotherPathname}; + path /= leaf; + return path.string(); -#else - if (aPathname.empty()) - { - return anotherPathname; - } - else if (anotherPathname.empty()) - { - return aPathname; - } - else - { - const std::string::size_type end = aPathname.find_last_not_of(PATH_SEPARATOR); - const std::string path = - (end == std::string::npos) ? - aPathname : - aPathname.substr(0, end + 1); - const std::string::size_type begin = anotherPathname.find_first_not_of(PATH_SEPARATOR); - const std::string leaf = - (begin == std::string::npos) ? - anotherPathname : - anotherPathname.substr(begin); - return path + PATH_SEPARATOR + leaf; - } -#endif } } // namespace enblend + // Local Variables: // mode: c++ // End: |
From: Enblend <enb...@li...> - 2019-11-08 15:49:43
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/561d2f7b156b changeset: 1532:561d2f7b156b user: tmodes <tm...@us...> date: Fri Nov 08 16:48:26 2019 +0100 description: CMake: Check also for C++17 <optional> include diffstat: CMakeLists.txt | 48 +++++++++++++++++++++++++++--------------------- VERSION | 2 +- 2 files changed, 28 insertions(+), 22 deletions(-) diffs (65 lines): diff -r 71e6db157fdb -r 561d2f7b156b CMakeLists.txt --- a/CMakeLists.txt Fri Nov 08 16:47:06 2019 +0100 +++ b/CMakeLists.txt Fri Nov 08 16:48:26 2019 +0100 @@ -217,28 +217,34 @@ ENDIF(WIN32) # search for optional header -FIND_PACKAGE(Optional) -IF(OPTIONAL_FOUND) - MESSAGE(STATUS "Optional header found") - SET(HAVE_OPTIONAL_HPP 1) - INCLUDE_DIRECTORIES(${OPTIONAL_INCLUDE_DIR}) +INCLUDE(CheckIncludeFileCXX) +CHECK_INCLUDE_FILE_CXX(optional HAVE_OPTIONAL) +IF(HAVE_OPTIONAL) + MESSAGE(STATUS "Using <optional> from compiler suite") ELSE() - MESSAGE(STATUS "No optional headers found, fall back to boost") - # search for boost - if(WIN32) - SET(Boost_USE_STATIC_LIBS ON) - IF( NOT Boost_root_suffix ) - SET( Boost_root_suffix _1_51_0 CACHE STRING "suffix of boost root dir." FORCE ) - ENDIF( NOT Boost_root_suffix ) - SET(Boost_USE_STATIC_LIBS ON) - if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOST_ROOT}) - else(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT ${SOURCE_BASE_DIR}/boost${Boost_root_suffix}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - endif() - FIND_PACKAGE(Boost 1.55 REQUIRED) - SET(HAVE_BOOST_OPTIONAL_HPP 1) + FIND_PACKAGE(Optional) + IF(OPTIONAL_FOUND) + MESSAGE(STATUS "Optional header found") + SET(HAVE_OPTIONAL_HPP 1) + INCLUDE_DIRECTORIES(${OPTIONAL_INCLUDE_DIR}) + ELSE() + MESSAGE(STATUS "No optional headers found, fall back to boost") + # search for boost + if(WIN32) + SET(Boost_USE_STATIC_LIBS ON) + IF( NOT Boost_root_suffix ) + SET( Boost_root_suffix _1_51_0 CACHE STRING "suffix of boost root dir." FORCE ) + ENDIF( NOT Boost_root_suffix ) + SET(Boost_USE_STATIC_LIBS ON) + if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + set(BOOST_ROOT $ENV{BOOST_ROOT}) + else(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + set(BOOST_ROOT ${SOURCE_BASE_DIR}/boost${Boost_root_suffix}) + endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + endif() + FIND_PACKAGE(Boost 1.55 REQUIRED) + SET(HAVE_BOOST_OPTIONAL_HPP 1) + ENDIF() ENDIF() #check some header and functions diff -r 71e6db157fdb -r 561d2f7b156b VERSION --- a/VERSION Fri Nov 08 16:47:06 2019 +0100 +++ b/VERSION Fri Nov 08 16:48:26 2019 +0100 @@ -1,1 +1,1 @@ -4.3-0e8f8b424368 +4.3-71e6db157fdb |
From: Enblend <enb...@li...> - 2019-11-08 15:49:43
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/51a1e6b03cc6 changeset: 1533:51a1e6b03cc6 user: tmodes <tm...@us...> date: Fri Nov 08 16:49:12 2019 +0100 description: MSVC: Fix for new <optional> include diffstat: VERSION | 2 +- src/optional_transitional.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r 561d2f7b156b -r 51a1e6b03cc6 VERSION --- a/VERSION Fri Nov 08 16:48:26 2019 +0100 +++ b/VERSION Fri Nov 08 16:49:12 2019 +0100 @@ -1,1 +1,1 @@ -4.3-71e6db157fdb +4.3-561d2f7b156b diff -r 561d2f7b156b -r 51a1e6b03cc6 src/optional_transitional.hpp --- a/src/optional_transitional.hpp Fri Nov 08 16:48:26 2019 +0100 +++ b/src/optional_transitional.hpp Fri Nov 08 16:49:12 2019 +0100 @@ -34,7 +34,7 @@ #include <optional.hpp> #endif -#if __cplusplus < 201500L +#if __cplusplus < 201500L && (!defined _MSC_VER || _MSC_VER<1916) namespace std { template <typename t> using optional = ::std::experimental::optional<t>; |
From: Enblend <enb...@li...> - 2019-11-08 15:49:42
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/0e8f8b424368 changeset: 1530:0e8f8b424368 user: tmodes <tm...@us...> date: Fri Nov 08 16:46:23 2019 +0100 description: CMake: Check that exiv2 library is recent enough diffstat: CMakeModules/FindEXIV2.cmake | 22 ++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 23 insertions(+), 1 deletions(-) diffs (38 lines): diff -r 6b604e79e85b -r 0e8f8b424368 CMakeModules/FindEXIV2.cmake --- a/CMakeModules/FindEXIV2.cmake Mon Oct 21 13:57:38 2019 +0200 +++ b/CMakeModules/FindEXIV2.cmake Fri Nov 08 16:46:23 2019 +0100 @@ -123,6 +123,28 @@ endif (NOT WIN32) + if(EXIV2_FOUND) + #check that exiv2 is recent enough + INCLUDE(CheckCXXSourceCompiles) + SET(EXIV2_TEST_SOURCE + "#include <exiv2/exiv2.hpp> + int main() + { + Exiv2::Image::UniquePtr anImage; + return 0; + };") + UNSET(EXIV2_COMPILES_FLAG CACHE) + SET(SAFE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) + SET(SAFE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_INCLUDES ${EXIV2_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${EXIV2_LIBRARIES}) + CHECK_CXX_SOURCE_COMPILES("${EXIV2_TEST_SOURCE}" EXIV2_COMPILES_FLAG) + SET(CMAKE_REQUIRED_INCLUDES ${SAFE_CMAKE_REQUIRED_INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES}) + if(NOT EXIV2_COMPILES_FLAG) + MESSAGE(FATAL_ERROR "Found exiv2 library, but this library is not recent enough to compile enblend/enfuse.") + endif() + endif() MARK_AS_ADVANCED(EXIV2_INCLUDE_DIR EXIV2_LIBRARIES) endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) diff -r 6b604e79e85b -r 0e8f8b424368 VERSION --- a/VERSION Mon Oct 21 13:57:38 2019 +0200 +++ b/VERSION Fri Nov 08 16:46:23 2019 +0100 @@ -1,1 +1,1 @@ -4.3-e61b05da65e1 +4.3-6b604e79e85b |
From: Enblend <enb...@li...> - 2019-11-08 15:49:42
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/71e6db157fdb changeset: 1531:71e6db157fdb user: tmodes <tm...@us...> date: Fri Nov 08 16:47:06 2019 +0100 description: CMake: Update search names for lcms2 in newer versions in vcpkg diffstat: CMakeModules/FindLCMS2.cmake | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r 0e8f8b424368 -r 71e6db157fdb CMakeModules/FindLCMS2.cmake --- a/CMakeModules/FindLCMS2.cmake Fri Nov 08 16:46:23 2019 +0100 +++ b/CMakeModules/FindLCMS2.cmake Fri Nov 08 16:47:06 2019 +0100 @@ -26,7 +26,7 @@ include(FindLibraryWithDebug) find_library_with_debug(LCMS2_LIBRARIES WIN32_DEBUG_POSTFIX d - NAMES lcms2 lcms2_static + NAMES lcms2 lcms2_static lcms PATHS ${LCMS2_ROOT_DIR}/Lib/MS ) diff -r 0e8f8b424368 -r 71e6db157fdb VERSION --- a/VERSION Fri Nov 08 16:46:23 2019 +0100 +++ b/VERSION Fri Nov 08 16:47:06 2019 +0100 @@ -1,1 +1,1 @@ -4.3-6b604e79e85b +4.3-0e8f8b424368 |
From: Enblend <enb...@li...> - 2019-10-21 11:58:43
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/6b604e79e85b changeset: 1529:6b604e79e85b user: Chris <cs...@us...> date: Mon Oct 21 13:57:38 2019 +0200 description: Correct some embarrassing spelling mistakes with codespell(1). diffstat: NEWS | 4 ++-- VERSION | 2 +- doc/common-advanced-options.tex | 2 +- doc/common-notation.tex | 2 +- src/enblend.cc | 6 +++--- src/enfuse.cc | 6 +++--- src/enfuse.h | 2 +- src/filenameparse.cc | 2 +- src/fixmath.h | 6 +++--- src/functoraccessor.hxx | 4 ++-- src/graphcut.h | 2 +- src/opencl.cc | 2 +- src/pyramid.h | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diffs (231 lines): diff -r e61b05da65e1 -r 6b604e79e85b NEWS --- a/NEWS Mon Oct 21 13:57:34 2019 +0200 +++ b/NEWS Mon Oct 21 13:57:38 2019 +0200 @@ -379,7 +379,7 @@ ("--disable-image-cache"). Speedups of up to 30% have been reported on the amd64 architecture. -- Enblend and Enfuse accept repsonse files in addition to literal +- Enblend and Enfuse accept response files in addition to literal image files. Response files contain lists of image filenames or names of other response files. @@ -450,7 +450,7 @@ - All Enfuse options have been converted to Enblend's option naming scheme. This is, camel-casing has been replaced by lowercase plus dashes. The new option name are more systematically constructed, - too. The old options will completely dissapear in the next release, + too. The old options will completely disappear in the next release, 4.1. Old Option New Option diff -r e61b05da65e1 -r 6b604e79e85b VERSION --- a/VERSION Mon Oct 21 13:57:34 2019 +0200 +++ b/VERSION Mon Oct 21 13:57:38 2019 +0200 @@ -1,1 +1,1 @@ -4.3-6cf2c54fe0bb +4.3-e61b05da65e1 diff -r e61b05da65e1 -r 6b604e79e85b doc/common-advanced-options.tex --- a/doc/common-advanced-options.tex Mon Oct 21 13:57:34 2019 +0200 +++ b/doc/common-advanced-options.tex Mon Oct 21 13:57:38 2019 +0200 @@ -249,7 +249,7 @@ and nevertheless the final mask is desired after \appisdoing. The output file itself always remains unaffected of this option. In particular it gets its - alpha channel, this is its mask, whenever the output-file format supports one. To mimick + alpha channel, this is its mask, whenever the output-file format supports one. To mimic option~\option{--output-mask} with such formats, use for example \begin{literal} diff -r e61b05da65e1 -r 6b604e79e85b doc/common-notation.tex --- a/doc/common-notation.tex Mon Oct 21 13:57:34 2019 +0200 +++ b/doc/common-notation.tex Mon Oct 21 13:57:38 2019 +0200 @@ -56,7 +56,7 @@ Optional part & Optional part of a syntax description in square brackets & \option{--verbose}~\optional{=\metavar{LEVEL}} \\ - Placehoder & Meta-syntactic variable that stands in for the actual text & + Placeholder & Meta-syntactic variable that stands in for the actual text & \metavar{ICC-PROFILE} \\ Proper name & Name of a person or algorithm & \propername{Dijkstra} \\ diff -r e61b05da65e1 -r 6b604e79e85b src/enblend.cc --- a/src/enblend.cc Mon Oct 21 13:57:34 2019 +0200 +++ b/src/enblend.cc Mon Oct 21 13:57:38 2019 +0200 @@ -806,7 +806,7 @@ {"gpu", no_argument, 0, UseGpuId}, {"no-gpu", no_argument, 0, NoUseGpuId}, {"prefer-gpu", required_argument, 0, PreferGpuId}, - {"preferred-gpu", required_argument, 0, PreferGpuId}, // gramatically close alternative form + {"preferred-gpu", required_argument, 0, PreferGpuId}, // grammatically close alternative form {"pre-assemble", no_argument, 0, PreAssembleId}, {"preassemble", no_argument, 0, PreAssembleId}, // dash-less form: not documented, not deprecated {"no-pre-assemble", no_argument, 0, NoPreAssembleId}, @@ -2133,7 +2133,7 @@ if (!StopAfterMaskGeneration) { OutputIsValid = false; - // Make sure that inputUnion is at least as big as given by the -f paramater. + // Make sure that inputUnion is at least as big as given by the -f parameter. if (OutputSizeGiven) { inputUnion |= vigra::Rect2D(OutputOffsetXCmdLine, OutputOffsetYCmdLine, @@ -2395,7 +2395,7 @@ exit(1); } catch (vigra::StdException& e) { std::cerr << std::endl - << command << ": an exception occured\n" + << command << ": an exception occurred\n" << command << ": " << e.what() << std::endl; exit(1); diff -r e61b05da65e1 -r 6b604e79e85b src/enfuse.cc --- a/src/enfuse.cc Mon Oct 21 13:57:34 2019 +0200 +++ b/src/enfuse.cc Mon Oct 21 13:57:38 2019 +0200 @@ -935,7 +935,7 @@ {"gpu", no_argument, 0, UseGpuId}, {"no-gpu", no_argument, 0, NoUseGpuId}, {"prefer-gpu", required_argument, 0, PreferGpuId}, - {"preferred-gpu", required_argument, 0, PreferGpuId}, // gramatically close alternative form + {"preferred-gpu", required_argument, 0, PreferGpuId}, // grammatically close alternative form {"compression", required_argument, 0, CompressionId}, {"exposure-weight", required_argument, 0, WeightExposureId}, {"contrast-weight", required_argument, 0, WeightContrastId}, @@ -2333,7 +2333,7 @@ if (!StopAfterMaskGeneration) { OutputIsValid = false; - // Make sure that inputUnion is at least as big as given by the -f paramater. + // Make sure that inputUnion is at least as big as given by the -f parameter. if (OutputSizeGiven) { inputUnion |= vigra::Rect2D(OutputOffsetXCmdLine, OutputOffsetYCmdLine, @@ -2603,7 +2603,7 @@ exit(1); } catch (vigra::StdException& e) { std::cerr << std::endl - << command << ": an exception occured\n" + << command << ": an exception occurred\n" << command << ": " << e.what() << std::endl; exit(1); diff -r e61b05da65e1 -r 6b604e79e85b src/enfuse.h --- a/src/enfuse.h Mon Oct 21 13:57:34 2019 +0200 +++ b/src/enfuse.h Mon Oct 21 13:57:38 2019 +0200 @@ -180,7 +180,7 @@ break; } - // Compute auxilliary values of next column + // Compute auxiliary values of next column SrcSumType sumInit = vigra::NumericTraits<SrcSumType>::zero(); SrcSumType sumSqrInit = vigra::NumericTraits<SrcSumType>::zero(); size_t nInit = 0; diff -r e61b05da65e1 -r 6b604e79e85b src/filenameparse.cc --- a/src/filenameparse.cc Mon Oct 21 13:57:34 2019 +0200 +++ b/src/filenameparse.cc Mon Oct 21 13:57:38 2019 +0200 @@ -306,7 +306,7 @@ #else std::string result = removeDotDotsCxx(removeDotsCxx(aPathname)); - // For compatability with the Boost implementation: Remove a + // For compatibility with the Boost implementation: Remove a // trailing PATH_SEPARATOR unless we reference the root directory. const size_t size = result.size(); if (size >= 2 && result.substr(size - 1, 1) == PATH_SEPARATOR) diff -r e61b05da65e1 -r 6b604e79e85b src/fixmath.h --- a/src/fixmath.h Mon Oct 21 13:57:34 2019 +0200 +++ b/src/fixmath.h Mon Oct 21 13:57:38 2019 +0200 @@ -330,7 +330,7 @@ // Dithering is used to fool the eye into seeing gradients that are finer // than the precision of the pixel type. - // This prevents the occurence of cleanly-bordered regions in the output where + // This prevents the occurrence of cleanly-bordered regions in the output where // the pixel values suddenly change from N to N+1. // Such regions are especially objectionable in the green channel of 8-bit images. double dither(const double& v) const @@ -1842,7 +1842,7 @@ std::cout << "\n" << "+ flexible_optimize_1d_2d: failed to reach optimizer goal " << - optimizer_goal << " -- only achived deltaE{1d} = " << delta_e_1d << + optimizer_goal << " -- only achieved deltaE{1d} = " << delta_e_1d << ", deltaE{2d} = " << delta_e_2d << "\n"; ciecam_detail::show_jch_rgb("+ flexible_optimize_1d_2d: initial", jch); ciecam_detail::show_jch_rgb("+ flexible_optimize_1d_2d: final", &opt_jch); @@ -1876,7 +1876,7 @@ // Implementation Notes // - // New LittleCMS versions use "open color space" arithmetics, which means color + // New LittleCMS versions use "open color space" arithmetic, which means color // coordinates can end up outside their domains, e.g. JCh cylinder or RGB cube. We just // let LittleCMS chug along freewheeling as long as possible. Right here, we must take // care of out-of-cube RGB values, because the array `rgb[3]' ends up as pixel in the diff -r e61b05da65e1 -r 6b604e79e85b src/functoraccessor.hxx --- a/src/functoraccessor.hxx Mon Oct 21 13:57:34 2019 +0200 +++ b/src/functoraccessor.hxx Mon Oct 21 13:57:38 2019 +0200 @@ -405,7 +405,7 @@ /** An accessor to encapsulate write access to a multiband image, and move divide it into two images. - This is particulary useful, if a multiband image should be splitted + This is particularly useful, if a multiband image should be split into separate images during import operations. Then one doesn't need to create a temporary image. @@ -424,7 +424,7 @@ - vector -> scalar, scalar - vector -> vector, scalar - This accessor is quite slow. It checks the vector indicies on + This accessor is quite slow. It checks the vector indices on every access. @bug This is not a complete accessor, only write operations are supported. diff -r e61b05da65e1 -r 6b604e79e85b src/graphcut.h --- a/src/graphcut.h Mon Oct 21 13:57:34 2019 +0200 +++ b/src/graphcut.h Mon Oct 21 13:57:38 2019 +0200 @@ -722,7 +722,7 @@ ++currentDual) { current = convertFromDual(*currentDual); - + if (nextDual != cut->end()) { next = convertFromDual(*nextDual); } diff -r e61b05da65e1 -r 6b604e79e85b src/opencl.cc --- a/src/opencl.cc Mon Oct 21 13:57:34 2019 +0200 +++ b/src/opencl.cc Mon Oct 21 13:57:38 2019 +0200 @@ -477,7 +477,7 @@ construct_search_path() { // We _always_ search a_filename along of some explicit, given - // path, never implicitly through CWD or the direcory of the + // path, never implicitly through CWD or the directory of the // binary. std::vector<std::string> paths; diff -r e61b05da65e1 -r 6b604e79e85b src/pyramid.h --- a/src/pyramid.h Mon Oct 21 13:57:34 2019 +0200 +++ b/src/pyramid.h Mon Oct 21 13:57:38 2019 +0200 @@ -160,7 +160,7 @@ * sr1 <= sr0 + srp * scp[x] <= 4*(sr1 + 6*sr0 + srp + current) * - * Updates when visting (odd x, odd y) source pixel: + * Updates when visiting (odd x, odd y) source pixel: * srp <= 4*current */ template <typename SKIPSMImagePixelType, typename SKIPSMAlphaPixelType, @@ -1421,7 +1421,7 @@ // Functor that adds two values and de-promotes the result. // Used when collapsing a laplacian pyramid. -// Explict fromPromote necessary to avoid overflow/underflow problems. +// Explicit fromPromote necessary to avoid overflow/underflow problems. template<typename T1, typename T2, typename T3> struct FromPromotePlusFunctorWrapper : public std::binary_function<T1, T2, T3> |
From: Enblend <enb...@li...> - 2019-10-21 11:58:42
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/c6b17c386f40 changeset: 1526:c6b17c386f40 user: Chris <cs...@us...> date: Mon Oct 21 13:57:12 2019 +0200 description: C++17: replace Exiv2::Image::AutoPtr with Exiv2::Image::UniquePtr. Requires recent exiv2 library. diffstat: VERSION | 2 +- configure.ac | 16 +++++++++++++++- src/enblend.h | 2 +- src/enfuse.h | 2 +- src/metadata.cc | 8 ++++---- src/metadata.h | 4 ++-- 6 files changed, 24 insertions(+), 10 deletions(-) diffs (113 lines): diff -r acca568fcdc3 -r c6b17c386f40 VERSION --- a/VERSION Mon Oct 21 13:57:00 2019 +0200 +++ b/VERSION Mon Oct 21 13:57:12 2019 +0200 @@ -1,1 +1,1 @@ -4.3-4c30a326b3f4 +4.3-acca568fcdc3 diff -r acca568fcdc3 -r c6b17c386f40 configure.ac --- a/configure.ac Mon Oct 21 13:57:00 2019 +0200 +++ b/configure.ac Mon Oct 21 13:57:12 2019 +0200 @@ -151,9 +151,23 @@ image->iptcData();]])], [AC_MSG_RESULT(yes) use_exiv2=yes - AC_DEFINE(HAVE_EXIV2, 1, [Define if you have the exiv2 library])], + AC_DEFINE(HAVE_EXIV2, 1, [Define if you have the Exiv2 library])], [AC_MSG_RESULT(no) LIBS="$SAVED_LIBS"])]) +if test "$use_exiv2" = yes; then + AC_MSG_CHECKING([whether Exiv2 library is sufficiently recent]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <exiv2/image.hpp>]], + [[Exiv2::Image::UniquePtr p {nullptr}]])], + AC_MSG_RESULT(yes), + [AC_MSG_RESULT(no) + use_exiv2=no + LIBS="$SAVED_LIBS" + if test "$with_exiv2" = check; then + AC_MSG_WARN([Exiv2 was found, but it was not recent enough.]) + else + AC_MSG_ERROR([Exiv2 was found, but it was not recent enough.]) + fi]) +fi AC_MSG_CHECKING([for support of partially static linking]) original_LIBS="${LIBS}" diff -r acca568fcdc3 -r c6b17c386f40 src/enblend.h --- a/src/enblend.h Mon Oct 21 13:57:00 2019 +0200 +++ b/src/enblend.h Mon Oct 21 13:57:12 2019 +0200 @@ -100,7 +100,7 @@ FileNameList::const_iterator inputFileNameIterator(anInputFileNameList.begin()); #ifdef HAVE_EXIV2 - typedef allocate::array<Exiv2::Image::AutoPtr> metadata_array; + typedef allocate::array<Exiv2::Image::UniquePtr> metadata_array; metadata_array input_metadata(anInputFileNameList.size()); { FileNameList::const_iterator filename(anInputFileNameList.begin()); diff -r acca568fcdc3 -r c6b17c386f40 src/enfuse.h --- a/src/enfuse.h Mon Oct 21 13:57:00 2019 +0200 +++ b/src/enfuse.h Mon Oct 21 13:57:12 2019 +0200 @@ -1255,7 +1255,7 @@ FileNameList::const_iterator inputFileNameIterator(anInputFileNameList.begin()); #ifdef HAVE_EXIV2 - typedef allocate::array<Exiv2::Image::AutoPtr> metadata_array; + typedef allocate::array<Exiv2::Image::UniquePtr> metadata_array; metadata_array input_metadata(anInputFileNameList.size()); { FileNameList::const_iterator filename(anInputFileNameList.begin()); diff -r acca568fcdc3 -r c6b17c386f40 src/metadata.cc --- a/src/metadata.cc Mon Oct 21 13:57:00 2019 +0200 +++ b/src/metadata.cc Mon Oct 21 13:57:12 2019 +0200 @@ -171,10 +171,10 @@ } - Exiv2::Image::AutoPtr + Exiv2::Image::UniquePtr read(const std::string& an_image_filename) { - Exiv2::Image::AutoPtr meta {Exiv2::ImageFactory::open(an_image_filename)}; + Exiv2::Image::UniquePtr meta {Exiv2::ImageFactory::open(an_image_filename)}; if (meta.get() && meta->good()) { @@ -183,7 +183,7 @@ } else { - return Exiv2::Image::AutoPtr(nullptr); + return Exiv2::Image::UniquePtr(nullptr); } } @@ -193,7 +193,7 @@ named_meta_array::const_iterator some_named_meta_begin, named_meta_array::const_iterator some_named_meta_end) { - Exiv2::Image::AutoPtr output_meta {Exiv2::ImageFactory::open(an_image_filename)}; + Exiv2::Image::UniquePtr output_meta {Exiv2::ImageFactory::open(an_image_filename)}; if (output_meta.get() && output_meta->good()) { diff -r acca568fcdc3 -r c6b17c386f40 src/metadata.h --- a/src/metadata.h Mon Oct 21 13:57:00 2019 +0200 +++ b/src/metadata.h Mon Oct 21 13:57:12 2019 +0200 @@ -50,7 +50,7 @@ class Named { - typedef Exiv2::Image::AutoPtr::element_type* meta_pointer; + typedef Exiv2::Image::UniquePtr::element_type* meta_pointer; public: Named() = delete; @@ -71,7 +71,7 @@ typedef std::vector<Named> named_meta_array; - Exiv2::Image::AutoPtr read(const std::string& an_image_filename); + Exiv2::Image::UniquePtr read(const std::string& an_image_filename); named_meta_array::const_iterator write(const std::string& an_image_filename, named_meta_array::const_iterator some_named_meta_begin, |
From: Enblend <enb...@li...> - 2019-10-21 11:58:42
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/e61b05da65e1 changeset: 1528:e61b05da65e1 user: Chris <cs...@us...> date: Mon Oct 21 13:57:34 2019 +0200 description: Method allocate::detail::positional_hint::append_location_to() returns address of local temporary. Rewrite class `positional_hint' to allocate necessary dynamic storage inside the constructor. This is still not the best way when on an exceptional code path, though. Found by clang++. diffstat: VERSION | 2 +- src/allocate.h | 51 ++++++++++++++++++++------------------------------- 2 files changed, 21 insertions(+), 32 deletions(-) diffs (102 lines): diff -r 6cf2c54fe0bb -r e61b05da65e1 VERSION --- a/VERSION Mon Oct 21 13:57:28 2019 +0200 +++ b/VERSION Mon Oct 21 13:57:34 2019 +0200 @@ -1,1 +1,1 @@ -4.3-c6b17c386f40 +4.3-6cf2c54fe0bb diff -r 6cf2c54fe0bb -r e61b05da65e1 src/allocate.h --- a/src/allocate.h Mon Oct 21 13:57:28 2019 +0200 +++ b/src/allocate.h Mon Oct 21 13:57:34 2019 +0200 @@ -23,7 +23,6 @@ #include <iterator> -#include <sstream> #include <stdexcept> #include <string> #include <vector> @@ -37,23 +36,20 @@ { public: positional_hint() = delete; - explicit positional_hint(std::size_t a_position) : position_(a_position) {} + positional_hint(const char* a_message, std::size_t a_position) : + position_ {a_position} + { + message_.append(a_message); + message_.append(" at position "); + message_.append(std::to_string(position())); + } + + const char* message() const {return message_.c_str();} std::size_t position() const {return position_;} - const char* append_location_to(const char* a_message) const - { - std::stringstream message; - message << a_message << " at position " << position(); - return message.str().c_str(); - } - - const char* append_location_to(const std::string& a_message) const - { - return append_location_to(a_message.c_str()); - } - private: + std::string message_; const std::size_t position_; }; // class positional_hint } // namespace detail @@ -64,12 +60,10 @@ public: not_initialized() = delete; explicit not_initialized(std::size_t an_uninitialized_position) : - detail::positional_hint(an_uninitialized_position) {} + detail::positional_hint {"uninitialized array element", an_uninitialized_position} + {} - virtual const char* what() const noexcept - { - return detail::positional_hint::append_location_to("uninitialized array element"); - } + virtual const char* what() const noexcept {return detail::positional_hint::message();} std::size_t position() const {return detail::positional_hint::position();} }; // class not_initialized @@ -80,12 +74,10 @@ public: already_initialized() = delete; explicit already_initialized(std::size_t an_uninitialized_position) : - detail::positional_hint(an_uninitialized_position) {} + detail::positional_hint {"array element already initialized", an_uninitialized_position} + {} - virtual const char* what() const noexcept - { - return detail::positional_hint::append_location_to("array element already initialized"); - } + virtual const char* what() const noexcept {return detail::positional_hint::message();} std::size_t position() const {return detail::positional_hint::position();} }; // class already_initialized @@ -96,14 +88,11 @@ public: out_of_range() = delete; out_of_range(std::size_t an_out_of_range_position, std::size_t a_size) : - detail::positional_hint(an_out_of_range_position), array_size_(a_size) {} + detail::positional_hint {"out of range access", an_out_of_range_position}, + array_size_ {a_size} + {} - virtual const char* what() const noexcept - { - std::stringstream message; - message << "out of range (0.." << (array_size() - 1) << ") access"; - return detail::positional_hint::append_location_to(message.str()); - } + virtual const char* what() const noexcept {return detail::positional_hint::message();} std::size_t position() const {return detail::positional_hint::position();} std::size_t array_size() const {return array_size_;} |
From: Enblend <enb...@li...> - 2019-10-21 11:58:42
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/6cf2c54fe0bb changeset: 1527:6cf2c54fe0bb user: Chris <cs...@us...> date: Mon Oct 21 13:57:28 2019 +0200 description: Add some hints for the transition to C++17 to our README file. diffstat: README | 32 ++++++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 33 insertions(+), 1 deletions(-) diffs (48 lines): diff -r c6b17c386f40 -r 6cf2c54fe0bb README --- a/README Mon Oct 21 13:57:12 2019 +0200 +++ b/README Mon Oct 21 13:57:28 2019 +0200 @@ -50,6 +50,38 @@ Makefiles contain pattern rules. +** Hints for the migration to C++17 + +*** Compiler + +Some C++ compilers already default to the C++17 Standard, others may +have to be put into a conforming mode of operation with, for example, + -std=gnu++17 +or + -std=c++17 +in CXXFLAGS. + + +*** Little CMS2 + +Depending on the specific C++ compiler and the particular version of +the lcms2 library it may or may not be necessary to add + -DCMS_NO_REGISTER_KEYWORD +to CPPFLAGS because in C++17 `register' is a deprecated and reserved +keyword. + +Library lcms2 is a mandatory prerequisite for both Enblend and Enfuse. + + +*** Exiv2 + +A sufficiently recent Exiv2 library is required because C++17 has +abandoned std::auto_ptr<>, which older versions of the library heavily +rely on; newer versions use std::unique_ptr<>. + +Library exiv2 is optional (see `--with-exiv2'). + + ** Tarball ./configure YOUR-OPTIONS-IF-ANY-GO-HERE diff -r c6b17c386f40 -r 6cf2c54fe0bb VERSION --- a/VERSION Mon Oct 21 13:57:12 2019 +0200 +++ b/VERSION Mon Oct 21 13:57:28 2019 +0200 @@ -1,1 +1,1 @@ -4.3-acca568fcdc3 +4.3-c6b17c386f40 |
From: Enblend <enb...@li...> - 2019-10-21 11:58:41
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/acca568fcdc3 changeset: 1525:acca568fcdc3 user: Chris <cs...@us...> date: Mon Oct 21 13:57:00 2019 +0200 description: C++17: replace std::as_const<> with std::add_const<>. diffstat: VERSION | 2 +- src/opencl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r 4c30a326b3f4 -r acca568fcdc3 VERSION --- a/VERSION Sat Oct 19 08:59:10 2019 +0200 +++ b/VERSION Mon Oct 21 13:57:00 2019 +0200 @@ -1,1 +1,1 @@ -4.3-f3e6c6c88e6e +4.3-4c30a326b3f4 diff -r 4c30a326b3f4 -r acca568fcdc3 src/opencl.h --- a/src/opencl.h Sat Oct 19 08:59:10 2019 +0200 +++ b/src/opencl.h Mon Oct 21 13:57:00 2019 +0200 @@ -408,7 +408,7 @@ template <typename t> typename std::add_const<t>::type get() const { - return std::as_const(static_cast<t>(super::base_address())); + return std::add_const_t<typename std::add_const<t>::type>(static_cast<t>(super::base_address())); } }; // class ScopedReadMap |
From: Enblend <enb...@li...> - 2019-10-19 07:01:23
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/4c30a326b3f4 changeset: 1524:4c30a326b3f4 user: tmodes <tm...@us...> date: Sat Oct 19 08:59:10 2019 +0200 description: Fixes bug in graph-cut algorithm Patch by Lukas Wirz std::priority_queue is storing a *copy* of the comparator object. So modification of the comparator object later are not taken into account by the priority_queue. So using instead a lambda which will capture automatically all changes to the variables. diffstat: VERSION | 2 +- src/graphcut.h | 45 ++++++++++++--------------------------------- 2 files changed, 13 insertions(+), 34 deletions(-) diffs (77 lines): diff -r f3e6c6c88e6e -r 4c30a326b3f4 VERSION --- a/VERSION Mon Sep 23 18:14:04 2019 +0200 +++ b/VERSION Sat Oct 19 08:59:10 2019 +0200 @@ -1,1 +1,1 @@ -4.3-4bc188ec1b3a +4.3-f3e6c6c88e6e diff -r f3e6c6c88e6e -r 4c30a326b3f4 src/graphcut.h --- a/src/graphcut.h Mon Sep 23 18:14:04 2019 +0200 +++ b/src/graphcut.h Sat Oct 19 08:59:10 2019 +0200 @@ -311,35 +311,6 @@ return interPointList; } - - template <typename ImageType> - class CostComparer - { - public: - CostComparer(const ImageType* image) : img(image) {} - - bool operator()(const vigra::Point2D& a, const vigra::Point2D& b) const - { - if (a == vigra::Point2D(-20, -20)) { - return totalScore > (*img)[b]; - } else if (b == vigra::Point2D(-20, -20)) { - return (*img)[a] > totalScore; - } - - return (*img)[a] > (*img)[b]; - } - - void setTotalScore(long s) - { - totalScore = s; - } - - protected: - const ImageType* img; - long totalScore; - }; - - template<class MaskPixelType> struct OutputLabelingFunctor { @@ -576,11 +547,20 @@ vigra::Diff2D bounds, CheckpointPixels* srcDestPoints, std::unordered_set<vigra::Point2D, pointHash>* visited) { MaskPixelType zeroVal = vigra::NumericTraits<MaskPixelType>::zero(); - typedef std::priority_queue<vigra::Point2D, std::vector<vigra::Point2D>, CostComparer<ImageType> > Queue; - CostComparer<ImageType> costcomp(img); - Queue* openset = new Queue(costcomp); long score = 0; long totalScore = 0; + auto costcomparer = [&img, &totalScore](const vigra::Point2D& a, const vigra::Point2D& b)->bool { + if (a == vigra::Point2D(-20, -20)) { + return totalScore > (*img)[b]; + } else { + if (b == vigra::Point2D(-20, -20)) { + return (*img)[a] > totalScore; + }; + }; + return (*img)[a] > (*img)[b]; + }; + typedef std::priority_queue<vigra::Point2D, std::vector<vigra::Point2D>, decltype(costcomparer)> Queue; + Queue * openset = new Queue(costcomparer); long iterCount = 0; int gradientA; int gradientB; @@ -668,7 +648,6 @@ if (neighbour == vigra::Point2D(-20, -20)) { totalScore = score; destNeighbour = current; - costcomp.setTotalScore(totalScore); } else { (*img)[neighbour(1, 1)] &= BIT_MASK_OPEN; (*img)[neighbour(1, 1)] += i; |
From: Enblend <enb...@li...> - 2019-09-23 16:15:55
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/f3e6c6c88e6e changeset: 1523:f3e6c6c88e6e user: tmodes <tm...@us...> date: Mon Sep 23 18:14:04 2019 +0200 description: Fixes typo in FindOpenEXR.cmake to correctly find OpenEXR 2.3 diffstat: CMakeModules/FindOpenEXR.cmake | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r 4bc188ec1b3a -r f3e6c6c88e6e CMakeModules/FindOpenEXR.cmake --- a/CMakeModules/FindOpenEXR.cmake Mon Sep 23 18:13:25 2019 +0200 +++ b/CMakeModules/FindOpenEXR.cmake Mon Sep 23 18:14:04 2019 +0200 @@ -76,7 +76,7 @@ find_library_with_debug(OPENEXR_ILMIMF_LIBRARY WIN32_DEBUG_POSTFIX d - NAMES IlmIlm-2_3 IlmImf-2_2 IlmImf + NAMES IlmImf-2_3 IlmImf-2_2 IlmImf PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} diff -r 4bc188ec1b3a -r f3e6c6c88e6e VERSION --- a/VERSION Mon Sep 23 18:13:25 2019 +0200 +++ b/VERSION Mon Sep 23 18:14:04 2019 +0200 @@ -1,1 +1,1 @@ -4.3-f977fcbbca30 +4.3-4bc188ec1b3a |
From: Enblend <enb...@li...> - 2019-09-23 16:15:55
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/4bc188ec1b3a changeset: 1522:4bc188ec1b3a user: tmodes <tm...@us...> date: Mon Sep 23 18:13:25 2019 +0200 description: Unified line breaks diffstat: VERSION | 2 +- src/graphcut.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diffs (26 lines): diff -r f977fcbbca30 -r 4bc188ec1b3a VERSION --- a/VERSION Mon Sep 23 18:12:52 2019 +0200 +++ b/VERSION Mon Sep 23 18:13:25 2019 +0200 @@ -1,1 +1,1 @@ -4.3-803e2cb3da0f +4.3-f977fcbbca30 diff -r f977fcbbca30 -r 4bc188ec1b3a src/graphcut.h --- a/src/graphcut.h Mon Sep 23 18:12:52 2019 +0200 +++ b/src/graphcut.h Mon Sep 23 18:13:25 2019 +0200 @@ -74,11 +74,11 @@ namespace enblend { - template <class T> - inline void hash_combine(std::size_t & seed, const T & value) - { - std::hash<T> hasher; - seed ^= hasher(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + template <class T> + inline void hash_combine(std::size_t & seed, const T & value) + { + std::hash<T> hasher; + seed ^= hasher(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2); } struct pointHash |
From: Enblend <enb...@li...> - 2019-09-23 16:15:54
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/f977fcbbca30 changeset: 1521:f977fcbbca30 user: tmodes <tm...@us...> date: Mon Sep 23 18:12:52 2019 +0200 description: Fixes memory leak in graphcut algorithm Patch by Lukas diffstat: VERSION | 2 +- src/graphcut.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diffs (42 lines): diff -r 803e2cb3da0f -r f977fcbbca30 VERSION --- a/VERSION Wed Aug 07 12:30:21 2019 +0200 +++ b/VERSION Mon Sep 23 18:12:52 2019 +0200 @@ -1,1 +1,1 @@ -4.3-f53c2b56e4c5 +4.3-803e2cb3da0f diff -r 803e2cb3da0f -r f977fcbbca30 src/graphcut.h --- a/src/graphcut.h Wed Aug 07 12:30:21 2019 +0200 +++ b/src/graphcut.h Mon Sep 23 18:12:52 2019 +0200 @@ -1340,7 +1340,6 @@ IMAGETYPE<GradientPixelType> gradientY(size); IMAGETYPE<GraphPixelType> graphImg(size + size + vigra::Diff2D(1, 1)); - std::vector<vigra::Point2D>* dualPath = nullptr; std::vector<vigra::Point2D> totalDualPath; vigra::Point2D intermediatePoint; CheckpointPixels srcDestPoints; @@ -1460,7 +1459,7 @@ std::cout << "Running graph-cut: " << intermediatePoint << ":" << *i << std::endl; #endif - dualPath = A_star<IMAGETYPE<GraphPixelType>, IMAGETYPE<GradientPixelType>, BasePixelType> + std::vector<vigra::Point2D>* dualPath = A_star<IMAGETYPE<GraphPixelType>, IMAGETYPE<GradientPixelType>, BasePixelType> (vigra::Point2D(-10, -10), vigra::Point2D(-20, -20), &intermediateGraphImg, &gradientX, &gradientY, graphsize - vigra::Diff2D(1, 1), &srcDestPoints, &visited); @@ -1471,6 +1470,7 @@ totalDualPath.push_back(*j); } } + delete dualPath; vigra::copyImage(srcImageRange(graphImg), destImage(intermediateGraphImg)); intermediatePoint = *i; @@ -1481,7 +1481,6 @@ dest_upperleft, da, totalDualPath, iBB); delete intermediatePointList; - delete dualPath; } } /* namespace enblend */ |
From: Enblend <enb...@li...> - 2019-08-07 10:56:40
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend-web/hg/p/enblend/enblend-web/rev/c5d4b23743c8 changeset: 35:c5d4b23743c8 user: tmodes <tm...@us...> date: Wed Aug 07 12:55:45 2019 +0200 description: Make text better readable to using default color instead of white [1828690] diffstat: enblend.css | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 26d7dcfc8a94 -r c5d4b23743c8 enblend.css --- a/enblend.css Wed Mar 30 09:53:56 2016 +0200 +++ b/enblend.css Wed Aug 07 12:55:45 2019 +0200 @@ -1,7 +1,7 @@ body { background: #004242; - color: #EFEFEE; + /* color: #EFEFEE; */ } a:link { |
From: Enblend <enb...@li...> - 2019-08-07 10:44:06
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/803e2cb3da0f changeset: 1520:803e2cb3da0f user: tmodes <tm...@us...> date: Wed Aug 07 12:30:21 2019 +0200 description: Update of header files for new exiv2 versions [1834767] diffstat: VERSION | 2 +- src/metadata.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (18 lines): diff -r f53c2b56e4c5 -r 803e2cb3da0f VERSION --- a/VERSION Sat Jun 29 10:42:34 2019 +0200 +++ b/VERSION Wed Aug 07 12:30:21 2019 +0200 @@ -1,1 +1,1 @@ -4.3-12e03d1e5ab9 +4.3-f53c2b56e4c5 diff -r f53c2b56e4c5 -r 803e2cb3da0f src/metadata.h --- a/src/metadata.h Sat Jun 29 10:42:34 2019 +0200 +++ b/src/metadata.h Wed Aug 07 12:30:21 2019 +0200 @@ -33,7 +33,7 @@ #ifdef HAVE_EXIV2 -#include <exiv2/image.hpp> +#include <exiv2/exiv2.hpp> #endif |
From: Enblend <enb...@li...> - 2019-06-29 08:44:21
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/12e03d1e5ab9 changeset: 1518:12e03d1e5ab9 user: tmodes <tm...@us...> date: Sat Jun 29 10:41:43 2019 +0200 description: CMake: Improved finding of debug versions of libraries diffstat: CMakeModules/FindJPEG.cmake | 4 +- CMakeModules/FindLibraryWithDebug.cmake | 180 +++++++++++++++++++++---------- VERSION | 2 +- 3 files changed, 126 insertions(+), 60 deletions(-) diffs (229 lines): diff -r 8849e927f614 -r 12e03d1e5ab9 CMakeModules/FindJPEG.cmake --- a/CMakeModules/FindJPEG.cmake Thu Jun 28 19:36:43 2018 +0200 +++ b/CMakeModules/FindJPEG.cmake Sat Jun 29 10:41:43 2019 +0200 @@ -24,9 +24,9 @@ ${SOURCE_BASE_DIR}/jpeg-7 ) -include(FindLibraryForCPU) +include(FindLibraryWithDebug) -find_library_for_cpu(JPEG_LIBRARIES +find_library_with_debug(JPEG_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES jpeg libjpeg PATHS diff -r 8849e927f614 -r 12e03d1e5ab9 CMakeModules/FindLibraryWithDebug.cmake --- a/CMakeModules/FindLibraryWithDebug.cmake Thu Jun 28 19:36:43 2018 +0200 +++ b/CMakeModules/FindLibraryWithDebug.cmake Sat Jun 29 10:41:43 2019 +0200 @@ -9,81 +9,147 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -MACRO(FIND_LIBRARY_WITH_DEBUG var_name) - IF(NOT WIN32) - FIND_LIBRARY(${var_name} ${ARGN}) - ELSE(NOT WIN32) - PARSE_ARGUMENTS(FIND_LIB_WITH_DEBUG "WIN32_DEBUG_POSTFIX;WIN32_DEBUG_PATH_SUFFIX;WIN32_RELEASE_PATH_SUFFIX;NAMES;PATHS" "" ${ARGN}) +MACRO(FIND_LIBRARY_WITH_DEBUG var_name win32_dbg_postfix_name dgb_postfix libname) - IF(NOT FIND_LIB_WITH_DEBUG_NAMES) - LIST(GET FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0 FIND_LIB_WITH_DEBUG_NAMES) - LIST(REMOVE_AT FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0) - ENDIF(NOT FIND_LIB_WITH_DEBUG_NAMES) - - IF(NOT FIND_LIB_WITH_DEBUG_PATHS) - LIST(GET FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0 FIND_LIB_WITH_DEBUG_PATHS) - ENDIF(NOT FIND_LIB_WITH_DEBUG_PATHS) - - IF(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) - FIND_LIBRARY(${var_name} NAMES ${FIND_LIB_WITH_DEBUG_NAMES} PATHS ${FIND_LIB_WITH_DEBUG_PATHS}) - ELSE(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) - SET(libpaths_release "") - SET(libpaths_debug "") - - SET(libnames_release "") - SET(libnames_debug "") - - FOREACH(libpath ${FIND_LIB_WITH_DEBUG_PATHS}) - FOREACH(rel_suffix ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) - LIST(APPEND libpaths_release "${libpath}/${rel_suffix}") - ENDFOREACH(rel_suffix ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) - IF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) - LIST(APPEND libpaths_release "${libpath}") - ENDIF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) + IF((NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") AND (NOT VCPKG_TOOLCHAIN)) - FOREACH(deb_suffix ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) - LIST(APPEND libpaths_debug "${libpath}/${deb_suffix}") - ENDFOREACH(deb_suffix ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) - IF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) - LIST(APPEND libpaths_debug "${libpath}") - ENDIF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) - ENDFOREACH(libpath ${FIND_LIB_WITH_DEBUG_PATHS}) - - FOREACH(libname ${FIND_LIB_WITH_DEBUG_NAMES}) - LIST(APPEND libnames_release "${libname}") - LIST(APPEND libnames_debug "${libname}${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX}") - ENDFOREACH(libname ${FIND_LIB_WITH_DEBUG_NAMES}) - - # search the release lib - find_library_for_cpu(${var_name}_RELEASE - NAMES ${libnames_release} - PATHS ${libpaths_release} - ) + # no WIN32_DEBUG_POSTFIX -> simply pass all arguments to FIND_LIBRARY + FIND_LIBRARY(${var_name} + ${win32_dbg_postfix_name} + ${dgb_postfix} + ${libname} + ${ARGN} + ) - # search the debug lib - find_library_for_cpu(${var_name}_DEBUG - NAMES ${libnames_debug} - PATHS ${libpaths_debug} - ) + ELSE() + + IF(NOT WIN32) + # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX + + FIND_LIBRARY(${var_name} ${libname} ${ARGN}) + + ELSE(NOT WIN32) + + # 1. get all possible libnames + IF(VCPKG_TOOLCHAIN AND (NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")) + SET(DBG_POSTFIX "d") + IF("${win32_dbg_postfix_name}" STREQUAL "NAMES") + UNSET(SINGLE_LIBNAME) + SET(args ${dgb_postfix}) + LIST(APPEND args ${libname}) + LIST(APPEND args ${ARGN}) + ELSE() + SET(SINGLE_LIBNAME "${win32_dbg_postfix_name}") + SET(args ${libname}) + LIST(APPEND args ${ARGN}) + ENDIF() + ELSE() + SET(DBG_POSTFIX ${dgb_postfix}) + IF("${libname}" STREQUAL "NAMES") + UNSET(SINGLE_LIBNAME) + ELSE() + SET(SINGLE_LIBNAME "${libname}") + ENDIF() + SET(args ${ARGN}) + ENDIF() + SET(newargs "") + SET(libnames_release "") + SET(libnames_debug "") + + LIST(LENGTH args listCount) + + IF(NOT SINGLE_LIBNAME) + SET(append_rest 0) + LIST(APPEND args " ") + + FOREACH(i RANGE ${listCount}) + LIST(GET args ${i} val) + + IF(append_rest) + LIST(APPEND newargs ${val}) + ELSE(append_rest) + IF("${val}" STREQUAL "PATHS") + # LIST(APPEND newargs ${val}) + SET(append_rest 1) + ELSE("${val}" STREQUAL "PATHS") + LIST(APPEND libnames_release "${val}") + LIST(APPEND libnames_debug "${val}${DBG_POSTFIX}") + IF(VCPKG_TOOLCHAIN) + # in VCPKG the debug library does often not contain a postfix, + # so search also for this variant + LIST(APPEND libnames_debug "${val}") + ENDIF() + ENDIF("${val}" STREQUAL "PATHS") + ENDIF(append_rest) + + ENDFOREACH(i) + + ELSE() + + # just one name + LIST(APPEND libnames_release "${SINGLE_LIBNAME}") + LIST(APPEND libnames_debug "${SINGLE_LIBNAME}${DBG_POSTFIX}") + IF(VCPKG_TOOLCHAIN) + # in VCPKG the debug library does often not contain a postfix, + # so search also for this variant + LIST(APPEND libnames_debug "${SINGLE_LIBNAME}") + ENDIF() + + SET(newargs ${args}) + + ENDIF() + + # search the release and debug lib + IF(VCPKG_TOOLCHAIN) + FIND_LIBRARY(${var_name}_RELEASE + NAMES ${libnames_release} + PATHS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib + NO_DEFAULT_PATH + ) + FIND_LIBRARY(${var_name}_DEBUG + NAMES ${libnames_debug} + PATHS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib + ${newargs} + NO_DEFAULT_PATH + ) + ELSE() + FIND_LIBRARY(${var_name}_RELEASE + NAMES ${libnames_release} + ${newargs} + ) + FIND_LIBRARY(${var_name}_DEBUG + NAMES ${libnames_debug} + ${newargs} + ) + ENDIF() IF(${var_name}_RELEASE AND ${var_name}_DEBUG) + # both libs found SET(${var_name} optimized ${${var_name}_RELEASE} debug ${${var_name}_DEBUG}) + ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG) + IF(${var_name}_RELEASE) + # only release found SET(${var_name} ${${var_name}_RELEASE}) + ELSE(${var_name}_RELEASE) + # only debug (or nothing) found SET(${var_name} ${${var_name}_DEBUG}) + ENDIF(${var_name}_RELEASE) + ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG) MARK_AS_ADVANCED(${var_name}_RELEASE) MARK_AS_ADVANCED(${var_name}_DEBUG) - - ENDIF(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) - ENDIF(NOT WIN32) - + + ENDIF(NOT WIN32) + + ENDIF() + ENDMACRO(FIND_LIBRARY_WITH_DEBUG) diff -r 8849e927f614 -r 12e03d1e5ab9 VERSION --- a/VERSION Thu Jun 28 19:36:43 2018 +0200 +++ b/VERSION Sat Jun 29 10:41:43 2019 +0200 @@ -1,1 +1,1 @@ -4.3-af6cddaed31b +4.3-8849e927f614 |