From 49a4522ea92588adecb6eeb228b05781a9173d7b Mon Sep 17 00:00:00 2001 From: Abhishek Gola Date: Tue, 2 Jun 2026 16:58:32 +0530 Subject: [PATCH] fixed warnings --- modules/features/test/npy_blob.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/features/test/npy_blob.cpp b/modules/features/test/npy_blob.cpp index a67db5f2e7..02afe46773 100644 --- a/modules/features/test/npy_blob.cpp +++ b/modules/features/test/npy_blob.cpp @@ -14,33 +14,33 @@ namespace cv static std::string getType(const std::string& header) { std::string field = "'descr':"; - int idx = header.find(field); - CV_Assert(idx != -1); + size_t idx = header.find(field); + CV_Assert(idx != std::string::npos); - int from = header.find('\'', idx + field.size()) + 1; - int to = header.find('\'', from); + size_t from = header.find('\'', idx + field.size()) + 1; + size_t to = header.find('\'', from); return header.substr(from, to - from); } static std::string getFortranOrder(const std::string& header) { std::string field = "'fortran_order':"; - int idx = header.find(field); - CV_Assert(idx != -1); + size_t idx = header.find(field); + CV_Assert(idx != std::string::npos); - int from = header.find_last_of(' ', idx + field.size()) + 1; - int to = header.find(',', from); + size_t from = header.find_last_of(' ', idx + field.size()) + 1; + size_t to = header.find(',', from); return header.substr(from, to - from); } static std::vector getShape(const std::string& header) { std::string field = "'shape':"; - int idx = header.find(field); - CV_Assert(idx != -1); + size_t idx = header.find(field); + CV_Assert(idx != std::string::npos); - int from = header.find('(', idx + field.size()) + 1; - int to = header.find(')', from); + size_t from = header.find('(', idx + field.size()) + 1; + size_t to = header.find(')', from); std::string shapeStr = header.substr(from, to - from); if (shapeStr.empty())