replaced alloca() (a.k.a. cvStackAlloc) with AutoBuffer or vector() everywhere. cvStackAlloc() is still defined, but we do not need alloca() anymore to compile and run OpenCV (fixes #889 and may be some others)
This commit is contained in:
@@ -646,7 +646,8 @@ float CvRTrees::predict( const CvMat* sample, const CvMat* missing ) const
|
||||
if( nclasses > 0 ) //classification
|
||||
{
|
||||
int max_nvotes = 0;
|
||||
int* votes = (int*)alloca( sizeof(int)*nclasses );
|
||||
cv::AutoBuffer<int> _votes(nclasses);
|
||||
int* votes = _votes;
|
||||
memset( votes, 0, sizeof(*votes)*nclasses );
|
||||
for( k = 0; k < ntrees; k++ )
|
||||
{
|
||||
@@ -682,7 +683,8 @@ float CvRTrees::predict_prob( const CvMat* sample, const CvMat* missing) const
|
||||
if( nclasses == 2 ) //classification
|
||||
{
|
||||
int max_nvotes = 0;
|
||||
int* votes = (int*)alloca( sizeof(int)*nclasses );
|
||||
cv::AutoBuffer<int> _votes(nclasses);
|
||||
int* votes = _votes;
|
||||
memset( votes, 0, sizeof(*votes)*nclasses );
|
||||
for( k = 0; k < ntrees; k++ )
|
||||
{
|
||||
|
Reference in New Issue
Block a user