1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

fixed various warnings and obvious errors reported by clang compiler and the coverity tool.

This commit is contained in:
Vadim Pisarevsky
2014-08-10 00:10:05 +04:00
parent 09907eeb62
commit 05e7c29de5
11 changed files with 15 additions and 21 deletions
+4 -4
View File
@@ -861,9 +861,9 @@ public:
void getValues( int vi, InputArray _sidx, float* values ) const
{
Mat sidx = _sidx.getMat();
int i, n, nsamples = getNSamples();
int i, n = sidx.checkVector(1, CV_32S), nsamples = getNSamples();
CV_Assert( 0 <= vi && vi < getNAllVars() );
CV_Assert( (n = sidx.checkVector(1, CV_32S)) >= 0 );
CV_Assert( n >= 0 );
const int* s = n > 0 ? sidx.ptr<int>() : 0;
if( n == 0 )
n = nsamples;
@@ -938,8 +938,8 @@ public:
{
CV_Assert(buf != 0 && 0 <= sidx && sidx < getNSamples());
Mat vidx = _vidx.getMat();
int i, n, nvars = getNAllVars();
CV_Assert( (n = vidx.checkVector(1, CV_32S)) >= 0 );
int i, n = vidx.checkVector(1, CV_32S), nvars = getNAllVars();
CV_Assert( n >= 0 );
const int* vptr = n > 0 ? vidx.ptr<int>() : 0;
if( n == 0 )
n = nvars;