Commit df483cfd authored by Alexander Alekhin's avatar Alexander Alekhin

build: unreachable code after CV_Error()

parent 7c9cff72
...@@ -143,7 +143,6 @@ Ptr<Object> OR_pascalImp::parseAnnotation(const string &path, const string &id) ...@@ -143,7 +143,6 @@ Ptr<Object> OR_pascalImp::parseAnnotation(const string &path, const string &id)
case XML_ERROR_FILE_NOT_FOUND: case XML_ERROR_FILE_NOT_FOUND:
error_message = "XML file not found! " + error_message; error_message = "XML file not found! " + error_message;
CV_Error(Error::StsParseError, error_message); CV_Error(Error::StsParseError, error_message);
return annotation;
default: default:
CV_Error(Error::StsParseError, error_message); CV_Error(Error::StsParseError, error_message);
break; break;
......
...@@ -307,10 +307,8 @@ static Mat histc(InputArray _src, int minVal, int maxVal, bool normed) ...@@ -307,10 +307,8 @@ static Mat histc(InputArray _src, int minVal, int maxVal, bool normed)
case CV_32FC1: case CV_32FC1:
return histc_(src, minVal, maxVal, normed); return histc_(src, minVal, maxVal, normed);
break; break;
default:
CV_Error(Error::StsUnmatchedFormats, "This type is not implemented yet."); break;
} }
return Mat(); CV_Error(Error::StsUnmatchedFormats, "This type is not implemented yet.");
} }
......
...@@ -337,13 +337,8 @@ int BinaryDescriptor::descriptorSize() const ...@@ -337,13 +337,8 @@ int BinaryDescriptor::descriptorSize() const
/* power function with error management */ /* power function with error management */
static inline int get2Pow( int i ) static inline int get2Pow( int i )
{ {
if( i >= 0 && i <= 7 ) CV_DbgAssert(i >= 0 && i <= 7);
return 1 << i; return 1 << i;
else
{
CV_Error( Error::StsBadArg, "Invalid power argument" );
return -1;
}
} }
/* compute Gaussian pyramids */ /* compute Gaussian pyramids */
......
...@@ -73,7 +73,6 @@ bool Tracker::init( InputArray image, const Rect2d& boundingBox ) ...@@ -73,7 +73,6 @@ bool Tracker::init( InputArray image, const Rect2d& boundingBox )
if( model == 0 ) if( model == 0 )
{ {
CV_Error( -1, "The model is not initialized" ); CV_Error( -1, "The model is not initialized" );
return false;
} }
if( initTracker ) if( initTracker )
......
...@@ -89,7 +89,6 @@ void TrackerBoostingModel::responseToConfidenceMap( const std::vector<Mat>& resp ...@@ -89,7 +89,6 @@ void TrackerBoostingModel::responseToConfidenceMap( const std::vector<Mat>& resp
if( currentSample.empty() ) if( currentSample.empty() )
{ {
CV_Error( -1, "The samples in Model estimation are empty" ); CV_Error( -1, "The samples in Model estimation are empty" );
return;
} }
for ( size_t i = 0; i < currentSample.size(); i++ ) for ( size_t i = 0; i < currentSample.size(); i++ )
......
...@@ -90,7 +90,6 @@ Ptr<TrackerFeature> TrackerFeature::create( const String& trackerFeatureType ) ...@@ -90,7 +90,6 @@ Ptr<TrackerFeature> TrackerFeature::create( const String& trackerFeatureType )
} }
CV_Error( -1, "Tracker feature type not supported" ); CV_Error( -1, "Tracker feature type not supported" );
return Ptr<TrackerFeature>();
} }
String TrackerFeature::getClassName() const String TrackerFeature::getClassName() const
......
...@@ -67,7 +67,6 @@ void TrackerMILModel::responseToConfidenceMap( const std::vector<Mat>& responses ...@@ -67,7 +67,6 @@ void TrackerMILModel::responseToConfidenceMap( const std::vector<Mat>& responses
if( currentSample.empty() ) if( currentSample.empty() )
{ {
CV_Error( -1, "The samples in Model estimation are empty" ); CV_Error( -1, "The samples in Model estimation are empty" );
return;
} }
for ( size_t i = 0; i < responses.size(); i++ ) for ( size_t i = 0; i < responses.size(); i++ )
......
...@@ -112,7 +112,6 @@ bool TrackerModel::runStateEstimator() ...@@ -112,7 +112,6 @@ bool TrackerModel::runStateEstimator()
if( stateEstimator == 0 ) if( stateEstimator == 0 )
{ {
CV_Error( -1, "Tracker state estimator is not setted" ); CV_Error( -1, "Tracker state estimator is not setted" );
return false;
} }
Ptr<TrackerTargetState> targetState = stateEstimator->estimate( confidenceMaps ); Ptr<TrackerTargetState> targetState = stateEstimator->estimate( confidenceMaps );
if( targetState == 0 ) if( targetState == 0 )
......
...@@ -83,7 +83,6 @@ Ptr<TrackerSamplerAlgorithm> TrackerSamplerAlgorithm::create( const String& trac ...@@ -83,7 +83,6 @@ Ptr<TrackerSamplerAlgorithm> TrackerSamplerAlgorithm::create( const String& trac
} }
CV_Error( -1, "Tracker sampler algorithm type not supported" ); CV_Error( -1, "Tracker sampler algorithm type not supported" );
return Ptr<TrackerSamplerAlgorithm>();
} }
String TrackerSamplerAlgorithm::getClassName() const String TrackerSamplerAlgorithm::getClassName() const
......
...@@ -85,7 +85,6 @@ Ptr<TrackerStateEstimator> TrackerStateEstimator::create( const String& trackeSt ...@@ -85,7 +85,6 @@ Ptr<TrackerStateEstimator> TrackerStateEstimator::create( const String& trackeSt
} }
CV_Error( -1, "Tracker state estimator type not supported" ); CV_Error( -1, "Tracker state estimator type not supported" );
return Ptr<TrackerStateEstimator>();
} }
String TrackerStateEstimator::getClassName() const String TrackerStateEstimator::getClassName() const
......
...@@ -1794,12 +1794,9 @@ bool VocData::getClassifierGroundTruthImage(const string& obj_class, const strin ...@@ -1794,12 +1794,9 @@ bool VocData::getClassifierGroundTruthImage(const string& obj_class, const strin
{ {
//image found, so return corresponding ground truth //image found, so return corresponding ground truth
return m_classifier_gt_all_present[std::distance(m_classifier_gt_all_ids.begin(),it)] != 0; return m_classifier_gt_all_present[std::distance(m_classifier_gt_all_ids.begin(),it)] != 0;
} else { }
string err_msg = "could not find classifier ground truth for image '" + id + "' and class '" + obj_class + "'"; string err_msg = "could not find classifier ground truth for image '" + id + "' and class '" + obj_class + "'";
CV_Error(Error::StsError,err_msg.c_str()); CV_Error(Error::StsError,err_msg.c_str());
}
return true;
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
......
...@@ -204,10 +204,8 @@ namespace cv ...@@ -204,10 +204,8 @@ namespace cv
return distanceL5(points1, idx1, points2, idx2); return distanceL5(points1, idx1, points2, idx2);
case PCTSignatures::L_INFINITY: case PCTSignatures::L_INFINITY:
return distanceLInfinity(points1, idx1, points2, idx2); return distanceLInfinity(points1, idx1, points2, idx2);
default:
CV_Error(Error::StsBadArg, "Distance function not implemented!");
return -1;
} }
CV_Error(Error::StsBadArg, "Distance function not implemented!");
} }
} }
} }
......
...@@ -117,10 +117,8 @@ namespace cv ...@@ -117,10 +117,8 @@ namespace cv
return gaussianSimilarity(distancefunction, similarityParameter, points1, idx1, points2, idx2); return gaussianSimilarity(distancefunction, similarityParameter, points1, idx1, points2, idx2);
case PCTSignatures::HEURISTIC: case PCTSignatures::HEURISTIC:
return heuristicSimilarity(distancefunction, similarityParameter, points1, idx1, points2, idx2); return heuristicSimilarity(distancefunction, similarityParameter, points1, idx1, points2, idx2);
default:
CV_Error(Error::StsNotImplemented, "Similarity function not implemented!");
return -1;
} }
CV_Error(Error::StsNotImplemented, "Similarity function not implemented!");
} }
} }
} }
......
...@@ -51,7 +51,7 @@ using namespace cv::cuda; ...@@ -51,7 +51,7 @@ using namespace cv::cuda;
cv::cuda::SURF_CUDA::SURF_CUDA() { throw_no_cuda(); } cv::cuda::SURF_CUDA::SURF_CUDA() { throw_no_cuda(); }
cv::cuda::SURF_CUDA::SURF_CUDA(double, int, int, bool, float, bool) { throw_no_cuda(); } cv::cuda::SURF_CUDA::SURF_CUDA(double, int, int, bool, float, bool) { throw_no_cuda(); }
int cv::cuda::SURF_CUDA::descriptorSize() const { throw_no_cuda(); return 0;} int cv::cuda::SURF_CUDA::descriptorSize() const { throw_no_cuda(); }
void cv::cuda::SURF_CUDA::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_no_cuda(); } void cv::cuda::SURF_CUDA::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_no_cuda(); }
void cv::cuda::SURF_CUDA::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); } void cv::cuda::SURF_CUDA::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); }
void cv::cuda::SURF_CUDA::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_no_cuda(); } void cv::cuda::SURF_CUDA::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_no_cuda(); }
......
...@@ -480,7 +480,6 @@ Ptr<StereoMatcher> createRightMatcher(Ptr<StereoMatcher> matcher_left) ...@@ -480,7 +480,6 @@ Ptr<StereoMatcher> createRightMatcher(Ptr<StereoMatcher> matcher_left)
else else
{ {
CV_Error(Error::StsBadArg, "createRightMatcher supports only StereoBM and StereoSGBM"); CV_Error(Error::StsBadArg, "createRightMatcher supports only StereoBM and StereoSGBM");
return Ptr<StereoMatcher>();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment