Fix cppcheck reports warnings:
(performance) Possible inefficient checking for 'lmap' emptiness (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? (style) Array index '<xxx>' is used before limits check
This commit is contained in:
parent
61991a3330
commit
2d5e3b57ea
@ -666,7 +666,7 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
|
|||||||
int thresh = minsad + (minsad * uniquenessRatio/100);
|
int thresh = minsad + (minsad * uniquenessRatio/100);
|
||||||
for( d = 0; d < ndisp; d++ )
|
for( d = 0; d < ndisp; d++ )
|
||||||
{
|
{
|
||||||
if( sad[d] <= thresh && (d < mind-1 || d > mind+1))
|
if( (d < mind-1 || d > mind+1) && sad[d] <= thresh)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( d < ndisp )
|
if( d < ndisp )
|
||||||
|
@ -192,7 +192,7 @@ static ImageEncoder findEncoder( const String& _ext )
|
|||||||
if( !ext )
|
if( !ext )
|
||||||
return ImageEncoder();
|
return ImageEncoder();
|
||||||
int len = 0;
|
int len = 0;
|
||||||
for( ext++; isalnum(ext[len]) && len < 128; len++ )
|
for( ext++; len < 128 && isalnum(ext[len]); len++ )
|
||||||
;
|
;
|
||||||
|
|
||||||
for( size_t i = 0; i < codecs.encoders.size(); i++ )
|
for( size_t i = 0; i < codecs.encoders.size(); i++ )
|
||||||
@ -206,7 +206,7 @@ static ImageEncoder findEncoder( const String& _ext )
|
|||||||
if( !descr )
|
if( !descr )
|
||||||
break;
|
break;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for( descr++; isalnum(descr[j]) && j < len; j++ )
|
for( descr++; j < len && isalnum(descr[j]) ; j++ )
|
||||||
{
|
{
|
||||||
int c1 = tolower(ext[j]);
|
int c1 = tolower(ext[j]);
|
||||||
int c2 = tolower(descr[j]);
|
int c2 = tolower(descr[j]);
|
||||||
|
@ -79,7 +79,7 @@ static bool findCircle( Point2f pt0, Point2f pt1, Point2f pt2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
center->x = center->y = 0.f;
|
center->x = center->y = 0.f;
|
||||||
radius = 0;
|
*radius = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,7 +542,7 @@ Mat LogisticRegressionImpl::remap_labels(const Mat& _labels_i, const map<int, in
|
|||||||
|
|
||||||
Mat new_labels = Mat::zeros(labels.rows, labels.cols, labels.type());
|
Mat new_labels = Mat::zeros(labels.rows, labels.cols, labels.type());
|
||||||
|
|
||||||
CV_Assert( lmap.size() > 0 );
|
CV_Assert( !lmap.empty() );
|
||||||
|
|
||||||
for(int i =0;i<labels.rows;i++)
|
for(int i =0;i<labels.rows;i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user