[opencv] 26/89: Fixed several GCC 5.x warnings
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Sat May 13 09:57:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to annotated tag 2.4.13.2
in repository opencv.
commit 21167b1bf1b8471101732073d9b4803b80fe0ce4
Author: Maksim Shabunin <maksim.shabunin at gmail.com>
Date: Wed Aug 31 23:12:52 2016 +0300
Fixed several GCC 5.x warnings
---
3rdparty/libtiff/CMakeLists.txt | 4 ++--
3rdparty/openexr/CMakeLists.txt | 4 ++--
cmake/OpenCVCompilerOptions.cmake | 1 +
modules/calib3d/src/calibinit.cpp | 4 +++-
modules/calib3d/test/test_cameracalibration.cpp | 2 ++
modules/core/include/opencv2/core/cuda_devptrs.hpp | 23 +++++++++-------------
modules/core/include/opencv2/core/gpumat.hpp | 7 +++----
modules/core/include/opencv2/core/internal.hpp | 2 +-
modules/core/include/opencv2/core/types_c.h | 9 +++++++++
modules/core/test/test_ds.cpp | 2 +-
modules/flann/include/opencv2/flann/any.h | 2 +-
modules/flann/include/opencv2/flann/flann.hpp | 23 ++++++++++++----------
modules/highgui/src/cap_v4l.cpp | 11 +++++------
modules/legacy/test/test_optflow.cpp | 11 +++++++----
modules/legacy/test/test_stereomatching.cpp | 2 ++
modules/ocl/src/mssegmentation.cpp | 11 ++---------
modules/ocl/test/utility.hpp | 2 +-
modules/stitching/src/matchers.cpp | 1 +
modules/ts/include/opencv2/ts/gpu_test.hpp | 2 +-
modules/ts/include/opencv2/ts/ts_gtest.h | 4 ++--
modules/ts/src/ts_func.cpp | 4 ++--
21 files changed, 70 insertions(+), 61 deletions(-)
diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt
index 7d7feba..a241dd6 100644
--- a/3rdparty/libtiff/CMakeLists.txt
+++ b/3rdparty/libtiff/CMakeLists.txt
@@ -86,7 +86,7 @@ else()
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
- -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
+ -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd4706) # vs2005
@@ -95,7 +95,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
-ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
+ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt
index 85f750d..dddf373 100644
--- a/3rdparty/openexr/CMakeLists.txt
+++ b/3rdparty/openexr/CMakeLists.txt
@@ -37,8 +37,8 @@ endif()
source_group("Include" FILES ${lib_hdrs} )
source_group("Src" FILES ${lib_srcs})
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra)
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-declarations)
+ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra
+ -Wdeprecated-declarations -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
index 3f7cbf2..499061e 100644
--- a/cmake/OpenCVCompilerOptions.cmake
+++ b/cmake/OpenCVCompilerOptions.cmake
@@ -95,6 +95,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-Wno-narrowing)
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
add_extra_compiler_option(-Wno-unnamed-type-template-args)
+ add_extra_compiler_option(-Wno-comment)
add_extra_compiler_option(-Wno-array-bounds)
add_extra_compiler_option(-Wno-aggressive-loop-optimizations)
endif()
diff --git a/modules/calib3d/src/calibinit.cpp b/modules/calib3d/src/calibinit.cpp
index 000ac54..a189213 100644
--- a/modules/calib3d/src/calibinit.cpp
+++ b/modules/calib3d/src/calibinit.cpp
@@ -1036,13 +1036,15 @@ icvRemoveQuadFromGroup(CvCBQuad **quads, int count, CvCBQuad *q0)
q->neighbors[j] = 0;
q->count--;
for(int k = 0; k < 4; k++ )
+ {
if( q0->neighbors[k] == q )
{
q0->neighbors[k] = 0;
q0->count--;
break;
}
- break;
+ }
+ break;
}
}
}
diff --git a/modules/calib3d/test/test_cameracalibration.cpp b/modules/calib3d/test/test_cameracalibration.cpp
index 0cc5701..d358e8f 100644
--- a/modules/calib3d/test/test_cameracalibration.cpp
+++ b/modules/calib3d/test/test_cameracalibration.cpp
@@ -1339,6 +1339,7 @@ bool CV_StereoCalibrationTest::checkPandROI( int test_case_idx, const Mat& M, co
undistortPoints(Mat(pts), upts, M, D, R, P );
for( k = 0; k < N*N; k++ )
+ {
if( upts[k].x < -imgsize.width*eps || upts[k].x > imgsize.width*(1+eps) ||
upts[k].y < -imgsize.height*eps || upts[k].y > imgsize.height*(1+eps) )
{
@@ -1346,6 +1347,7 @@ bool CV_StereoCalibrationTest::checkPandROI( int test_case_idx, const Mat& M, co
test_case_idx, pts[k].x, pts[k].y, upts[k].x, upts[k].y);
return false;
}
+ }
// step 2. check that all the points inside ROI belong to the original source image
Mat temp(imgsize, CV_8U), utemp, map1, map2;
diff --git a/modules/core/include/opencv2/core/cuda_devptrs.hpp b/modules/core/include/opencv2/core/cuda_devptrs.hpp
index 1534045..d54a328 100644
--- a/modules/core/include/opencv2/core/cuda_devptrs.hpp
+++ b/modules/core/include/opencv2/core/cuda_devptrs.hpp
@@ -122,27 +122,23 @@ namespace cv
typedef PtrStep<float> PtrStepf;
typedef PtrStep<int> PtrStepi;
-
#if defined __GNUC__
- #define __CV_GPU_DEPR_BEFORE__
- #define __CV_GPU_DEPR_AFTER__ __attribute__ ((deprecated))
+ #define CV_GPU_DEPRECATED __attribute__ ((deprecated))
#elif defined(__MSVC__) //|| defined(__CUDACC__)
#pragma deprecated(DevMem2D_)
- #define __CV_GPU_DEPR_BEFORE__ __declspec(deprecated)
- #define __CV_GPU_DEPR_AFTER__
+ #define CV_GPU_DEPRECATED __declspec(deprecated)
#else
- #define __CV_GPU_DEPR_BEFORE__
- #define __CV_GPU_DEPR_AFTER__
+ #define CV_GPU_DEPRECATED
#endif
- template <typename T> struct __CV_GPU_DEPR_BEFORE__ DevMem2D_ : public PtrStepSz<T>
+ template <typename T> struct DevMem2D_ : public PtrStepSz<T>
{
- DevMem2D_() {}
- DevMem2D_(int rows_, int cols_, T* data_, size_t step_) : PtrStepSz<T>(rows_, cols_, data_, step_) {}
+ CV_GPU_DEPRECATED DevMem2D_() {}
+ CV_GPU_DEPRECATED DevMem2D_(int rows_, int cols_, T* data_, size_t step_) : PtrStepSz<T>(rows_, cols_, data_, step_) {}
template <typename U>
- explicit __CV_GPU_DEPR_BEFORE__ DevMem2D_(const DevMem2D_<U>& d) : PtrStepSz<T>(d.rows, d.cols, (T*)d.data, d.step) {}
- } __CV_GPU_DEPR_AFTER__ ;
+ explicit CV_GPU_DEPRECATED DevMem2D_(const DevMem2D_<U>& d) : PtrStepSz<T>(d.rows, d.cols, (T*)d.data, d.step) {}
+ };
typedef DevMem2D_<unsigned char> DevMem2Db;
typedef DevMem2Db DevMem2D;
@@ -174,8 +170,7 @@ namespace cv
typedef PtrElemStep_<float> PtrElemStepf;
typedef PtrElemStep_<int> PtrElemStepi;
-//#undef __CV_GPU_DEPR_BEFORE__
-//#undef __CV_GPU_DEPR_AFTER__
+//#undef CV_GPU_DEPRECATED
namespace device
{
diff --git a/modules/core/include/opencv2/core/gpumat.hpp b/modules/core/include/opencv2/core/gpumat.hpp
index 68647d9..6679ab2 100644
--- a/modules/core/include/opencv2/core/gpumat.hpp
+++ b/modules/core/include/opencv2/core/gpumat.hpp
@@ -277,10 +277,9 @@ namespace cv { namespace gpu
template <typename _Tp> operator PtrStep<_Tp>() const;
// Deprecated function
- __CV_GPU_DEPR_BEFORE__ template <typename _Tp> operator DevMem2D_<_Tp>() const __CV_GPU_DEPR_AFTER__;
- __CV_GPU_DEPR_BEFORE__ template <typename _Tp> operator PtrStep_<_Tp>() const __CV_GPU_DEPR_AFTER__;
- #undef __CV_GPU_DEPR_BEFORE__
- #undef __CV_GPU_DEPR_AFTER__
+ template <typename _Tp> CV_GPU_DEPRECATED operator DevMem2D_<_Tp>() const;
+ template <typename _Tp> CV_GPU_DEPRECATED operator PtrStep_<_Tp>() const;
+ #undef CV_GPU_DEPRECATED
/*! includes several bit-fields:
- the magic signature
diff --git a/modules/core/include/opencv2/core/internal.hpp b/modules/core/include/opencv2/core/internal.hpp
index c2c8961..4933654 100644
--- a/modules/core/include/opencv2/core/internal.hpp
+++ b/modules/core/include/opencv2/core/internal.hpp
@@ -292,7 +292,7 @@ namespace cv
return classname##_info_var; \
} \
\
- static ::cv::AlgorithmInfo& classname##_info_auto = classname##_info(); \
+ CV_ATTR_USED static ::cv::AlgorithmInfo& classname##_info_auto = classname##_info(); \
\
::cv::AlgorithmInfo* classname::info() const \
{ \
diff --git a/modules/core/include/opencv2/core/types_c.h b/modules/core/include/opencv2/core/types_c.h
index 771715d..0e2de71 100644
--- a/modules/core/include/opencv2/core/types_c.h
+++ b/modules/core/include/opencv2/core/types_c.h
@@ -43,6 +43,15 @@
#ifndef __OPENCV_CORE_TYPES_H__
#define __OPENCV_CORE_TYPES_H__
+#if defined(__GNUC__) && !defined(COMPILER_ICC)
+# define CV_ATTR_UNUSED __attribute__((unused))
+# define CV_ATTR_USED __attribute__((used))
+#else
+# define CV_ATTR_UNUSED
+# define CV_ATTR_USED
+#endif
+
+
#if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER
# if _MSC_VER > 1300
# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */
diff --git a/modules/core/test/test_ds.cpp b/modules/core/test/test_ds.cpp
index ded5258..bbe75ad 100644
--- a/modules/core/test/test_ds.cpp
+++ b/modules/core/test/test_ds.cpp
@@ -56,7 +56,7 @@ static void cvTsSimpleSeqShiftAndCopy( CvTsSimpleSeq* seq, int from_idx, int to_
(seq->count - from_idx)*elem_size );
}
seq->count += to_idx - from_idx;
- if( elem && to_idx > from_idx )
+ if( elem )
memcpy( seq->array + from_idx*elem_size, elem, (to_idx - from_idx)*elem_size );
}
diff --git a/modules/flann/include/opencv2/flann/any.h b/modules/flann/include/opencv2/flann/any.h
index 7e3fd79..cf7707a 100644
--- a/modules/flann/include/opencv2/flann/any.h
+++ b/modules/flann/include/opencv2/flann/any.h
@@ -80,7 +80,7 @@ struct big_any_policy : typed_base_any_policy<T>
{
virtual void static_delete(void** x)
{
- if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
+ if (* x) { delete (* reinterpret_cast<T**>(x)); *x = NULL; }
}
virtual void copy_from_value(void const* src, void** dest)
{
diff --git a/modules/flann/include/opencv2/flann/flann.hpp b/modules/flann/include/opencv2/flann/flann.hpp
index d053488..3b5634c 100644
--- a/modules/flann/include/opencv2/flann/flann.hpp
+++ b/modules/flann/include/opencv2/flann/flann.hpp
@@ -225,43 +225,49 @@ int GenericIndex<Distance>::radiusSearch(const Mat& query, Mat& indices, Mat& di
* @deprecated Use GenericIndex class instead
*/
template <typename T>
-class
-#ifndef _MSC_VER
- FLANN_DEPRECATED
-#endif
- Index_ {
+class Index_ {
public:
typedef typename L2<T>::ElementType ElementType;
typedef typename L2<T>::ResultType DistanceType;
+ FLANN_DEPRECATED
Index_(const Mat& features, const ::cvflann::IndexParams& params);
+ FLANN_DEPRECATED
~Index_();
+ FLANN_DEPRECATED
void knnSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
int radiusSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& params);
+ FLANN_DEPRECATED
void save(std::string filename)
{
if (nnIndex_L1) nnIndex_L1->save(filename);
if (nnIndex_L2) nnIndex_L2->save(filename);
}
+ FLANN_DEPRECATED
int veclen() const
{
if (nnIndex_L1) return nnIndex_L1->veclen();
if (nnIndex_L2) return nnIndex_L2->veclen();
}
+ FLANN_DEPRECATED
int size() const
{
if (nnIndex_L1) return nnIndex_L1->size();
if (nnIndex_L2) return nnIndex_L2->size();
}
+ FLANN_DEPRECATED
::cvflann::IndexParams getParameters()
{
if (nnIndex_L1) return nnIndex_L1->getParameters();
@@ -269,7 +275,8 @@ public:
}
- FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()
+ FLANN_DEPRECATED
+ const ::cvflann::IndexParams* getIndexParameters()
{
if (nnIndex_L1) return nnIndex_L1->getIndexParameters();
if (nnIndex_L2) return nnIndex_L2->getIndexParameters();
@@ -281,10 +288,6 @@ private:
::cvflann::Index< L1<ElementType> >* nnIndex_L1;
};
-#ifdef _MSC_VER
-template <typename T>
-class FLANN_DEPRECATED Index_;
-#endif
template <typename T>
Index_<T>::Index_(const Mat& dataset, const ::cvflann::IndexParams& params)
diff --git a/modules/highgui/src/cap_v4l.cpp b/modules/highgui/src/cap_v4l.cpp
index 4093219..ed5c09c 100644
--- a/modules/highgui/src/cap_v4l.cpp
+++ b/modules/highgui/src/cap_v4l.cpp
@@ -380,12 +380,11 @@ static void icvInitCapture_V4L() {
deviceHandle = open(deviceName, O_RDONLY);
if (deviceHandle != -1) {
/* This device does indeed exist - add it to the total so far */
- // add indexList
- indexList|=(1 << CameraNumber);
- numCameras++;
- }
- if (deviceHandle != -1)
- close(deviceHandle);
+ // add indexList
+ indexList|=(1 << CameraNumber);
+ numCameras++;
+ close(deviceHandle);
+ }
/* Set up to test the next /dev/video source in line */
CameraNumber++;
} /* End while */
diff --git a/modules/legacy/test/test_optflow.cpp b/modules/legacy/test/test_optflow.cpp
index 3d74ff6..4eb0a13 100644
--- a/modules/legacy/test/test_optflow.cpp
+++ b/modules/legacy/test/test_optflow.cpp
@@ -166,6 +166,7 @@ double showFlowAndCalcError(const string& name, const Mat& gray, const Mat& flow
bool all = true;
Mat inner = flow(where);
for(int y = 0; y < inner.rows; ++y)
+ {
for(int x = 0; x < inner.cols; ++x)
{
const Point2f f = inner.at<Point2f>(y, x);
@@ -178,12 +179,14 @@ double showFlowAndCalcError(const string& name, const Mat& gray, const Mat& flow
double a = atan2(f.y, f.x);
error += fabs(angle - a);
}
- double res = all ? numeric_limits<double>::max() : error / (inner.cols * inner.rows);
+ }
+
+ double res = all ? numeric_limits<double>::max() : error / (inner.cols * inner.rows);
- if (writeError)
- cout << "Error " + name << " = " << res << endl;
+ if (writeError)
+ cout << "Error " + name << " = " << res << endl;
- return res;
+ return res;
}
diff --git a/modules/legacy/test/test_stereomatching.cpp b/modules/legacy/test/test_stereomatching.cpp
index a6524bb..7513bbb 100644
--- a/modules/legacy/test/test_stereomatching.cpp
+++ b/modules/legacy/test/test_stereomatching.cpp
@@ -461,7 +461,9 @@ void CV_StereoMatchingTest::run(int)
int dispScaleFactor = datasetsParams[datasetName].dispScaleFactor;
Mat tmp; trueLeftDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueLeftDisp = tmp; tmp.release();
if( !trueRightDisp.empty() )
+ {
trueRightDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueRightDisp = tmp; tmp.release();
+ }
Mat leftDisp, rightDisp;
int ignBorder = max(runStereoMatchingAlgorithm(leftImg, rightImg, leftDisp, rightDisp, ci), EVAL_IGNORE_BORDER);
diff --git a/modules/ocl/src/mssegmentation.cpp b/modules/ocl/src/mssegmentation.cpp
index 5edca3e..71c793c 100644
--- a/modules/ocl/src/mssegmentation.cpp
+++ b/modules/ocl/src/mssegmentation.cpp
@@ -71,8 +71,8 @@ namespace
vector<int> rank;
vector<int> size;
private:
- DjSets(const DjSets &) {}
- DjSets operator =(const DjSets &);
+ DjSets(const DjSets &); // = delete
+ DjSets& operator =(const DjSets &); // = delete
};
template <typename T>
@@ -139,13 +139,6 @@ namespace
// Implementation
//
- DjSets DjSets::operator = (const DjSets &/*obj*/)
- {
- //cout << "Invalid DjSets constructor\n";
- CV_Error(-1, "Invalid DjSets constructor\n");
- return *this;
- }
-
DjSets::DjSets(int n) : parent(n), rank(n, 0), size(n, 1)
{
for (int i = 0; i < n; ++i)
diff --git a/modules/ocl/test/utility.hpp b/modules/ocl/test/utility.hpp
index 6591456..8766920 100644
--- a/modules/ocl/test/utility.hpp
+++ b/modules/ocl/test/utility.hpp
@@ -296,7 +296,7 @@ CV_FLAGS(DftFlags, DFT_INVERSE, DFT_SCALE, DFT_ROWS, DFT_COMPLEX_OUTPUT, DFT_REA
}; \
\
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
\
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() \
diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp
index e0e4779..29ce8e4 100644
--- a/modules/stitching/src/matchers.cpp
+++ b/modules/stitching/src/matchers.cpp
@@ -50,6 +50,7 @@ using namespace cv::gpu;
#ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree/nonfree.hpp"
+CV_ATTR_USED
static bool makeUseOfNonfree = initModule_nonfree();
#endif
diff --git a/modules/ts/include/opencv2/ts/gpu_test.hpp b/modules/ts/include/opencv2/ts/gpu_test.hpp
index 01737bc..705722a 100644
--- a/modules/ts/include/opencv2/ts/gpu_test.hpp
+++ b/modules/ts/include/opencv2/ts/gpu_test.hpp
@@ -190,7 +190,7 @@ namespace cvtest
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() \
{ \
diff --git a/modules/ts/include/opencv2/ts/ts_gtest.h b/modules/ts/include/opencv2/ts/ts_gtest.h
index 75453d2..0690698 100644
--- a/modules/ts/include/opencv2/ts/ts_gtest.h
+++ b/modules/ts/include/opencv2/ts/ts_gtest.h
@@ -17026,14 +17026,14 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
+ test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
+ int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
GetTestCasePatternHolder<test_case_name>(\
#test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
diff --git a/modules/ts/src/ts_func.cpp b/modules/ts/src/ts_func.cpp
index a4fa5c3..d11fdc3 100644
--- a/modules/ts/src/ts_func.cpp
+++ b/modules/ts/src/ts_func.cpp
@@ -1757,7 +1757,7 @@ cmpUlpsFlt_(const int* src1, const int* src2, size_t total, int imaxdiff, size_t
for( i = 0; i < total; i++ )
{
int a = src1[i], b = src2[i];
- if( a < 0 ) a ^= C; if( b < 0 ) b ^= C;
+ if( a < 0 ) { a ^= C; } if( b < 0 ) { b ^= C; }
int diff = std::abs(a - b);
if( realmaxdiff < diff )
{
@@ -1779,7 +1779,7 @@ cmpUlpsFlt_(const int64* src1, const int64* src2, size_t total, int imaxdiff, si
for( i = 0; i < total; i++ )
{
int64 a = src1[i], b = src2[i];
- if( a < 0 ) a ^= C; if( b < 0 ) b ^= C;
+ if( a < 0 ) { a ^= C; } if( b < 0 ) { b ^= C; }
double diff = fabs((double)a - (double)b);
if( realmaxdiff < diff )
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list