Skip to content

Commit 04d8492

Browse files
authored
Merge pull request #3434 from asmorkalov:as/xcode_warning_supression
-Wunused-but-set-variable warnings fix after XCode update with clang 13.1
2 parents 4035046 + b9f0ffd commit 04d8492

File tree

12 files changed

+2
-46
lines changed

12 files changed

+2
-46
lines changed

modules/barcode/src/decoder/ean8_decoder.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Result Ean8Decoder::decode(const vector<uchar> &data) const
2727
uint start = pattern.second;
2828
Counter counter(vector<int>{0, 0, 0, 0});
2929
size_t end = data.size();
30-
int first_char_bit = 0;
3130
for (int i = 0; i < 4 && start < end; ++i)
3231
{
3332
int bestMatch = decodeDigit(data, counter, start, get_A_or_C_Patterns());
@@ -37,7 +36,6 @@ Result Ean8Decoder::decode(const vector<uchar> &data) const
3736
}
3837
decode_result[i] = static_cast<char>('0' + bestMatch % 10);
3938
start = counter.sum + start;
40-
first_char_bit += (bestMatch >= 10) << i;
4139
}
4240

4341
Counter middle_counter(vector<int>(MIDDLE_PATTERN().size()));

modules/ccalib/src/ccalib.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,14 @@ void CustomPattern::check_matches(vector<Point2f>& matched, const vector<Point2f
246246
vector<Point2f> proj;
247247
perspectiveTransform(pattern, proj, H);
248248

249-
int deleted = 0;
250-
double error_sum = 0;
251-
double error_sum_filtered = 0;
252249
for (uint i = 0; i < proj.size(); ++i)
253250
{
254251
double error = norm(matched[i] - proj[i]);
255-
error_sum += error;
256252
if (error >= MAX_PROJ_ERROR_PX)
257253
{
258254
deleteStdVecElem(good, i);
259255
deleteStdVecElem(matched, i);
260256
deleteStdVecElem(pattern_3d, i);
261-
++deleted;
262-
}
263-
else
264-
{
265-
error_sum_filtered += error;
266257
}
267258
}
268259
}

