Skip to content

Commit 73dc1d6

Browse files
authored
Merge pull request #3377 from ivikhrev/fix-warnings
fix clang warnings
2 parents 98d967b + bb00bff commit 73dc1d6

File tree

16 files changed

+26
-18
lines changed

16 files changed

+26
-18
lines changed

demos/background_subtraction_demo/cpp_gapi/include/custom_kernels.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ G_API_OP(GCalculateMaskRCNNBGMask,
3333

3434
class NNBGReplacer {
3535
public:
36+
NNBGReplacer() = default;
37+
virtual ~NNBGReplacer() = default;
3638
NNBGReplacer(const std::string& model_path);
3739
virtual cv::GMat replace(cv::GMat, const cv::Size&, cv::GMat) = 0;
3840
const std::string& getName() { return m_tag; }

demos/common/cpp/models/src/detection_model_ssd.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ void ModelSSD::prepareMultipleOutputs(std::shared_ptr<ov::Model>& model) {
259259
}
260260
}
261261
else {
262-
throw std::logic_error("Incorrect number of 'boxes' output dimensions, expected 2 or 3, but had " + boxesShape.size());
262+
throw std::logic_error("Incorrect number of 'boxes' output dimensions, expected 2 or 3, but had "
263+
+ std::to_string(boxesShape.size()));
263264
}
264265

265266
ppp.output(outputsNames[0]).tensor().

demos/common/cpp/models/src/detection_model_yolo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void ModelYolo::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
131131

132132
yoloVersion = YOLO_V3;
133133
bool isRegionFound = false;
134-
for (const auto op : model->get_ordered_ops()) {
134+
for (const auto& op : model->get_ordered_ops()) {
135135
if (std::string("RegionYolo") == op->get_type_name()) {
136136
auto regionYolo = std::dynamic_pointer_cast<ov::op::v0::RegionYolo>(op);
137137

@@ -141,7 +141,7 @@ void ModelYolo::prepareInputsOutputs(std::shared_ptr<ov::Model>& model) {
141141
}
142142

143143
const auto& opName = op->get_friendly_name();
144-
for (const auto out : outputs) {
144+
for (const auto& out : outputs) {
145145
if (out.get_node()->get_friendly_name() == opName ||
146146
out.get_node()->get_input_node_ptr(0)->get_friendly_name() == opName) {
147147
isRegionFound = true;

demos/common/cpp/utils/include/utils/common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ inline void logBasicModelInfo(const std::shared_ptr<ov::Model>& model) {
172172
ov::OutputVector outputs = model->outputs();
173173

174174
slog::info << "\tInputs: " << slog::endl;
175-
for (const ov::Output<ov::Node> input : inputs) {
175+
for (const ov::Output<ov::Node>& input : inputs) {
176176
const std::string name = input.get_any_name();
177177
const ov::element::Type type = input.get_element_type();
178178
const ov::PartialShape shape = input.get_partial_shape();

demos/common/cpp/utils/include/utils/shared_tensor_allocator.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
#include <opencv2/core.hpp>
2020
#include <openvino/runtime/allocator.hpp>
2121

22-
class SharedTensorAllocator : public ov::AllocatorImpl {
22+
// To prevent false-positive clang compiler warning
23+
// (https://github.com/openvinotoolkit/openvino/pull/11092#issuecomment-1073846256):
24+
// warning: destructor called on non-final 'SharedTensorAllocator' that has virtual functions
25+
// but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
26+
// SharedTensorAllocator class declared as final
27+
28+
class SharedTensorAllocator final : public ov::AllocatorImpl {
2329
public:
2430
SharedTensorAllocator(const cv::Mat& img) : img(img) {}
2531

demos/gesture_recognition_demo/cpp_gapi/include/stream_source.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class GestRecCapSource : public cv::gapi::wip::IStreamSource {
190190
}
191191

192192
/** Put pulled batch to GRunArg data **/
193-
cv::detail::VectorRef ref(std::move(producer.getBatch()));
193+
cv::detail::VectorRef ref(producer.getBatch());
194194
data = std::move(ref);
195195
return true;
196196
}

demos/gesture_recognition_demo/cpp_gapi/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int main(int argc, char *argv[]) {
155155
bool isStart = true;
156156
const auto startTime = std::chrono::steady_clock::now();
157157
pipeline.start();
158-
while (pipeline.pull(std::move(cv::gout(out_frame, out_detections, out_label_number)))) {
158+
while (pipeline.pull(cv::gout(out_frame, out_detections, out_label_number))) {
159159
/** Put FPS to frame**/
160160
if (isStart) {
161161
metrics.update(startTime, out_frame, { 10, 22 }, cv::FONT_HERSHEY_COMPLEX,

demos/gesture_recognition_demo/cpp_gapi/src/custom_kernels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ GAPI_OCV_KERNEL(OCVGestureRecognitionPostprocessing, custom::GestureRecognitionP
202202
int minIdx = 0, maxIdx = 0;
203203
const float* data = asl_result[0].ptr<float>();
204204
// Find more suitable action
205-
cv::minMaxIdx(asl_result[0].reshape(1, {int(asl_result[0].total())}), &min, &max, &minIdx, &maxIdx);
205+
cv::minMaxIdx(asl_result[0].reshape(1, int(asl_result[0].total())), &min, &max, &minIdx, &maxIdx);
206206
if (data[maxIdx] > ar_threshold) {
207207
label_number = maxIdx;
208208
}

demos/interactive_face_detection_demo/cpp_gapi/visualizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ EmotionBarVisualizer::EmotionBarVisualizer(std::vector<std::string> const& emoti
1313
double textScale,
1414
int textThickness):
1515
emotionNames(emotionNames), size(size), padding(padding), opacity(opacity),
16-
textScale(textScale), textThickness(textThickness), internalPadding(0) {
16+
textScale(textScale), textThickness(textThickness) {
1717
auto itMax = std::max_element(emotionNames.begin(), emotionNames.end(), [] (std::string const& lhs, std::string const& rhs) {
1818
return lhs.length() < rhs.length();
1919
});

demos/interactive_face_detection_demo/cpp_gapi/visualizer.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class EmotionBarVisualizer {
3737
double opacity;
3838
double textScale;
3939
int textThickness;
40-
int internalPadding;
4140
};
4241

4342
// Drawing a photo frame around detected face

0 commit comments

Comments
 (0)