From 116c8d0ddf4cc6db9071a4182452b06729609446 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 5 Jan 2018 04:30:08 +0000 Subject: [PATCH] build: eliminate warnings warning: comparison between signed and unsigned integer expressions [-Wsign-compare] --- modules/imgproc/src/thresh.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 8cf17aebb1..b25c495f42 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -1483,14 +1483,14 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m imaxval = saturate_cast(imaxval); int ushrt_min = 0; - if (ithresh < ushrt_min || ithresh >= USHRT_MAX) + if (ithresh < ushrt_min || ithresh >= (int)USHRT_MAX) { if (type == THRESH_BINARY || type == THRESH_BINARY_INV || ((type == THRESH_TRUNC || type == THRESH_TOZERO_INV) && ithresh < ushrt_min) || - (type == THRESH_TOZERO && ithresh >= USHRT_MAX)) + (type == THRESH_TOZERO && ithresh >= (int)USHRT_MAX)) { - int v = type == THRESH_BINARY ? (ithresh >= USHRT_MAX ? 0 : imaxval) : - type == THRESH_BINARY_INV ? (ithresh >= USHRT_MAX ? imaxval : 0) : + int v = type == THRESH_BINARY ? (ithresh >= (int)USHRT_MAX ? 0 : imaxval) : + type == THRESH_BINARY_INV ? (ithresh >= (int)USHRT_MAX ? imaxval : 0) : /*type == THRESH_TRUNC ? imaxval :*/ 0; dst.setTo(v); }