modules/intensity_transform/src/bimef.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ static double minimize_scalar_bounded(const Mat_<float>& I, double begin, double
345345
double rat = 0.0, e = 0.0;
346346
double x = xf;
347347
double fx = -entropy(applyK(I, static_cast<float>(x)));
348-
int num = 1;
349348
double fu = std::numeric_limits<double>::infinity();
350349

351350
double ffulc = fx, fnfc = fx;
@@ -398,7 +397,6 @@ static double minimize_scalar_bounded(const Mat_<float>& I, double begin, double
398397
double si = sgn(rat) + (rat == 0);
399398
x = xf + si * std::max(std::abs(rat), tol1);
400399
fu = -entropy(applyK(I, static_cast<float>(x)));
401-
num += 1;
402400

403401
if (fu <= fx) {
404402
if (x >= xf) {

modules/line_descriptor/src/binary_descriptor_matcher.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
642642
/* number of candidates tested with full codes (not counting duplicates) */
643643
UINT32 nc = 0;
644644

645-
/* counting everything retrieved (duplicates are counted multiple times)
646-
number of lookups (and xors) */
647-
UINT32 nl = 0;
648-
649-
UINT32 nd = 0;
650645
UINT32 *arr;
651646
int size = 0;
652647
UINT32 index;
@@ -672,8 +667,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
672667
else
673668
curb = b - 1;
674669
UINT64 chunksk = chunks[k];
675-
/* number of bit-strings with s number of 1s */
676-
nl += xornum[s + 1] - xornum[s];
677670

678671
/* the bit-string with s number of 1s */
679672
UINT64 bitstr = 0;
@@ -706,7 +699,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
706699
arr = H[k].query( chunksk ^ bitstr, &size ); // lookup
707700
if( size )
708701
{ /* the corresponding bucket is not empty */
709-
nd += size;
710702
for ( int c = 0; c < size; c++ )
711703
{
712704
index = arr[c];

modules/rgbd/src/nonrigid_icp.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,
365365
std::cout << "median: " << med << " from " << residuals.size() << " residuals " << std::endl;
366366
float sigma = MAD_SCALE * median(residuals);
367367

368-
float total_error = 0;
369368
int pix_count = 0;
370369

371370
for(int y = 0; y < oldPoints.size().height; y++)
@@ -395,7 +394,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,
395394

396395
float rd = Nc.at<Vec3f>(y, x).dot(diff);
397396

398-
total_error += tukeyWeight(rd, sigma) * rd * rd;
399397
pix_count++;
400398

401399
int n;

modules/stereo/src/stereo_binary_bm.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,6 @@ namespace cv
341341
}
342342

343343
Mat left = preFilteredImg0, right = preFilteredImg1;
344-
345-
int ndisp = params.numDisparities;
346-
347-
int wsz = params.kernelSize;
348-
int bufSize0 = (int)((ndisp + 2)*sizeof(int));
349-
bufSize0 += (int)((height + wsz + 2)*ndisp*sizeof(int));
350-
bufSize0 += (int)((height + wsz + 2)*sizeof(int));
351-
bufSize0 += (int)((height + wsz + 2)*ndisp*(wsz + 2)*sizeof(uchar) + 256);
352-
353344
int bufSize1 = (int)((width + params.preFilterSize + 2) * sizeof(int) + 256);
354345
if(params.usePrefilter == true)
355346
{

modules/structured_light/src/graycodepattern.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,6 @@ bool GrayCodePattern_Impl::decode( const std::vector< std::vector<Mat> >& patter
259259
Mat& disparityMap_ = *( Mat* ) disparityMap.getObj();
260260
disparityMap_ = Mat( cam_height, cam_width, CV_64F, double( 0 ) );
261261

262-
double number_of_pixels_cam1 = 0;
263-
double number_of_pixels_cam2 = 0;
264-
265262
for( int i = 0; i < params.width; i++ )
266263
{
267264
for( int j = 0; j < params.height; j++ )
@@ -278,8 +275,6 @@ bool GrayCodePattern_Impl::decode( const std::vector< std::vector<Mat> >& patter
278275
double sump1x = 0;
279276
double sump2x = 0;
280277

281-
number_of_pixels_cam1 += cam1Pixs.size();
282-
number_of_pixels_cam2 += cam2Pixs.size();
283278
for( int c1 = 0; c1 < (int) cam1Pixs.size(); c1++ )
284279
{
285280
p1 = cam1Pixs[c1];

modules/tracking/src/multiTracker.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ namespace impl {
279279
Mat tmp;
280280
int dx = initSize.width / 10, dy = initSize.height / 10;
281281
Size2d size = img.size();
282-
double scale = 1.0;
283282
int npos = 0, nneg = 0;
284283
double maxSc = -5.0;
285284
Rect2d maxScRect;
@@ -348,7 +347,6 @@ namespace impl {
348347
scaleID++;
349348
size.width /= tld::SCALE_STEP;
350349
size.height /= tld::SCALE_STEP;
351-
scale *= tld::SCALE_STEP;
352350
resize(img, tmp, size, 0, 0, tld::DOWNSCALE_MODE);
353351
resized_imgs.push_back(tmp);
354352
GaussianBlur(resized_imgs[scaleID], tmp, tld::GaussBlurKernelSize, 0.0f);

modules/tracking/src/tldDetector.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ namespace tld {
363363
Mat tmp;
364364
int dx = initSize.width / 10, dy = initSize.height / 10;
365365
Size2d size = img.size();
366-
double scale = 1.0;
367366
int npos = 0, nneg = 0;
368367
double maxSc = -5.0;
369368
Rect2d maxScRect;
@@ -398,7 +397,6 @@ namespace tld {
398397
scaleID++;
399398
size.width /= SCALE_STEP;
400399
size.height /= SCALE_STEP;
401-
scale *= SCALE_STEP;
402400
resize(img, tmp, size, 0, 0, DOWNSCALE_MODE);
403401
resized_imgs.push_back(tmp);
404402
GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f);

modules/wechat_qrcode/src/zxing/qrcode/detector/detector.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -684,15 +684,14 @@ int Detector::fitLine(vector<Ref<ResultPoint> > &oldPoints, float &k, float &b,
684684
int num = fitPoints.size();
685685
if (num < 2) return -1;
686686

687-
double x = 0, y = 0, xx = 0, xy = 0, yy = 0, tem = 0;
687+
double x = 0, y = 0, xx = 0, xy = 0, tem = 0;
688688
for (int i = 0; i < num; i++) {
689689
int point_x = fitPoints[i]->getX();
690690
int point_y = fitPoints[i]->getY();
691691
x += point_x;
692692
y += point_y;
693693
xx += point_x * point_x;
694694
xy += point_x * point_y;
695-
yy += point_y * point_y;
696695
}
697696

698697
tem = xx * num - x * x;

modules/ximgproc/src/brightedges.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ namespace cv
150150
iedge.ptr(row + 1)[col + 2] +
151151
iedge.ptr(row - 1)[col + 2];
152152
if (line < weight) lines += 1;
153-
if (line == 1) return 0;
153+
if (lines == 1) return 0;
154154
// Compute surrounding pixels for dark zone
155155
int surround = iedge.ptr(row - 1)[col - 1] +
156156
iedge.ptr(row - 1)[col] +

modules/ximgproc/src/sparse_match_interpolators.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,6 @@ int RICInterpolatorImpl::PropagateModels(int spCnt, Mat & spNN, vector<int> & su
17651765
{
17661766
parallel_for_(Range(0, spCnt), [&](const Range& range)
17671767
{
1768-
int averInlier = 0;
17691768
int minPtCnt = 30;
17701769
for (int i = range.start; i < range.end; i++)
17711770
{
@@ -1795,7 +1794,6 @@ int RICInterpolatorImpl::PropagateModels(int spCnt, Mat & spNN, vector<int> & su
17951794
fitModel.reshape(1, 1).copyTo(outModels.row(i));
17961795

17971796
}
1798-
averInlier += inlierCnt;
17991797
}
18001798
}
18011799
);

0 commit comments

Comments
 (0)