From 8dcaac1ac47c82e49fc3f64316919a56a24df94c Mon Sep 17 00:00:00 2001 From: Madan mohan Manokar Date: Thu, 25 Jun 2026 18:21:33 +0530 Subject: [PATCH] Merge pull request #29379 from amd:fix_warning_minmaxloc fix MSVC warning for minMaxIdx_simd #29379 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/core/src/minmax.simd.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/minmax.simd.hpp b/modules/core/src/minmax.simd.hpp index f7c82e3753..29620a2866 100644 --- a/modules/core/src/minmax.simd.hpp +++ b/modules/core/src/minmax.simd.hpp @@ -273,7 +273,7 @@ static void minMaxIdx_simd_(const T* src, const uchar* mask, WT* minval, WT* max const IT none = mm_set((IST)~(IST)0); // Reduce before the per-lane index could reach the 'none' sentinel. // For >= 32-bit indices (len <= INT_MAX) one block covers everything. - const int64_t idxcap = (sizeof(IST) <= 2) ? (((int64_t)1 << (8 * (int)sizeof(IST))) - 1) : (int64_t)INT_MAX; + const int64_t idxcap = (sizeof(IST) <= 2) ? (int64_t)std::numeric_limits::max() : (int64_t)INT_MAX; const int blockStep = (int)((idxcap / nlanes) * nlanes); const IT inc2 = mm_set((IST)(nlanes * 2));