diff --git a/modules/gapi/src/api/s11n.cpp b/modules/gapi/src/api/s11n.cpp index 989cc79118..b86cd8f278 100644 --- a/modules/gapi/src/api/s11n.cpp +++ b/modules/gapi/src/api/s11n.cpp @@ -141,5 +141,4 @@ cv::GRunArg cv::gapi::bind(cv::GRunArgP &out) GAPI_Error("This value type is UNKNOWN!"); break; } - return cv::GRunArg(); } diff --git a/modules/gapi/src/backends/common/serialization.cpp b/modules/gapi/src/backends/common/serialization.cpp index 6fe924e61b..a9cfd1a564 100644 --- a/modules/gapi/src/backends/common/serialization.cpp +++ b/modules/gapi/src/backends/common/serialization.cpp @@ -206,22 +206,20 @@ IOStream& operator<< (IOStream& os, const cv::RMat& mat) { mat.serialize(os); return os; } -IIStream& operator>> (IIStream& is, cv::RMat&) { +IIStream& operator>> (IIStream&, cv::RMat&) { util::throw_error(std::logic_error("operator>> for RMat should never be called. " "Instead, cv::gapi::deserialize() " "should be used")); - return is; } IOStream& operator<< (IOStream& os, const cv::MediaFrame &frame) { frame.serialize(os); return os; } -IIStream& operator>> (IIStream& is, cv::MediaFrame &) { +IIStream& operator>> (IIStream&, cv::MediaFrame &) { util::throw_error(std::logic_error("operator>> for MediaFrame should never be called. " "Instead, cv::gapi::deserialize() " "should be used")); - return is; } namespace @@ -400,22 +398,19 @@ IOStream& operator<< (IOStream& os, const cv::UMat &) GAPI_Error("Serialization: Unsupported << for UMat"); return os; } -IIStream& operator >> (IIStream& is, cv::UMat &) +IIStream& operator >> (IIStream&, cv::UMat &) { GAPI_Error("Serialization: Unsupported >> for UMat"); - return is; } #endif // !defined(GAPI_STANDALONE) -IOStream& operator<< (IOStream& os, const cv::gapi::wip::IStreamSource::Ptr &) +IOStream& operator<< (IOStream&, const cv::gapi::wip::IStreamSource::Ptr &) { GAPI_Error("Serialization: Unsupported << for IStreamSource::Ptr"); - return os; } -IIStream& operator >> (IIStream& is, cv::gapi::wip::IStreamSource::Ptr &) +IIStream& operator >> (IIStream&, cv::gapi::wip::IStreamSource::Ptr &) { - GAPI_Assert("Serialization: Unsupported >> for IStreamSource::Ptr"); - return is; + GAPI_Error("Serialization: Unsupported >> for IStreamSource::Ptr"); } namespace diff --git a/modules/gapi/src/backends/fluid/gfluidbackend.cpp b/modules/gapi/src/backends/fluid/gfluidbackend.cpp index d24dcd599a..f363c6165c 100644 --- a/modules/gapi/src/backends/fluid/gfluidbackend.cpp +++ b/modules/gapi/src/backends/fluid/gfluidbackend.cpp @@ -313,7 +313,7 @@ static int maxLineConsumption(const cv::GFluidKernel::Kind kind, int window, int } } break; case cv::GFluidKernel::Kind::YUV420toRGB: return inPort == 0 ? 2 : 1; break; - default: GAPI_Error("InternalError"); return 0; + default: GAPI_Error("InternalError"); } } @@ -325,7 +325,7 @@ static int borderSize(const cv::GFluidKernel::Kind kind, int window) // Resize never reads from border pixels case cv::GFluidKernel::Kind::Resize: return 0; break; case cv::GFluidKernel::Kind::YUV420toRGB: return 0; break; - default: GAPI_Error("InternalError"); return 0; + default: GAPI_Error("InternalError"); } } diff --git a/modules/gapi/src/backends/fluid/gfluidbuffer.cpp b/modules/gapi/src/backends/fluid/gfluidbuffer.cpp index 2bdbbbecd6..6cbe2dc369 100644 --- a/modules/gapi/src/backends/fluid/gfluidbuffer.cpp +++ b/modules/gapi/src/backends/fluid/gfluidbuffer.cpp @@ -90,7 +90,7 @@ void fillBorderConstant(int borderSize, cv::Scalar borderValue, cv::Mat& mat) case CV_16S: return &fillConstBorderRow< int16_t>; break; case CV_16U: return &fillConstBorderRow; break; case CV_32F: return &fillConstBorderRow< float >; break; - default: GAPI_Error("InternalError"); return &fillConstBorderRow; + default: GAPI_Error("InternalError"); } }; diff --git a/modules/gapi/src/executor/gstreamingexecutor.cpp b/modules/gapi/src/executor/gstreamingexecutor.cpp index 6a397faca6..67ad18dfa2 100644 --- a/modules/gapi/src/executor/gstreamingexecutor.cpp +++ b/modules/gapi/src/executor/gstreamingexecutor.cpp @@ -1830,7 +1830,6 @@ bool cv::gimpl::GStreamingExecutor::pull(cv::GRunArgsP &&outs) default: GAPI_Error("Unsupported cmd type in pull"); } - GAPI_Error("Unreachable code"); } bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP &&outs) diff --git a/modules/gapi/test/streaming/gapi_streaming_tests.cpp b/modules/gapi/test/streaming/gapi_streaming_tests.cpp index 10f8df820f..343790cc88 100644 --- a/modules/gapi/test/streaming/gapi_streaming_tests.cpp +++ b/modules/gapi/test/streaming/gapi_streaming_tests.cpp @@ -327,7 +327,6 @@ public: if (m_curr_frame_id % m_throw_every_nth_frame == 0) { throw std::logic_error(InvalidSource::exception_msg()); - return true; } else { d = cv::Mat(m_mat); }