Examples of errors detected by the V785 diagnostic
V785. Constant expression in switch statement.
OpenCV
V785 Constant expression in switch statement. approx.cpp 782
CV_IMPL CvSeq*
cvApproxPoly( const void* array, int header_size,
CvMemStorage* storage, int method,
double parameter, int parameter2 )
{
// ....
if( method != CV_POLY_APPROX_DP )
CV_Error( cv::Error::StsOutOfRange, "Unknown approximation method" );
while( src_seq != 0 )
{
CvSeq *contour = 0;
switch (method)
{
case CV_POLY_APPROX_DP:
// ....
default:
CV_Error( cv::Error::StsBadArg, "Invalid approximation method" );
}
// ....
}
return dst_seq;
}
Similar errors can be found in some other places:
- V785 Constant expression in switch statement. qrcode_encoder.cpp 559