diff --git a/3rdparty/ippicv/CMakeLists.txt b/3rdparty/ippicv/CMakeLists.txt index 43ad806dd7ce03a8c19e74d33f9aaab4e14be49a..4ef248f3c0d805a5eaadc66b2c3b34ed6d8bbe60 100644 --- a/3rdparty/ippicv/CMakeLists.txt +++ b/3rdparty/ippicv/CMakeLists.txt @@ -24,7 +24,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers") endif() if(CV_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign -Wno-strict-prototypes") endif() endif() diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp index 146d37f009c69c27e337ca71a5f612e5fdad3bdd..02ac1ba1e3cb44bfe49426c9c88c9df9ab40a0be 100644 --- a/modules/core/include/opencv2/core/private.hpp +++ b/modules/core/include/opencv2/core/private.hpp @@ -235,6 +235,10 @@ T* allocSingletonNew() { return new(allocSingletonNewBuffer(sizeof(T))) T(); } #include "ipp.h" #endif #ifdef HAVE_IPP_IW +# if defined(__OPENCV_BUILD) && defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wstrict-prototypes" +# endif # if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wsuggest-override" @@ -246,6 +250,9 @@ T* allocSingletonNew() { return new(allocSingletonNewBuffer(sizeof(T))) T(); } # if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 # pragma GCC diagnostic pop # endif +# if defined(__OPENCV_BUILD) && defined(__clang__) +# pragma clang diagnostic pop +# endif #endif #if IPP_VERSION_X100 >= 201700 diff --git a/modules/gapi/misc/python/pyopencv_gapi.hpp b/modules/gapi/misc/python/pyopencv_gapi.hpp index 49b2ddd1eb3be703ed6cb294bf21be56654ae241..07bacd3665079e39956ce310b9f07de2c49f63e6 100644 --- a/modules/gapi/misc/python/pyopencv_gapi.hpp +++ b/modules/gapi/misc/python/pyopencv_gapi.hpp @@ -664,7 +664,6 @@ static cv::GRunArgs run_py_kernel(cv::detail::PyObjectHolder kernel, cv::GRunArgs outs; try { - int in_idx = 0; // NB: Doesn't increase reference counter (false), // because PyObject already have ownership. // In case exception decrement reference counter. @@ -697,7 +696,6 @@ static cv::GRunArgs run_py_kernel(cv::detail::PyObjectHolder kernel, util::throw_error(std::logic_error("GFrame isn't supported for custom operation")); break; } - ++in_idx; } if (ctx.m_state.has_value()) diff --git a/modules/gapi/test/internal/gapi_int_executor_tests.cpp b/modules/gapi/test/internal/gapi_int_executor_tests.cpp index b8f0e18e0ba79f7d2d02045e89381b6b0ae71913..79117aebf3c1f8cf8740357ba958e20d262ef262 100644 --- a/modules/gapi/test/internal/gapi_int_executor_tests.cpp +++ b/modules/gapi/test/internal/gapi_int_executor_tests.cpp @@ -27,7 +27,7 @@ class GMockExecutable final: public cv::gimpl::GIslandExecutable m_priv->m_reshape_counter++; } virtual void handleNewStream() override { } - virtual void run(std::vector&&, std::vector&&) { } + virtual void run(std::vector&&, std::vector&&) override { } virtual bool allocatesOutputs() const override { return true; diff --git a/modules/gapi/test/streaming/gapi_streaming_tests.cpp b/modules/gapi/test/streaming/gapi_streaming_tests.cpp index c27ebe3ca2486f5551bee2203d340bf433aba587..bdb0ae9cd93ff6739b21565cbd77b65e90ac9ca4 100644 --- a/modules/gapi/test/streaming/gapi_streaming_tests.cpp +++ b/modules/gapi/test/streaming/gapi_streaming_tests.cpp @@ -190,7 +190,7 @@ public: : cv::gapi::wip::GCaptureSource(pipeline) { } - bool pull(cv::gapi::wip::Data& data) { + bool pull(cv::gapi::wip::Data& data) override { if (cv::gapi::wip::GCaptureSource::pull(data)) { data = cv::MediaFrame::Create(cv::util::get(data)); return true; @@ -232,7 +232,7 @@ public: : cv::gapi::wip::GCaptureSource(pipeline) { } - bool pull(cv::gapi::wip::Data& data) { + bool pull(cv::gapi::wip::Data& data) override { if (cv::gapi::wip::GCaptureSource::pull(data)) { cv::Mat bgr = cv::util::get(data); cv::Mat y, uv; @@ -256,7 +256,7 @@ public: : cv::gapi::wip::GCaptureSource(pipeline) { } - bool pull(cv::gapi::wip::Data& data) { + bool pull(cv::gapi::wip::Data& data) override { if (cv::gapi::wip::GCaptureSource::pull(data)) { cv::Mat bgr = cv::util::get(data); cv::Mat gray; @@ -319,7 +319,7 @@ public: return "InvalidSource sucessfuly failed!"; } - bool pull(cv::gapi::wip::Data& d) { + bool pull(cv::gapi::wip::Data& d) override { ++m_curr_frame_id; if (m_curr_frame_id > m_num_frames) { return false; diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index ad8bac5a47feabfc0043d74203c11ac0a2687e23..02d5e232a2dd10e0f82af987c879994df4ca513e 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -49,10 +49,10 @@ public: CV_FilterBaseTest( bool _fp_kernel ); protected: - int prepare_test_case( int test_case_idx ); - int read_params( const cv::FileStorage& fs ); - void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ); - void get_minmax_bounds( int i, int j, int type, Scalar& low, Scalar& high ); + int prepare_test_case( int test_case_idx ) CV_OVERRIDE; + int read_params( const cv::FileStorage& fs ) CV_OVERRIDE; + void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ) CV_OVERRIDE; + void get_minmax_bounds( int i, int j, int type, Scalar& low, Scalar& high ) CV_OVERRIDE; Size aperture_size; Point anchor; int max_aperture_size; @@ -689,8 +689,8 @@ public: CV_SmoothBaseTest(); protected: - void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ); - double get_success_error_level( int test_case_idx, int i, int j ); + void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ) CV_OVERRIDE; + double get_success_error_level( int test_case_idx, int i, int j ) CV_OVERRIDE; const char* smooth_type; void dump_test_case(int test_case_idx, std::ostream* out) CV_OVERRIDE @@ -802,10 +802,10 @@ public: CV_GaussianBlurTest(); protected: - void prepare_to_validation( int test_case_idx ); - void run_func(); - void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ); - double get_success_error_level( int /*test_case_idx*/, int /*i*/, int /*j*/ ); + void prepare_to_validation( int test_case_idx ) CV_OVERRIDE; + void run_func() CV_OVERRIDE; + void get_test_array_types_and_sizes( int test_case_idx, vector >& sizes, vector >& types ) CV_OVERRIDE; + double get_success_error_level( int /*test_case_idx*/, int /*i*/, int /*j*/ ) CV_OVERRIDE; double sigma; int param1, param2; diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp index eee0376a0e782c7bb104d250ad3e142a17cecf23..86f2d077617ecd2139eb6d1308dcff26a64e09d7 100644 --- a/modules/ts/include/opencv2/ts.hpp +++ b/modules/ts/include/opencv2/ts.hpp @@ -116,20 +116,22 @@ # endif #endif -#if defined(__OPENCV_BUILD) && defined(__clang__) -#pragma clang diagnostic ignored "-Winconsistent-missing-override" -#endif #if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 //#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-override" #endif -#if defined(__OPENCV_BUILD) && defined(__APPLE__) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301) +#if defined(__OPENCV_BUILD) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301) +#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Winconsistent-missing-override" #endif #include "opencv2/ts/ts_gtest.h" #if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5 //#pragma GCC diagnostic pop #endif +#if defined(__OPENCV_BUILD) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301) +#pragma clang diagnostic pop +#endif #include "opencv2/ts/ts_ext.hpp" #ifndef GTEST_USES_SIMPLE_RE diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp index 5c09b569a59ae4ac7d89a2ff85999eec6cf2eebd..efa48605108a52f2726f9f2683c68063f040395a 100644 --- a/modules/ts/include/opencv2/ts/ts_ext.hpp +++ b/modules/ts/include/opencv2/ts/ts_ext.hpp @@ -49,13 +49,13 @@ bool checkBigDataTests(); #undef TEST -#define TEST_(test_case_name, test_name, parent_class, bodyMethodName, BODY_IMPL) \ +#define TEST_(test_case_name, test_name, parent_class, bodyMethodName, BODY_ATTR, BODY_IMPL) \ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ public:\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ private:\ virtual void TestBody() CV_OVERRIDE;\ - virtual void bodyMethodName();\ + virtual void bodyMethodName() BODY_ATTR;\ static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ GTEST_DISALLOW_COPY_AND_ASSIGN_(\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ @@ -74,7 +74,7 @@ bool checkBigDataTests(); void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() BODY_IMPL( #test_case_name "_" #test_name ) \ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::bodyMethodName() -#define TEST(test_case_name, test_name) TEST_(test_case_name, test_name, ::testing::Test, Body, CV__TEST_BODY_IMPL) +#define TEST(test_case_name, test_name) TEST_(test_case_name, test_name, ::testing::Test, Body,, CV__TEST_BODY_IMPL) #define CV__TEST_BIGDATA_BODY_IMPL(name) \ { \ @@ -96,9 +96,9 @@ bool checkBigDataTests(); // Special type of tests which require / use or validate processing of huge amount of data (>= 2Gb) #if defined(_M_X64) || defined(_M_ARM64) || defined(__x86_64__) || defined(__aarch64__) -#define BIGDATA_TEST(test_case_name, test_name) TEST_(BigData_ ## test_case_name, test_name, ::testing::Test, Body, CV__TEST_BIGDATA_BODY_IMPL) +#define BIGDATA_TEST(test_case_name, test_name) TEST_(BigData_ ## test_case_name, test_name, ::testing::Test, Body,, CV__TEST_BIGDATA_BODY_IMPL) #else -#define BIGDATA_TEST(test_case_name, test_name) TEST_(BigData_ ## test_case_name, DISABLED_ ## test_name, ::testing::Test, Body, CV__TEST_BIGDATA_BODY_IMPL) +#define BIGDATA_TEST(test_case_name, test_name) TEST_(BigData_ ## test_case_name, DISABLED_ ## test_name, ::testing::Test, Body,, CV__TEST_BIGDATA_BODY_IMPL) #endif #undef TEST_F @@ -128,13 +128,13 @@ bool checkBigDataTests(); void GTEST_TEST_CLASS_NAME_(test_fixture, test_name)::Body() // Don't use directly -#define CV__TEST_P(test_case_name, test_name, bodyMethodName, BODY_IMPL/*(name_str)*/) \ +#define CV__TEST_P(test_case_name, test_name, bodyMethodName, BODY_ATTR, BODY_IMPL/*(name_str)*/) \ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ : public test_case_name { \ public: \ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ private: \ - virtual void bodyMethodName(); \ + virtual void bodyMethodName() BODY_ATTR; \ virtual void TestBody() CV_OVERRIDE; \ static int AddToRegistry() { \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ @@ -160,7 +160,7 @@ bool checkBigDataTests(); void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::bodyMethodName() #undef TEST_P -#define TEST_P(test_case_name, test_name) CV__TEST_P(test_case_name, test_name, Body, CV__TEST_BODY_IMPL) +#define TEST_P(test_case_name, test_name) CV__TEST_P(test_case_name, test_name, Body,, CV__TEST_BODY_IMPL) #define CV_TEST_EXPECT_EXCEPTION_MESSAGE(statement, msg) \ diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 5ca22d2b1e3c72f00093a2199c1a4325323ba9ef..7aa3809f27b874baf102d5cf0e3450e21ce2f21b 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -551,7 +551,7 @@ void PrintTo(const Size& sz, ::std::ostream* os); // EXPECT_TRUE(foo.StatusIsOK()); // } #define PERF_TEST(test_case_name, test_name)\ - TEST_(test_case_name, test_name, ::perf::TestBase, PerfTestBody, CV__PERF_TEST_BODY_IMPL) + TEST_(test_case_name, test_name, ::perf::TestBase, PerfTestBody, CV_OVERRIDE, CV__PERF_TEST_BODY_IMPL) // Defines a performance test that uses a test fixture. // @@ -595,7 +595,7 @@ void PrintTo(const Size& sz, ::std::ostream* os); // // @Note PERF_TEST_P() below violates behavior of original Google Tests - there is no tests instantiation in original TEST_P() // This macro is intended for usage with separate INSTANTIATE_TEST_CASE_P macro -#define PERF_TEST_P_(test_case_name, test_name) CV__TEST_P(test_case_name, test_name, PerfTestBody, CV__PERF_TEST_BODY_IMPL) +#define PERF_TEST_P_(test_case_name, test_name) CV__TEST_P(test_case_name, test_name, PerfTestBody, CV_OVERRIDE, CV__PERF_TEST_BODY_IMPL) // Defines a parametrized performance test. // @@ -628,7 +628,7 @@ void PrintTo(const Size& sz, ::std::ostream* os); protected:\ virtual void PerfTestBody();\ };\ - CV__TEST_P(fixture##_##name, name, PerfTestBodyDummy, CV__PERF_TEST_BODY_IMPL){} \ + CV__TEST_P(fixture##_##name, name, PerfTestBodyDummy,, CV__PERF_TEST_BODY_IMPL){} \ INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\ void fixture##_##name::PerfTestBody() diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index 958a2e300d3300de8bce4607222d684ee1eb4a89..39147228b8d73c062c9c282f2b7984cc78bfa093 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -2104,8 +2104,6 @@ struct KeypointComparator { return cmp(pts_[idx1], pts_[idx2]); } -private: - KeypointComparator& operator=(const KeypointComparator&) = delete; }; }//namespace @@ -2119,7 +2117,8 @@ void perf::sort(std::vector& pts, cv::InputOutputArray descriptors for (int i = 0; i < desc.rows; ++i) idxs[i] = i; - std::sort(idxs.data(), idxs.data() + desc.rows, KeypointComparator(pts)); + comparators::KeypointGreater cmp; + std::sort(idxs.data(), idxs.data() + desc.rows, [&](int lhs, int rhs){ return cmp(pts[lhs], pts[rhs]); }); std::vector spts(pts.size()); cv::Mat sdesc(desc.size(), desc.type()); diff --git a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp index 1bcb6ddf766de532646eacca49b2f294374e0501..35d2a7483fb8bfa2d5684ab8259d34c0c0cc87e4 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp +++ b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp @@ -198,7 +198,7 @@ DepthFrameUnpacker::DepthFrameUnpacker(){ outputDataBuf_ = new uint8_t[OUT_DATA_SIZE]; } -DepthFrameUnpacker::~DepthFrameUnpacker(){ +DepthFrameUnpacker::~DepthFrameUnpacker() { delete[] outputDataBuf_; } diff --git a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp index 02f4040101d0a15e34f2a1032a1a2d587cd88ab5..caff38efea67e6fa28cdb04216c94045547546df 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp +++ b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp @@ -67,7 +67,7 @@ public: class DepthFrameProcessor: public IFrameProcessor { public: DepthFrameProcessor(const OBExtensionParam& parma); - virtual ~DepthFrameProcessor() noexcept; + virtual ~DepthFrameProcessor(); virtual void process(Frame* frame) override; private: @@ -78,7 +78,7 @@ private: class DepthFrameUnpacker: public IFrameProcessor { public: DepthFrameUnpacker(); - virtual ~DepthFrameUnpacker() noexcept; + virtual ~DepthFrameUnpacker(); virtual void process(Frame* frame) override; private: const uint32_t OUT_DATA_SIZE = 1280*800*2; diff --git a/samples/cpp/train_svmsgd.cpp b/samples/cpp/train_svmsgd.cpp index bfd837d5076055d379a61a6d5196336b22978960..12e03840810d04384c68a68d0a71ae9e18c2606e 100644 --- a/samples/cpp/train_svmsgd.cpp +++ b/samples/cpp/train_svmsgd.cpp @@ -29,7 +29,7 @@ struct Data bool doTrain(const Mat samples, const Mat responses, Mat &weights, float &shift); //function finds two points for drawing line (wx = 0) -bool findPointsForLine(const Mat &weights, float shift, Point points[], int width, int height); +bool findPointsForLine(const Mat &weights, float shift, Point points[2], int width, int height); // function finds cross point of line (wx = 0) and segment ( (y = HEIGHT, 0 <= x <= WIDTH) or (x = WIDTH, 0 <= y <= HEIGHT) ) bool findCrossPointWithBorders(const Mat &weights, float shift, const std::pair &segment, Point &crossPoint); diff --git a/samples/cpp/warpPerspective_demo.cpp b/samples/cpp/warpPerspective_demo.cpp index 947abd43590cc2256c297fbe1eb2d318a33e6485..1a5bb07d871c547de98130b242c42386bacf83db 100644 --- a/samples/cpp/warpPerspective_demo.cpp +++ b/samples/cpp/warpPerspective_demo.cpp @@ -157,7 +157,7 @@ static void onMouse(int event, int x, int y, int, void*) { for (int i = 0; i < 4; ++i) { - if ((event == EVENT_LBUTTONDOWN) & ((abs(roi_corners[i].x - x) < 10)) & (abs(roi_corners[i].y - y) < 10)) + if ((event == EVENT_LBUTTONDOWN) && ((abs(roi_corners[i].x - x) < 10)) && (abs(roi_corners[i].y - y) < 10)) { selected_corner_index = i; dragging = true;