1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #22935 from alalek:gapi_error

G-API: replace GAPI_Assert() with 'false' and '0' to GAPI_Error()

* gapi: GAPI_Error() macro

* gapi: replace GAPI_Assert() with 'false' and '0' to GAPI_Error()

* build: eliminate 'unreachable code' after CV_Error() (MSVC 2015)

* build: eliminate 'unreachable code' warning for MSVS 2015/2017

- observed in constructors stubs with throwing exception
This commit is contained in:
Alexander Alekhin
2022-12-19 09:05:15 +03:00
committed by GitHub
parent 420db56ffd
commit 91998d6424
72 changed files with 254 additions and 238 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ cv::gimpl::GExecutor::GExecutor(std::unique_ptr<ade::Graph> &&g_model)
break;
default:
GAPI_Assert(false);
GAPI_Error("InternalError");
break;
} // switch(kind)
} // for(gim nodes)
@@ -248,7 +248,7 @@ void cv::gimpl::GExecutor::initResource(const ade::NodeHandle & nh, const ade::N
break;
}
default:
GAPI_Assert(false);
GAPI_Error("InternalError");
}
}
@@ -157,7 +157,7 @@ void sync_data(cv::GRunArgs &results, cv::GRunArgsP &outputs)
*cv::util::get<cv::MediaFrame*>(out_obj) = std::move(cv::util::get<cv::MediaFrame>(res_obj));
break;
default:
GAPI_Assert(false && "This value type is not supported!"); // ...maybe because of STANDALONE mode.
GAPI_Error("This value type is not supported!"); // ...maybe because of STANDALONE mode.
break;
}
}
@@ -227,7 +227,7 @@ void sync_data(cv::gimpl::stream::Result &r, cv::GOptRunArgsP &outputs)
} break;
default:
// ...maybe because of STANDALONE mode.
GAPI_Assert(false && "This value type is not supported!");
GAPI_Error("This value type is not supported!");
break;
}
}
@@ -446,7 +446,7 @@ cv::gimpl::StreamMsg QueueReader::getInputVector(std::vector<Q*> &in_queues,
break;
}
default:
GAPI_Assert(false && "Unsupported cmd type in getInputVector()");
GAPI_Error("Unsupported cmd type in getInputVector()");
}
} // for(in_queues)
@@ -920,7 +920,7 @@ class StreamingOutput final: public cv::gimpl::GIslandExecutable::IOutput
m_stops_sent++;
break;
default:
GAPI_Assert(false && "Unreachable code");
GAPI_Error("Unreachable code");
}
for (auto &&q : m_out_queues[out_idx])
@@ -1115,7 +1115,7 @@ void collectorThread(std::vector<Q*> in_queues,
out_queue.push(Cmd{cv::util::get<cv::gimpl::Exception>(result)});
break;
default:
GAPI_Assert(false && "Unreachable code");
GAPI_Error("Unreachable code");
}
}
}
@@ -1479,7 +1479,7 @@ cv::gimpl::GStreamingExecutor::GStreamingExecutor(std::unique_ptr<ade::Graph> &&
}
break;
default:
GAPI_Assert(false);
GAPI_Error("InternalError");
break;
} // switch(kind)
} // for(gim nodes)
@@ -1820,9 +1820,9 @@ bool cv::gimpl::GStreamingExecutor::pull(cv::GRunArgsP &&outs)
return true;
}
default:
GAPI_Assert(false && "Unsupported cmd type in pull");
GAPI_Error("Unsupported cmd type in pull");
}
GAPI_Assert(false && "Unreachable code");
GAPI_Error("Unreachable code");
}
bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP &&outs)
@@ -1853,7 +1853,7 @@ bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP &&outs)
return true;
}
}
GAPI_Assert(false && "Unreachable code");
GAPI_Error("Unreachable code");
}
cv::gimpl::GAbstractStreamingExecutor::PyPullResult cv::gimpl::GStreamingExecutor::pull()