Skip to content

Commit df483cf

Browse files
committed
build: unreachable code after CV_Error()
1 parent 7c9cff7 commit df483cf

File tree

15 files changed

+8
-31
lines changed

15 files changed

+8
-31
lines changed

modules/datasets/src/or_pascal.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ Ptr<Object> OR_pascalImp::parseAnnotation(const string &path, const string &id)
143143
case XML_ERROR_FILE_NOT_FOUND:
144144
error_message = "XML file not found! " + error_message;
145145
CV_Error(Error::StsParseError, error_message);
146-
return annotation;
147146
default:
148147
CV_Error(Error::StsParseError, error_message);
149148
break;

modules/face/src/lbph_faces.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ static Mat histc(InputArray _src, int minVal, int maxVal, bool normed)
307307
case CV_32FC1:
308308
return histc_(src, minVal, maxVal, normed);
309309
break;
310-
default:
311-
CV_Error(Error::StsUnmatchedFormats, "This type is not implemented yet."); break;
312310
}
313-
return Mat();
311+
CV_Error(Error::StsUnmatchedFormats, "This type is not implemented yet.");
314312
}
315313

316314

modules/line_descriptor/src/binary_descriptor.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,8 @@ int BinaryDescriptor::descriptorSize() const
337337
/* power function with error management */
338338
static inline int get2Pow( int i )
339339
{
340-
if( i >= 0 && i <= 7 )
341-
return 1 << i;
342-
else
343-
{
344-
CV_Error( Error::StsBadArg, "Invalid power argument" );
345-
return -1;
346-
}
340+
CV_DbgAssert(i >= 0 && i <= 7);
341+
return 1 << i;
347342
}
348343

349344
/* compute Gaussian pyramids */

modules/tracking/src/tracker.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ bool Tracker::init( InputArray image, const Rect2d& boundingBox )
7373
if( model == 0 )
7474
{
7575
CV_Error( -1, "The model is not initialized" );
76-
return false;
7776
}
7877

7978
if( initTracker )

modules/tracking/src/trackerBoostingModel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void TrackerBoostingModel::responseToConfidenceMap( const std::vector<Mat>& resp
8989
if( currentSample.empty() )
9090
{
9191
CV_Error( -1, "The samples in Model estimation are empty" );
92-
return;
9392
}
9493

9594
for ( size_t i = 0; i < currentSample.size(); i++ )

modules/tracking/src/trackerFeature.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ Ptr<TrackerFeature> TrackerFeature::create( const String& trackerFeatureType )
9090
}
9191

9292
CV_Error( -1, "Tracker feature type not supported" );
93-
return Ptr<TrackerFeature>();
9493
}
9594

9695
String TrackerFeature::getClassName() const

modules/tracking/src/trackerMILModel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void TrackerMILModel::responseToConfidenceMap( const std::vector<Mat>& responses
6767
if( currentSample.empty() )
6868
{
6969
CV_Error( -1, "The samples in Model estimation are empty" );
70-
return;
7170
}
7271

7372
for ( size_t i = 0; i < responses.size(); i++ )

modules/tracking/src/trackerModel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ bool TrackerModel::runStateEstimator()
112112
if( stateEstimator == 0 )
113113
{
114114
CV_Error( -1, "Tracker state estimator is not setted" );
115-
return false;
116115
}
117116
Ptr<TrackerTargetState> targetState = stateEstimator->estimate( confidenceMaps );
118117
if( targetState == 0 )

modules/tracking/src/trackerSamplerAlgorithm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ Ptr<TrackerSamplerAlgorithm> TrackerSamplerAlgorithm::create( const String& trac
8383
}
8484

8585
CV_Error( -1, "Tracker sampler algorithm type not supported" );
86-
return Ptr<TrackerSamplerAlgorithm>();
8786
}
8887

8988
String TrackerSamplerAlgorithm::getClassName() const

modules/tracking/src/trackerStateEstimator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ Ptr<TrackerStateEstimator> TrackerStateEstimator::create( const String& trackeSt
8585
}
8686

8787
CV_Error( -1, "Tracker state estimator type not supported" );
88-
return Ptr<TrackerStateEstimator>();
8988
}
9089

9190
String TrackerStateEstimator::getClassName() const

0 commit comments

Comments
 (0)