Skip to content

Commit 24547f4

Browse files
committed
remove const from functions returning by value
1 parent 08c270f commit 24547f4

File tree

13 files changed

+20
-20
lines changed

13 files changed

+20
-20
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace cv {
1313
CV_EXPORTS const char* depthToString(int depth);
1414

1515
/** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or "<invalid type>" */
16-
CV_EXPORTS const String typeToString(int type);
16+
CV_EXPORTS String typeToString(int type);
1717

1818

1919
//! @cond IGNORED
@@ -23,7 +23,7 @@ namespace detail {
2323
CV_EXPORTS const char* depthToString_(int depth);
2424

2525
/** Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or cv::String() */
26-
CV_EXPORTS const cv::String typeToString_(int type);
26+
CV_EXPORTS cv::String typeToString_(int type);
2727

2828
enum TestOp {
2929
TEST_CUSTOM = 0,

modules/core/include/opencv2/core/utils/plugin_loader.private.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class CV_EXPORTS DynamicLib
147147
return handle != NULL;
148148
}
149149
void* getSymbol(const char* symbolName) const;
150-
const std::string getName() const;
150+
std::string getName() const;
151151
private:
152152
void libraryLoad(const FileSystemPath_t& filename);
153153
void libraryRelease();

modules/core/src/check.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const char* depthToString(int depth)
1414
return s ? s : "<invalid depth>";
1515
}
1616

17-
const cv::String typeToString(int type)
17+
cv::String typeToString(int type)
1818
{
1919
cv::String s = detail::typeToString_(type);
2020
if (s.empty())
@@ -47,7 +47,7 @@ const char* depthToString_(int depth)
4747
return (depth <= CV_16F && depth >= 0) ? depthNames[depth] : NULL;
4848
}
4949

50-
const cv::String typeToString_(int type)
50+
cv::String typeToString_(int type)
5151
{
5252
int depth = CV_MAT_DEPTH(type);
5353
int cn = CV_MAT_CN(type);

modules/core/src/ocl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static const bool CV_OPENCL_DISABLE_BUFFER_RECT_OPERATIONS = utils::getConfigura
231231
#endif
232232
);
233233

234-
static const String getBuildExtraOptions()
234+
static String getBuildExtraOptions()
235235
{
236236
static String param_buildExtraOptions;
237237
static bool initialized = false;

modules/core/src/utils/plugin_loader.impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void* DynamicLib::getSymbol(const char* symbolName) const
5656
return res;
5757
}
5858

59-
const std::string DynamicLib::getName() const
59+
std::string DynamicLib::getName() const
6060
{
6161
return toPrintablePath(fname);
6262
}

modules/dnn/src/onnx/onnx_importer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class ONNXImporter
205205
bool param = utils::getConfigurationParameterBool("OPENCV_DNN_ONNX_USE_LEGACY_NAMES", false);
206206
return param;
207207
}
208-
const std::string extractNodeName(const opencv_onnx::NodeProto& node_proto);
208+
std::string extractNodeName(const opencv_onnx::NodeProto& node_proto);
209209
};
210210

211211

@@ -922,7 +922,7 @@ const ONNXImporter::DispatchMap& ONNXImporter::getDispatchMap(const opencv_onnx:
922922
return it->second;
923923
}
924924

925-
const std::string ONNXImporter::extractNodeName(const opencv_onnx::NodeProto& node_proto)
925+
std::string ONNXImporter::extractNodeName(const opencv_onnx::NodeProto& node_proto)
926926
{
927927
// We need to rework DNN outputs API, this is a workaround for #21698
928928
if (node_proto.has_name() && !node_proto.name().empty())

modules/dnn/src/tensorflow/tf_importer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class TFImporter
568568
typedef std::map<std::string, TFImporterNodeParser> DispatchMap;
569569

570570
const DispatchMap dispatch;
571-
static const DispatchMap buildDispatchMap();
571+
static DispatchMap buildDispatchMap();
572572

573573
void parseConvolution (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams);
574574
void parseBias (tensorflow::GraphDef& net, const tensorflow::NodeDef& layer, LayerParams& layerParams);
@@ -645,7 +645,7 @@ class TFLayerHandler : public detail::LayerHandler
645645
TFImporter* importer;
646646
};
647647

648-
const TFImporter::DispatchMap TFImporter::buildDispatchMap()
648+
TFImporter::DispatchMap TFImporter::buildDispatchMap()
649649
{
650650
static DispatchMap dispatch;
651651
dispatch["Conv2D"] = dispatch["SpaceToBatchND"] = dispatch["DepthwiseConv2dNative"] =

modules/features2d/include/opencv2/features2d.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,8 +1143,8 @@ class CV_EXPORTS_W DescriptorMatcher : public Algorithm
11431143
virtual void clear();
11441144

11451145
const Mat& getDescriptors() const;
1146-
const Mat getDescriptor( int imgIdx, int localDescIdx ) const;
1147-
const Mat getDescriptor( int globalDescIdx ) const;
1146+
Mat getDescriptor( int imgIdx, int localDescIdx ) const;
1147+
Mat getDescriptor( int globalDescIdx ) const;
11481148
void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const;
11491149

11501150
int size() const;

modules/features2d/src/matchers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void DescriptorMatcher::DescriptorCollection::clear()
475475
mergedDescriptors.release();
476476
}
477477

478-
const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int imgIdx, int localDescIdx ) const
478+
Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int imgIdx, int localDescIdx ) const
479479
{
480480
CV_Assert( imgIdx < (int)startIdxs.size() );
481481
int globalIdx = startIdxs[imgIdx] + localDescIdx;
@@ -489,7 +489,7 @@ const Mat& DescriptorMatcher::DescriptorCollection::getDescriptors() const
489489
return mergedDescriptors;
490490
}
491491

492-
const Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const
492+
Mat DescriptorMatcher::DescriptorCollection::getDescriptor( int globalDescIdx ) const
493493
{
494494
CV_Assert( globalDescIdx < size() );
495495
return mergedDescriptors.row( globalDescIdx );

modules/gapi/include/opencv2/gapi/fluid/gfluidkernel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ template<> struct fluid_get_in<cv::GMat>
181181
template<> struct fluid_get_in<cv::GScalar>
182182
{
183183
// FIXME: change to return by reference when moved to own::Scalar
184-
static const cv::Scalar get(const cv::GArgs &in_args, int idx)
184+
static cv::Scalar get(const cv::GArgs &in_args, int idx)
185185
{
186186
return in_args[idx].unsafe_get<cv::Scalar>();
187187
}

0 commit comments

Comments
 (0)