Skip to content

Commit 236ad4a

Browse files
committed
Merge pull request opencv#18441 from alalek:core_check_force_string_literals
2 parents 6256e42 + 233030e commit 236ad4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/core/include/opencv2/core/check.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct CheckContext {
6363
#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
6464
#define CV__DEFINE_CHECK_CONTEXT(id, message, testOp, p1_str, p2_str) \
6565
static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
66-
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, message, p1_str, p2_str }
66+
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
6767

6868
CV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx);
6969
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx);

modules/dnn/src/onnx/onnx_importer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ void ONNXImporter::populateNet(Net dstNet)
446446
avgLp.set("pool", pool);
447447
if (axes.size() == 2)
448448
{
449-
CV_CheckEQ(clamp(axes.get<int>(0), inpShape.size()), 1, ("Unsupported " + layer_type + " mode").c_str());
450-
CV_CheckEQ(clamp(axes.get<int>(1), inpShape.size()), 2, ("Unsupported " + layer_type + " mode").c_str());
449+
CV_CheckEQ(clamp(axes.get<int>(0), inpShape.size()), 1, "Unsupported mode");
450+
CV_CheckEQ(clamp(axes.get<int>(1), inpShape.size()), 2, "Unsupported mode");
451451
avgLp.set("global_pooling", true);
452452
}
453453
else
@@ -489,7 +489,7 @@ void ONNXImporter::populateNet(Net dstNet)
489489
}
490490
else if (!layerParams.has("axes") && (layer_type == "ReduceMean" || layer_type == "ReduceSum" || layer_type == "ReduceMax"))
491491
{
492-
CV_CheckEQ(layerParams.get<int>("keepdims"), 0, (layer_type + " layer only supports keepdims = false").c_str());
492+
CV_CheckEQ(layerParams.get<int>("keepdims"), 0, "layer only supports keepdims = false");
493493
LayerParams reshapeLp;
494494
reshapeLp.name = layerParams.name + "/reshape";
495495
reshapeLp.type = "Reshape";

0 commit comments

Comments
 (0)