Fixed several issues found by static analysis tools

This commit is contained in:
Maksim Shabunin
2018-07-23 17:22:47 +03:00
parent 7d40fcead5
commit e0603bb45f
8 changed files with 28 additions and 21 deletions
@@ -859,6 +859,13 @@ public:
*/
TermCriteria(int type, int maxCount, double epsilon);
inline bool isValid() const
{
const bool isCount = (type & COUNT) && maxCount > 0;
const bool isEps = (type & EPS) && !cvIsNaN(epsilon);
return isCount || isEps;
}
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
int maxCount; //!< the maximum number of iterations/elements
double epsilon; //!< the desired accuracy
@@ -629,7 +629,6 @@ CV_INLINE int cvIplDepth( int type )
#define CV_TYPE_NAME_MATND "opencv-nd-matrix"
#define CV_MAX_DIM 32
#define CV_MAX_DIM_HEAP 1024
/**
@deprecated consider using cv::Mat instead