Skip to content

Commit 116c8d0

Browse files
committed
build: eliminate warnings
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
1 parent 16821b8 commit 116c8d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/imgproc/src/thresh.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,14 +1483,14 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
14831483
imaxval = saturate_cast<ushort>(imaxval);
14841484

14851485
int ushrt_min = 0;
1486-
if (ithresh < ushrt_min || ithresh >= USHRT_MAX)
1486+
if (ithresh < ushrt_min || ithresh >= (int)USHRT_MAX)
14871487
{
14881488
if (type == THRESH_BINARY || type == THRESH_BINARY_INV ||
14891489
((type == THRESH_TRUNC || type == THRESH_TOZERO_INV) && ithresh < ushrt_min) ||
1490-
(type == THRESH_TOZERO && ithresh >= USHRT_MAX))
1490+
(type == THRESH_TOZERO && ithresh >= (int)USHRT_MAX))
14911491
{
1492-
int v = type == THRESH_BINARY ? (ithresh >= USHRT_MAX ? 0 : imaxval) :
1493-
type == THRESH_BINARY_INV ? (ithresh >= USHRT_MAX ? imaxval : 0) :
1492+
int v = type == THRESH_BINARY ? (ithresh >= (int)USHRT_MAX ? 0 : imaxval) :
1493+
type == THRESH_BINARY_INV ? (ithresh >= (int)USHRT_MAX ? imaxval : 0) :
14941494
/*type == THRESH_TRUNC ? imaxval :*/ 0;
14951495
dst.setTo(v);
14961496
}

0 commit comments

Comments
 (0)