The following issues were found

modules/gapi/samples/semantic_segmentation.cpp
1 issues
syntax error
Error

Line: 106

                  }
};

GAPI_OCV_KERNEL(OCVPostProcessing, PostProcessing) {
    static void run(const cv::Mat &in, const cv::Mat &out_blob, cv::Mat &out) {
        cv::Mat classes;
        // NB: If output has more than single plane, it contains probabilities
        // otherwise class id.
        if (out_blob.size[1] > 1) {

            

Reported by Cppcheck.

modules/gapi/samples/text_detection.cpp
1 issues
syntax error
Error

Line: 222

              // Define custom operations
using GSize = cv::GOpaque<cv::Size>;
using GRRects = cv::GArray<cv::RotatedRect>;
G_API_OP(PostProcess,
        <GRRects(cv::GMat,cv::GMat,GSize,float,float)>,
        "sample.custom.text.post_proc") {
    static cv::GArrayDesc outMeta(const cv::GMatDesc &,
                                  const cv::GMatDesc &,
                                  const cv::GOpaqueDesc &,

            

Reported by Cppcheck.

modules/gapi/src/backends/fluid/gfluidcore.cpp
1 issues
syntax error
Error

Line: 255

                      out[x] = addWeighted<DST>(in1[x], in2[x], _alpha, _beta, _gamma);
}

GAPI_FLUID_KERNEL(GFluidAddW, cv::gapi::core::GAddW, false)
{
    static const int Window = 1;

    static void run(const View &src1, double alpha, const View &src2,
                                      double beta, double gamma, int /*dtype*/,

            

Reported by Cppcheck.

modules/gapi/src/backends/fluid/gfluidimgproc.cpp
1 issues
syntax error
Error

Line: 73

                  run_rgb2gray_impl(out, in, width, coef_r, coef_g, coef_b);
}

GAPI_FLUID_KERNEL(GFluidRGB2GrayCustom, cv::gapi::imgproc::GRGB2GrayCustom, false)
{
    static const int Window = 1;

    static void run(const View &src, float coef_r, float coef_g, float coef_b, Buffer &dst)
    {

            

Reported by Cppcheck.

modules/gapi/test/common/gapi_compoundkernel_tests.cpp
1 issues
syntax error
Error

Line: 24

                      static GMatDesc outMeta(GMatDesc in, GScalarDesc) { return in; }
    };

    GAPI_COMPOUND_KERNEL(GCompoundDoubleAddCImpl, GCompoundDoubleAddC)
    {
        static GMat expand(cv::GMat in, cv::GScalar s)
        {
            return cv::gapi::addC(cv::gapi::addC(in, s), s);
        }

            

Reported by Cppcheck.

modules/gapi/test/common/gapi_render_tests.hpp
1 issues
failed to expand 'GAPI_RENDER_TEST_FIXTURES', Wrong number of parameters for macro '__WRAP_VAARGS'.
Error

Line: 121

                  };                                                            \
};

#define GAPI_RENDER_TEST_FIXTURE_BGR(Fixture, API, Number, ...)  \
struct Fixture : public RenderBGRTestBase API {                  \
    __WRAP_VAARGS(DEFINE_SPECIFIC_PARAMS_##Number(__VA_ARGS__))   \
    Fixture() {                                                   \
        Init(sz_);                                                \
    };                                                            \

            

Reported by Cppcheck.

modules/gapi/test/cpu/gapi_ocv_stateful_kernel_tests.cpp
1 issues
syntax error
Error

Line: 62

              #endif // WINRT
    }

    G_TYPED_KERNEL(GCountCalls, <cv::GOpaque<int>(GMat)>, "org.opencv.test.count_calls")
    {
        static GOpaqueDesc outMeta(GMatDesc /* in */) { return empty_gopaque_desc(); }
    };

    GAPI_OCV_KERNEL_ST(GOCVCountCalls, GCountCalls, int)

            

Reported by Cppcheck.

modules/gapi/test/executor/gtbbexecutor_internal_tests.cpp
1 issues
syntax error
Error

Line: 56

                  EXPECT_EQ(true, executed);
}

TEST(TBBExecutor, SerialExecution) {
    using namespace cv::gimpl::parallel;
    const int n = 10;
    prio_items_queue_t q;
    std::vector<tile_node> nodes; nodes.reserve(n+1);
    std::vector<std::thread::id> thread_id(n);

            

Reported by Cppcheck.

modules/gapi/test/gapi_array_tests.cpp
1 issues
syntax error
Error

Line: 23

              {
    static GArrayDesc outMeta(const GMatDesc&) { return empty_array_desc(); }
};
G_TYPED_KERNEL(FindCorners,    <GPointArray(GMat)>, "test.array.out")
{
    static GArrayDesc outMeta(const GMatDesc&) { return empty_array_desc(); }
};
G_TYPED_KERNEL(CountCorners,   <GScalar(GPointArray)>,  "test.array.in")
{

            

Reported by Cppcheck.

modules/gapi/test/gapi_async_test.cpp
1 issues
syntax error
Error

Line: 72

                      using std::runtime_error::runtime_error;
    };

    GAPI_OCV_KERNEL(GThrowImpl, GThrow)
    {
        static void run(const cv::Mat& in, cv::Mat&)
        {
            //this condition is needed to avoid "Unreachable code" warning on windows inside OCVCallHelper
            if (!in.empty())

            

Reported by Cppcheck.