diff --git a/example/hessian.cpp b/example/hessian.cpp index e27199f5f4..cf05050bcc 100644 --- a/example/hessian.cpp +++ b/example/hessian.cpp @@ -60,8 +60,8 @@ gil::gray8_image_t to_grayscale(gil::rgb8_view_t original) void apply_gaussian_blur(gil::gray8_view_t input_view, gil::gray8_view_t output_view) { - constexpr static auto filter_height = 5ull; - constexpr static auto filter_width = 5ull; + constexpr static std::ptrdiff_t filter_height = 5ull; + constexpr static std::ptrdiff_t filter_width = 5ull; constexpr static double filter[filter_height][filter_width] = { { 2, 4, 6, 4, 2 }, diff --git a/example/mandelbrot.cpp b/example/mandelbrot.cpp index 0bcfc2ea14..1aa5a90897 100644 --- a/example/mandelbrot.cpp +++ b/example/mandelbrot.cpp @@ -40,7 +40,7 @@ struct mandelbrot_fn t=pow(t,0.2); value_type ret; - for (int k=0; k::value; ++k) + for (std::size_t k=0; k::value; ++k) ret[k]=(typename channel_type

::type)(_in_color[k]*t + _out_color[k]*(1-t)); return ret; } diff --git a/include/boost/gil/channel_algorithm.hpp b/include/boost/gil/channel_algorithm.hpp index 12ecd01b0a..848c9652ad 100644 --- a/include/boost/gil/channel_algorithm.hpp +++ b/include/boost/gil/channel_algorithm.hpp @@ -79,7 +79,7 @@ struct unsigned_integral_max_value> template struct unsigned_integral_num_bits - : std::integral_constant + : std::integral_constant(sizeof(UnsignedIntegralChannel) * 8)> {}; template diff --git a/include/boost/gil/color_base.hpp b/include/boost/gil/color_base.hpp index a05b409de8..b638aacbba 100644 --- a/include/boost/gil/color_base.hpp +++ b/include/boost/gil/color_base.hpp @@ -84,7 +84,7 @@ struct homogeneous_color_base typename U = Element, typename = typename std::enable_if::value>::type > - homogeneous_color_base() : v0_{} {}; + homogeneous_color_base() : v0_{} {} explicit homogeneous_color_base(Element v) : v0_(v) {} diff --git a/include/boost/gil/color_convert.hpp b/include/boost/gil/color_convert.hpp index 080d758ae9..a4b6427023 100644 --- a/include/boost/gil/color_convert.hpp +++ b/include/boost/gil/color_convert.hpp @@ -170,13 +170,13 @@ struct default_color_converter_impl // Apply color correction, strengthening, reducing non-zero components by // s = 1 / (1 - k) for k < 1, where 1 denotes dst_t max, otherwise s = 1 (literal). uint_t const dst_max = channel_traits::max_value(); - uint_t const s_div = dst_max - k; + uint_t const s_div = static_cast(dst_max - k); if (s_div != 0) { double const s = dst_max / static_cast(s_div); - c = (c - k) * s; - m = (m - k) * s; - y = (y - k) * s; + c = static_cast((c - k) * s); + m = static_cast((m - k) * s); + y = static_cast((y - k) * s); } else { diff --git a/include/boost/gil/image_processing/harris.hpp b/include/boost/gil/image_processing/harris.hpp index c5deedda99..18185afd81 100644 --- a/include/boost/gil/image_processing/harris.hpp +++ b/include/boost/gil/image_processing/harris.hpp @@ -44,7 +44,7 @@ void compute_harris_responses( " tensor from the same image"); } - auto const window_length = weights.size(); + std::ptrdiff_t const window_length = weights.size(); auto const width = m11.width(); auto const height = m11.height(); auto const half_length = window_length / 2; diff --git a/include/boost/gil/image_processing/hessian.hpp b/include/boost/gil/image_processing/hessian.hpp index 2c8c3adeb1..f88c153607 100644 --- a/include/boost/gil/image_processing/hessian.hpp +++ b/include/boost/gil/image_processing/hessian.hpp @@ -50,9 +50,9 @@ inline void compute_hessian_responses( auto ddxx_i = channel_t(); auto ddyy_i = channel_t(); auto dxdy_i = channel_t(); - for (typename OutputView::coord_t w_y = 0; w_y < weights.size(); ++w_y) + for (typename OutputView::coord_t w_y = 0; w_y < static_cast(weights.size()); ++w_y) { - for (typename OutputView::coord_t w_x = 0; w_x < weights.size(); ++w_x) + for (typename OutputView::coord_t w_x = 0; w_x < static_cast(weights.size()); ++w_x) { ddxx_i += ddxx(x + w_x - center, y + w_y - center) .at(std::integral_constant{}) * weights.at(w_x, w_y); diff --git a/include/boost/gil/image_processing/numeric.hpp b/include/boost/gil/image_processing/numeric.hpp index 2109c555f4..b601b17dd0 100644 --- a/include/boost/gil/image_processing/numeric.hpp +++ b/include/boost/gil/image_processing/numeric.hpp @@ -48,7 +48,7 @@ inline double lanczos(double x, std::ptrdiff_t a) if (0 <= x && x <= 0) return 1; - if (-a < x && x < a) + if (static_cast(-a) < x && x < static_cast(a)) return normalized_sinc(x) / normalized_sinc(x / static_cast(a)); return 0;