From f6c502be02abbd9c89e666a8b905f539d6f456e7 Mon Sep 17 00:00:00 2001 From: MIRAL SHAH <37846212+miralshah365@users.noreply.github.com> Date: Fri, 9 Aug 2019 21:06:37 +0530 Subject: [PATCH] Fix Boost guidelines violations (#378) Add copyright notice. Add protection from the min/max macro. Closes #376 --- include/boost/gil/extension/numeric/convolve.hpp | 1 + include/boost/gil/extension/numeric/kernel.hpp | 2 ++ include/boost/gil/image_processing/threshold.hpp | 8 ++++---- test/extension/numeric/kernel.cpp | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/boost/gil/extension/numeric/convolve.hpp b/include/boost/gil/extension/numeric/convolve.hpp index e626828064..bd2fd0504f 100644 --- a/include/boost/gil/extension/numeric/convolve.hpp +++ b/include/boost/gil/extension/numeric/convolve.hpp @@ -1,5 +1,6 @@ // // Copyright 2005-2007 Adobe Systems Incorporated +// Copyright 2019 Miral Shah // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/gil/extension/numeric/kernel.hpp b/include/boost/gil/extension/numeric/kernel.hpp index 9d95d33388..f61ed6a82b 100644 --- a/include/boost/gil/extension/numeric/kernel.hpp +++ b/include/boost/gil/extension/numeric/kernel.hpp @@ -1,10 +1,12 @@ // // Copyright 2005-2007 Adobe Systems Incorporated +// Copyright 2019 Miral Shah // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // + #ifndef BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP #define BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP diff --git a/include/boost/gil/image_processing/threshold.hpp b/include/boost/gil/image_processing/threshold.hpp index ec13f8799f..0a4f579499 100644 --- a/include/boost/gil/image_processing/threshold.hpp +++ b/include/boost/gil/image_processing/threshold.hpp @@ -153,7 +153,7 @@ void threshold_binary( //deciding output channel type and creating functor using result_channel_t = typename channel_type::type; - result_channel_t max_value = std::numeric_limits::max(); + result_channel_t max_value = (std::numeric_limits::max)(); threshold_binary(src_view, dst_view, threshold_value, max_value, direction); } @@ -230,8 +230,8 @@ void otsu_impl(SrcView const& src_view, DstView const& dst_view, threshold_direc std::array histogram{}; //initial value of min is set to maximum possible value to compare histogram data //initial value of max is set to minimum possible value to compare histogram data - auto min = std::numeric_limits::max(), - max = std::numeric_limits::min(); + auto min = (std::numeric_limits::max)(), + max = (std::numeric_limits::min)(); if (sizeof(source_channel_t) > 1 || std::is_signed::value) { @@ -445,7 +445,7 @@ void threshold_adaptive //deciding output channel type and creating functor typedef typename channel_type::type result_channel_t; - result_channel_t max_value = std::numeric_limits::max(); + result_channel_t max_value = (std::numeric_limits::max)(); threshold_adaptive(src_view, dst_view, max_value, kernel_size, method, direction, constant); } diff --git a/test/extension/numeric/kernel.cpp b/test/extension/numeric/kernel.cpp index 0c699e8613..a8c2fd96c4 100644 --- a/test/extension/numeric/kernel.cpp +++ b/test/extension/numeric/kernel.cpp @@ -1,5 +1,6 @@ // // Copyright 2019 Mateusz Loskot +// Copyright 2019 Miral Shah // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at