mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #21107 from take1014:remove_assert_21038
resolves #21038 * remove C assert * revert C header * fix several points in review * fix test_ds.cpp
This commit is contained in:
+10
-10
@@ -497,7 +497,7 @@ cvInitNArrayIterator( int count, CvArr** arrs,
|
||||
// returns zero value if iteration is finished, non-zero otherwise
|
||||
CV_IMPL int cvNextNArraySlice( CvNArrayIterator* iterator )
|
||||
{
|
||||
assert( iterator != 0 );
|
||||
CV_Assert( iterator != 0 );
|
||||
int i, dims;
|
||||
|
||||
for( dims = iterator->dims; dims > 0; dims-- )
|
||||
@@ -648,7 +648,7 @@ icvGetNodePtr( CvSparseMat* mat, const int* idx, int* _type,
|
||||
int i, tabidx;
|
||||
unsigned hashval = 0;
|
||||
CvSparseNode *node;
|
||||
assert( CV_IS_SPARSE_MAT( mat ));
|
||||
CV_Assert( CV_IS_SPARSE_MAT( mat ));
|
||||
|
||||
if( !precalc_hashval )
|
||||
{
|
||||
@@ -697,7 +697,7 @@ icvGetNodePtr( CvSparseMat* mat, const int* idx, int* _type,
|
||||
int newrawsize = newsize*sizeof(newtable[0]);
|
||||
|
||||
CvSparseMatIterator iterator;
|
||||
assert( (newsize & (newsize - 1)) == 0 );
|
||||
CV_Assert( (newsize & (newsize - 1)) == 0 );
|
||||
|
||||
// resize hash table
|
||||
newtable = (void**)cvAlloc( newrawsize );
|
||||
@@ -742,7 +742,7 @@ icvDeleteNode( CvSparseMat* mat, const int* idx, unsigned* precalc_hashval )
|
||||
int i, tabidx;
|
||||
unsigned hashval = 0;
|
||||
CvSparseNode *node, *prev = 0;
|
||||
assert( CV_IS_SPARSE_MAT( mat ));
|
||||
CV_Assert( CV_IS_SPARSE_MAT( mat ));
|
||||
|
||||
if( !precalc_hashval )
|
||||
{
|
||||
@@ -1462,7 +1462,7 @@ cvScalarToRawData( const CvScalar* scalar, void* data, int type, int extend_to_1
|
||||
int cn = CV_MAT_CN( type );
|
||||
int depth = type & CV_MAT_DEPTH_MASK;
|
||||
|
||||
assert( scalar && data );
|
||||
CV_Assert( scalar && data );
|
||||
if( (unsigned)(cn - 1) >= 4 )
|
||||
CV_Error( CV_StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
|
||||
@@ -1509,7 +1509,7 @@ cvScalarToRawData( const CvScalar* scalar, void* data, int type, int extend_to_1
|
||||
((double*)data)[cn] = (double)(scalar->val[cn]);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
CV_Error( CV_BadDepth, "" );
|
||||
}
|
||||
|
||||
@@ -1534,7 +1534,7 @@ cvRawDataToScalar( const void* data, int flags, CvScalar* scalar )
|
||||
{
|
||||
int cn = CV_MAT_CN( flags );
|
||||
|
||||
assert( scalar && data );
|
||||
CV_Assert( scalar && data );
|
||||
|
||||
if( (unsigned)(cn - 1) >= 4 )
|
||||
CV_Error( CV_StsOutOfRange, "The number of channels must be 1, 2, 3 or 4" );
|
||||
@@ -1572,7 +1572,7 @@ cvRawDataToScalar( const void* data, int flags, CvScalar* scalar )
|
||||
scalar->val[cn] = ((double*)data)[cn];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
CV_Error( CV_BadDepth, "" );
|
||||
}
|
||||
}
|
||||
@@ -2623,7 +2623,7 @@ cvReshapeMatND( const CvArr* arr,
|
||||
|
||||
{
|
||||
CvMatND* mat = (CvMatND*)arr;
|
||||
assert( new_cn > 0 );
|
||||
CV_Assert( new_cn > 0 );
|
||||
int last_dim_size = mat->dim[mat->dims-1].size*CV_MAT_CN(mat->type);
|
||||
int new_size = last_dim_size/new_cn;
|
||||
|
||||
@@ -2901,7 +2901,7 @@ CV_IMPL IplImage *
|
||||
cvCreateImage( CvSize size, int depth, int channels )
|
||||
{
|
||||
IplImage *img = cvCreateImageHeader( size, depth, channels );
|
||||
assert( img );
|
||||
CV_Assert( img );
|
||||
cvCreateData( img );
|
||||
|
||||
return img;
|
||||
|
||||
@@ -97,7 +97,7 @@ icvInitMemStorage( CvMemStorage* storage, int block_size )
|
||||
block_size = CV_STORAGE_BLOCK_SIZE;
|
||||
|
||||
block_size = cvAlign( block_size, CV_STRUCT_ALIGN );
|
||||
assert( sizeof(CvMemBlock) % CV_STRUCT_ALIGN == 0 );
|
||||
CV_Assert( sizeof(CvMemBlock) % CV_STRUCT_ALIGN == 0 );
|
||||
|
||||
memset( storage, 0, sizeof( *storage ));
|
||||
storage->signature = CV_STORAGE_MAGIC_VAL;
|
||||
@@ -240,7 +240,7 @@ icvGoNextMemBlock( CvMemStorage * storage )
|
||||
|
||||
if( block == parent->top ) /* the single allocated block */
|
||||
{
|
||||
assert( parent->bottom == block );
|
||||
CV_Assert( parent->bottom == block );
|
||||
parent->top = parent->bottom = 0;
|
||||
parent->free_space = 0;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ icvGoNextMemBlock( CvMemStorage * storage )
|
||||
if( storage->top->next )
|
||||
storage->top = storage->top->next;
|
||||
storage->free_space = storage->block_size - sizeof(CvMemBlock);
|
||||
assert( storage->free_space % CV_STRUCT_ALIGN == 0 );
|
||||
CV_Assert( storage->free_space % CV_STRUCT_ALIGN == 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ cvMemStorageAlloc( CvMemStorage* storage, size_t size )
|
||||
if( size > INT_MAX )
|
||||
CV_Error( CV_StsOutOfRange, "Too large memory block is requested" );
|
||||
|
||||
assert( storage->free_space % CV_STRUCT_ALIGN == 0 );
|
||||
CV_Assert( storage->free_space % CV_STRUCT_ALIGN == 0 );
|
||||
|
||||
if( (size_t)storage->free_space < size )
|
||||
{
|
||||
@@ -343,7 +343,7 @@ cvMemStorageAlloc( CvMemStorage* storage, size_t size )
|
||||
}
|
||||
|
||||
ptr = ICV_FREE_PTR(storage);
|
||||
assert( (size_t)ptr % CV_STRUCT_ALIGN == 0 );
|
||||
CV_Assert( (size_t)ptr % CV_STRUCT_ALIGN == 0 );
|
||||
storage->free_space = cvAlignLeft(storage->free_space - (int)size, CV_STRUCT_ALIGN );
|
||||
|
||||
return ptr;
|
||||
@@ -683,7 +683,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of )
|
||||
else
|
||||
{
|
||||
icvGoNextMemBlock( storage );
|
||||
assert( storage->free_space >= delta );
|
||||
CV_Assert( storage->free_space >= delta );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of )
|
||||
* For used blocks it means current number
|
||||
* of sequence elements in the block:
|
||||
*/
|
||||
assert( block->count % seq->elem_size == 0 && block->count > 0 );
|
||||
CV_Assert( block->count % seq->elem_size == 0 && block->count > 0 );
|
||||
|
||||
if( !in_front_of )
|
||||
{
|
||||
@@ -732,7 +732,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of )
|
||||
|
||||
if( block != block->prev )
|
||||
{
|
||||
assert( seq->first->start_index == 0 );
|
||||
CV_Assert( seq->first->start_index == 0 );
|
||||
seq->first = block;
|
||||
}
|
||||
else
|
||||
@@ -760,7 +760,7 @@ icvFreeSeqBlock( CvSeq *seq, int in_front_of )
|
||||
{
|
||||
CvSeqBlock *block = seq->first;
|
||||
|
||||
assert( (in_front_of ? block : block->prev)->count == 0 );
|
||||
CV_Assert( (in_front_of ? block : block->prev)->count == 0 );
|
||||
|
||||
if( block == block->prev ) /* single block case */
|
||||
{
|
||||
@@ -775,7 +775,7 @@ icvFreeSeqBlock( CvSeq *seq, int in_front_of )
|
||||
if( !in_front_of )
|
||||
{
|
||||
block = block->prev;
|
||||
assert( seq->ptr == block->data );
|
||||
CV_Assert( seq->ptr == block->data );
|
||||
|
||||
block->count = (int)(seq->block_max - seq->ptr);
|
||||
seq->block_max = seq->ptr = block->prev->data +
|
||||
@@ -804,7 +804,7 @@ icvFreeSeqBlock( CvSeq *seq, int in_front_of )
|
||||
block->next->prev = block->prev;
|
||||
}
|
||||
|
||||
assert( block->count > 0 && block->count % seq->elem_size == 0 );
|
||||
CV_Assert( block->count > 0 && block->count % seq->elem_size == 0 );
|
||||
block->next = seq->free_blocks;
|
||||
seq->free_blocks = block;
|
||||
}
|
||||
@@ -861,7 +861,7 @@ cvFlushSeqWriter( CvSeqWriter * writer )
|
||||
CvSeqBlock *block = first_block;
|
||||
|
||||
writer->block->count = (int)((writer->ptr - writer->block->data) / seq->elem_size);
|
||||
assert( writer->block->count > 0 );
|
||||
CV_Assert( writer->block->count > 0 );
|
||||
|
||||
do
|
||||
{
|
||||
@@ -891,7 +891,7 @@ cvEndWriteSeq( CvSeqWriter * writer )
|
||||
CvMemStorage *storage = seq->storage;
|
||||
schar *storage_block_max = (schar *) storage->top + storage->block_size;
|
||||
|
||||
assert( writer->block->count > 0 );
|
||||
CV_Assert( writer->block->count > 0 );
|
||||
|
||||
if( (unsigned)((storage_block_max - storage->free_space)
|
||||
- seq->block_max) < CV_STRUCT_ALIGN )
|
||||
@@ -1147,7 +1147,7 @@ cvSeqPush( CvSeq *seq, const void *element )
|
||||
icvGrowSeq( seq, 0 );
|
||||
|
||||
ptr = seq->ptr;
|
||||
assert( ptr + elem_size <= seq->block_max /*&& ptr == seq->block_min */ );
|
||||
CV_Assert( ptr + elem_size <= seq->block_max /*&& ptr == seq->block_min */ );
|
||||
}
|
||||
|
||||
if( element )
|
||||
@@ -1183,7 +1183,7 @@ cvSeqPop( CvSeq *seq, void *element )
|
||||
if( --(seq->first->prev->count) == 0 )
|
||||
{
|
||||
icvFreeSeqBlock( seq, 0 );
|
||||
assert( seq->ptr == seq->block_max );
|
||||
CV_Assert( seq->ptr == seq->block_max );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1207,7 +1207,7 @@ cvSeqPushFront( CvSeq *seq, const void *element )
|
||||
icvGrowSeq( seq, 1 );
|
||||
|
||||
block = seq->first;
|
||||
assert( block->start_index > 0 );
|
||||
CV_Assert( block->start_index > 0 );
|
||||
}
|
||||
|
||||
ptr = block->data -= elem_size;
|
||||
@@ -1289,7 +1289,7 @@ cvSeqInsert( CvSeq *seq, int before_index, const void *element )
|
||||
icvGrowSeq( seq, 0 );
|
||||
|
||||
ptr = seq->ptr + elem_size;
|
||||
assert( ptr <= seq->block_max );
|
||||
CV_Assert( ptr <= seq->block_max );
|
||||
}
|
||||
|
||||
delta_index = seq->first->start_index;
|
||||
@@ -1307,7 +1307,7 @@ cvSeqInsert( CvSeq *seq, int before_index, const void *element )
|
||||
block = prev_block;
|
||||
|
||||
/* Check that we don't fall into an infinite loop: */
|
||||
assert( block != seq->first->prev );
|
||||
CV_Assert( block != seq->first->prev );
|
||||
}
|
||||
|
||||
before_index = (before_index - block->start_index + delta_index) * elem_size;
|
||||
@@ -1346,7 +1346,7 @@ cvSeqInsert( CvSeq *seq, int before_index, const void *element )
|
||||
block = next_block;
|
||||
|
||||
/* Check that we don't fall into an infinite loop: */
|
||||
assert( block != seq->first );
|
||||
CV_Assert( block != seq->first );
|
||||
}
|
||||
|
||||
before_index = (before_index - block->start_index + delta_index) * elem_size;
|
||||
@@ -1502,7 +1502,7 @@ cvSeqPushMulti( CvSeq *seq, const void *_elements, int count, int front )
|
||||
icvGrowSeq( seq, 1 );
|
||||
|
||||
block = seq->first;
|
||||
assert( block->start_index > 0 );
|
||||
CV_Assert( block->start_index > 0 );
|
||||
}
|
||||
|
||||
delta = MIN( block->start_index, count );
|
||||
@@ -1543,7 +1543,7 @@ cvSeqPopMulti( CvSeq *seq, void *_elements, int count, int front )
|
||||
int delta = seq->first->prev->count;
|
||||
|
||||
delta = MIN( delta, count );
|
||||
assert( delta > 0 );
|
||||
CV_Assert( delta > 0 );
|
||||
|
||||
seq->first->prev->count -= delta;
|
||||
seq->total -= delta;
|
||||
@@ -1568,7 +1568,7 @@ cvSeqPopMulti( CvSeq *seq, void *_elements, int count, int front )
|
||||
int delta = seq->first->count;
|
||||
|
||||
delta = MIN( delta, count );
|
||||
assert( delta > 0 );
|
||||
CV_Assert( delta > 0 );
|
||||
|
||||
seq->first->count -= delta;
|
||||
seq->total -= delta;
|
||||
@@ -2418,7 +2418,7 @@ cvSeqPartition( const CvSeq* seq, CvMemStorage* storage, CvSeq** labels,
|
||||
root2->rank += root->rank == root2->rank;
|
||||
root = root2;
|
||||
}
|
||||
assert( root->parent == 0 );
|
||||
CV_Assert( root->parent == 0 );
|
||||
|
||||
// Compress path from node2 to the root:
|
||||
while( node2->parent )
|
||||
@@ -2521,7 +2521,7 @@ cvSetAdd( CvSet* set, CvSetElem* element, CvSetElem** inserted_element )
|
||||
((CvSetElem*)ptr)->flags = count | CV_SET_ELEM_FREE_FLAG;
|
||||
((CvSetElem*)ptr)->next_free = (CvSetElem*)(ptr + elem_size);
|
||||
}
|
||||
assert( count <= CV_SET_ELEM_IDX_MASK+1 );
|
||||
CV_Assert( count <= CV_SET_ELEM_IDX_MASK+1 );
|
||||
((CvSetElem*)(ptr - elem_size))->next_free = 0;
|
||||
set->first->prev->count += count - set->total;
|
||||
set->total = count;
|
||||
@@ -2720,7 +2720,7 @@ cvFindGraphEdgeByPtr( const CvGraph* graph,
|
||||
for( ; edge; edge = edge->next[ofs] )
|
||||
{
|
||||
ofs = start_vtx == edge->vtx[1];
|
||||
assert( ofs == 1 || start_vtx == edge->vtx[0] );
|
||||
CV_Assert( ofs == 1 || start_vtx == edge->vtx[0] );
|
||||
if( edge->vtx[1] == end_vtx )
|
||||
break;
|
||||
}
|
||||
@@ -2784,7 +2784,7 @@ cvGraphAddEdgeByPtr( CvGraph* graph,
|
||||
"vertex pointers coincide (or set to NULL)" );
|
||||
|
||||
edge = (CvGraphEdge*)cvSetNew( (CvSet*)(graph->edges) );
|
||||
assert( edge->flags >= 0 );
|
||||
CV_Assert( edge->flags >= 0 );
|
||||
|
||||
edge->vtx[0] = start_vtx;
|
||||
edge->vtx[1] = end_vtx;
|
||||
@@ -2861,7 +2861,7 @@ cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx, CvGraphVtx* end_v
|
||||
prev_ofs = ofs, prev_edge = edge, edge = edge->next[ofs] )
|
||||
{
|
||||
ofs = start_vtx == edge->vtx[1];
|
||||
assert( ofs == 1 || start_vtx == edge->vtx[0] );
|
||||
CV_Assert( ofs == 1 || start_vtx == edge->vtx[0] );
|
||||
if( edge->vtx[1] == end_vtx )
|
||||
break;
|
||||
}
|
||||
@@ -2879,7 +2879,7 @@ cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx, CvGraphVtx* end_v
|
||||
prev_ofs = ofs, prev_edge = edge, edge = edge->next[ofs] )
|
||||
{
|
||||
ofs = end_vtx == edge->vtx[1];
|
||||
assert( ofs == 1 || end_vtx == edge->vtx[0] );
|
||||
CV_Assert( ofs == 1 || end_vtx == edge->vtx[0] );
|
||||
if( edge->vtx[0] == start_vtx )
|
||||
break;
|
||||
}
|
||||
@@ -3396,7 +3396,7 @@ cvInsertNodeIntoTree( void* _node, void* _parent, void* _frame )
|
||||
node->v_prev = _parent != _frame ? parent : 0;
|
||||
node->h_next = parent->v_next;
|
||||
|
||||
assert( parent->v_next != node );
|
||||
CV_Assert( parent->v_next != node );
|
||||
|
||||
if( parent->v_next )
|
||||
parent->v_next->h_prev = node;
|
||||
@@ -3430,7 +3430,7 @@ cvRemoveNodeFromTree( void* _node, void* _frame )
|
||||
|
||||
if( parent )
|
||||
{
|
||||
assert( parent->v_next == node );
|
||||
CV_Assert( parent->v_next == node );
|
||||
parent->v_next = node->h_next;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -238,7 +238,7 @@ DFTInit( int n0, int nf, const int* factors, int* itab, int elem_size, void* _wa
|
||||
else
|
||||
{
|
||||
// radix[] is initialized from index 'nf' down to zero
|
||||
assert (nf < 34);
|
||||
CV_Assert (nf < 34);
|
||||
radix[nf] = 1;
|
||||
digits[nf] = 0;
|
||||
for( i = 0; i < nf; i++ )
|
||||
@@ -374,7 +374,7 @@ DFTInit( int n0, int nf, const int* factors, int* itab, int elem_size, void* _wa
|
||||
else
|
||||
{
|
||||
Complex<float>* wave = (Complex<float>*)_wave;
|
||||
assert( elem_size == sizeof(Complex<float>) );
|
||||
CV_Assert( elem_size == sizeof(Complex<float>) );
|
||||
|
||||
wave[0].re = 1.f;
|
||||
wave[0].im = 0.f;
|
||||
@@ -874,13 +874,13 @@ DFT(const OcvDftOptions & c, const Complex<T>* src, Complex<T>* dst)
|
||||
// 0. shuffle data
|
||||
if( dst != src )
|
||||
{
|
||||
assert( !c.noPermute );
|
||||
CV_Assert( !c.noPermute );
|
||||
if( !inv )
|
||||
{
|
||||
for( i = 0; i <= n - 2; i += 2, itab += 2*tab_step )
|
||||
{
|
||||
int k0 = itab[0], k1 = itab[tab_step];
|
||||
assert( (unsigned)k0 < (unsigned)n && (unsigned)k1 < (unsigned)n );
|
||||
CV_Assert( (unsigned)k0 < (unsigned)n && (unsigned)k1 < (unsigned)n );
|
||||
dst[i] = src[k0]; dst[i+1] = src[k1];
|
||||
}
|
||||
|
||||
@@ -892,7 +892,7 @@ DFT(const OcvDftOptions & c, const Complex<T>* src, Complex<T>* dst)
|
||||
for( i = 0; i <= n - 2; i += 2, itab += 2*tab_step )
|
||||
{
|
||||
int k0 = itab[0], k1 = itab[tab_step];
|
||||
assert( (unsigned)k0 < (unsigned)n && (unsigned)k1 < (unsigned)n );
|
||||
CV_Assert( (unsigned)k0 < (unsigned)n && (unsigned)k1 < (unsigned)n );
|
||||
t.re = src[k0].re; t.im = -src[k0].im;
|
||||
dst[i] = t;
|
||||
t.re = src[k1].re; t.im = -src[k1].im;
|
||||
@@ -921,7 +921,7 @@ DFT(const OcvDftOptions & c, const Complex<T>* src, Complex<T>* dst)
|
||||
for( i = 0; i < n2; i += 2, itab += tab_step*2 )
|
||||
{
|
||||
j = itab[0];
|
||||
assert( (unsigned)j < (unsigned)n2 );
|
||||
CV_Assert( (unsigned)j < (unsigned)n2 );
|
||||
|
||||
CV_SWAP(dst[i+1], dsth[j], t);
|
||||
if( j > i )
|
||||
@@ -938,7 +938,7 @@ DFT(const OcvDftOptions & c, const Complex<T>* src, Complex<T>* dst)
|
||||
for( i = 0; i < n; i++, itab += tab_step )
|
||||
{
|
||||
j = itab[0];
|
||||
assert( (unsigned)j < (unsigned)n );
|
||||
CV_Assert( (unsigned)j < (unsigned)n );
|
||||
if( j > i )
|
||||
CV_SWAP(dst[i], dst[j], t);
|
||||
}
|
||||
@@ -1218,7 +1218,7 @@ RealDFT(const OcvDftOptions & c, const T* src, T* dst)
|
||||
setIppErrorStatus();
|
||||
#endif
|
||||
}
|
||||
assert( c.tab_size == n );
|
||||
CV_Assert( c.tab_size == n );
|
||||
|
||||
if( n == 1 )
|
||||
{
|
||||
@@ -1338,11 +1338,11 @@ CCSIDFT(const OcvDftOptions & c, const T* src, T* dst)
|
||||
T save_s1 = 0.;
|
||||
T t0, t1, t2, t3, t;
|
||||
|
||||
assert( c.tab_size == n );
|
||||
CV_Assert( c.tab_size == n );
|
||||
|
||||
if( complex_input )
|
||||
{
|
||||
assert( src != dst );
|
||||
CV_Assert( src != dst );
|
||||
save_s1 = src[1];
|
||||
((T*)src)[1] = src[0];
|
||||
src++;
|
||||
@@ -3175,7 +3175,7 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( !inv );
|
||||
CV_Assert( !inv );
|
||||
CopyColumn( dbuf0, complex_elem_size, dptr0,
|
||||
dst_step, len, complex_elem_size );
|
||||
if( even )
|
||||
@@ -3872,7 +3872,7 @@ DCTInit( int n, int elem_size, void* _wave, int inv )
|
||||
if( n == 1 )
|
||||
return;
|
||||
|
||||
assert( (n&1) == 0 );
|
||||
CV_Assert( (n&1) == 0 );
|
||||
|
||||
if( (n & (n - 1)) == 0 )
|
||||
{
|
||||
@@ -3910,7 +3910,7 @@ DCTInit( int n, int elem_size, void* _wave, int inv )
|
||||
else
|
||||
{
|
||||
Complex<float>* wave = (Complex<float>*)_wave;
|
||||
assert( elem_size == sizeof(Complex<float>) );
|
||||
CV_Assert( elem_size == sizeof(Complex<float>) );
|
||||
|
||||
w.re = (float)scale;
|
||||
w.im = 0.f;
|
||||
|
||||
@@ -1020,7 +1020,7 @@ double invert( InputArray _src, OutputArray _dst, int method )
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( n == 1 );
|
||||
CV_Assert( n == 1 );
|
||||
|
||||
if( type == CV_32FC1 )
|
||||
{
|
||||
@@ -1208,7 +1208,7 @@ bool solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int method )
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( src.rows == 1 );
|
||||
CV_Assert( src.rows == 1 );
|
||||
|
||||
if( type == CV_32FC1 )
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ GEMM_TransposeBlock( const uchar* src, size_t src_step,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2062,7 +2062,7 @@ MulTransposedR(const Mat& srcmat, const Mat& dstmat, const Mat& deltamat, double
|
||||
|
||||
if( delta && delta_cols < size.width )
|
||||
{
|
||||
assert( delta_cols == 1 );
|
||||
CV_Assert( delta_cols == 1 );
|
||||
buf_size *= 5;
|
||||
}
|
||||
buf.allocate(buf_size);
|
||||
|
||||
@@ -638,7 +638,7 @@ void SparseMat::resizeHashTab(size_t newsize)
|
||||
uchar* SparseMat::newNode(const int* idx, size_t hashval)
|
||||
{
|
||||
const int HASH_MAX_FILL_FACTOR=3;
|
||||
assert(hdr);
|
||||
CV_Assert(hdr);
|
||||
size_t hsize = hdr->hashtab.size();
|
||||
if( ++hdr->nodeCount > hsize*HASH_MAX_FILL_FACTOR )
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ static void* openclamdblas_check_fn(int ID);
|
||||
|
||||
static void* openclamdblas_check_fn(int ID)
|
||||
{
|
||||
assert(ID >= 0 && ID < (int)(sizeof(openclamdblas_fn)/sizeof(openclamdblas_fn[0])));
|
||||
CV_Assert(ID >= 0 && ID < (int)(sizeof(openclamdblas_fn)/sizeof(openclamdblas_fn[0])));
|
||||
const struct DynamicFnEntry* e = openclamdblas_fn[ID];
|
||||
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
|
||||
if (!func)
|
||||
|
||||
@@ -113,7 +113,7 @@ static void* openclamdfft_check_fn(int ID);
|
||||
|
||||
static void* openclamdfft_check_fn(int ID)
|
||||
{
|
||||
assert(ID >= 0 && ID < (int)(sizeof(openclamdfft_fn)/sizeof(openclamdfft_fn[0])));
|
||||
CV_Assert(ID >= 0 && ID < (int)(sizeof(openclamdfft_fn)/sizeof(openclamdfft_fn[0])));
|
||||
const struct DynamicFnEntry* e = openclamdfft_fn[ID];
|
||||
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
|
||||
if (!func)
|
||||
|
||||
@@ -360,7 +360,7 @@ static void* opencl_gl_check_fn(int ID);
|
||||
static void* opencl_gl_check_fn(int ID)
|
||||
{
|
||||
const struct DynamicFnEntry* e = NULL;
|
||||
assert(ID >= 0 && ID < (int)(sizeof(opencl_gl_fn_list)/sizeof(opencl_gl_fn_list[0])));
|
||||
CV_Assert(ID >= 0 && ID < (int)(sizeof(opencl_gl_fn_list)/sizeof(opencl_gl_fn_list[0])));
|
||||
e = opencl_gl_fn_list[ID];
|
||||
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
|
||||
if (!func)
|
||||
|
||||
@@ -160,7 +160,7 @@ void icvFSCreateCollection( CvFileStorage* fs, int tag, CvFileNode* collection )
|
||||
{
|
||||
if( collection->tag != CV_NODE_NONE )
|
||||
{
|
||||
assert( fs->fmt == CV_STORAGE_FORMAT_XML );
|
||||
CV_Assert( fs->fmt == CV_STORAGE_FORMAT_XML );
|
||||
CV_PARSE_ERROR( "Sequence element should not have name (use <_></_>)" );
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ int icvDecodeFormat( const char* dt, int* fmt_pairs, int max_len )
|
||||
if( !dt || !len )
|
||||
return 0;
|
||||
|
||||
assert( fmt_pairs != 0 && max_len > 0 );
|
||||
CV_Assert( fmt_pairs != 0 && max_len > 0 );
|
||||
fmt_pairs[0] = 0;
|
||||
max_len *= 2;
|
||||
|
||||
|
||||
@@ -756,7 +756,7 @@ void icvJSONEndWriteStruct( CvFileStorage* fs )
|
||||
cvSeqPop( fs->write_stack, &parent_flags );
|
||||
fs->struct_indent -= 4;
|
||||
fs->struct_flags = parent_flags & ~CV_NODE_EMPTY;
|
||||
assert( fs->struct_indent >= 0 );
|
||||
CV_Assert( fs->struct_indent >= 0 );
|
||||
|
||||
if ( CV_NODE_IS_COLLECTION(struct_flags) )
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ static void icvWriteMat( CvFileStorage* fs, const char* name, const void* struct
|
||||
cv::Size size;
|
||||
int y;
|
||||
|
||||
assert( CV_IS_MAT_HDR_Z(mat) );
|
||||
CV_Assert( CV_IS_MAT_HDR_Z(mat) );
|
||||
|
||||
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_MAT );
|
||||
cvWriteInt( fs, "rows", mat->rows );
|
||||
@@ -121,7 +121,7 @@ static void icvWriteMatND( CvFileStorage* fs, const char* name, const void* stru
|
||||
int dims, sizes[CV_MAX_DIM];
|
||||
char dt[16];
|
||||
|
||||
assert( CV_IS_MATND_HDR(mat) );
|
||||
CV_Assert( CV_IS_MATND_HDR(mat) );
|
||||
|
||||
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_MATND );
|
||||
dims = cvGetDims( mat, sizes );
|
||||
@@ -237,7 +237,7 @@ static void icvWriteSparseMat( CvFileStorage* fs, const char* name, const void*
|
||||
int *prev_idx = 0;
|
||||
char dt[16];
|
||||
|
||||
assert( CV_IS_SPARSE_MAT(mat) );
|
||||
CV_Assert( CV_IS_SPARSE_MAT(mat) );
|
||||
|
||||
memstorage = cvCreateMemStorage();
|
||||
|
||||
@@ -273,7 +273,7 @@ static void icvWriteSparseMat( CvFileStorage* fs, const char* name, const void*
|
||||
if( i > 0 )
|
||||
{
|
||||
for( ; idx[k] == prev_idx[k]; k++ )
|
||||
assert( k < dims );
|
||||
CV_Assert( k < dims );
|
||||
if( k < dims - 1 )
|
||||
fs->write_int( fs, 0, k - dims + 1 );
|
||||
}
|
||||
@@ -383,7 +383,7 @@ static void icvWriteImage( CvFileStorage* fs, const char* name, const void* stru
|
||||
cv::Size size;
|
||||
int y, depth;
|
||||
|
||||
assert( CV_IS_IMAGE(image) );
|
||||
CV_Assert( CV_IS_IMAGE(image) );
|
||||
|
||||
if( image->dataOrder == IPL_DATA_ORDER_PLANE )
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
@@ -623,7 +623,7 @@ static void icvWriteSeq( CvFileStorage* fs, const char* name, const void* struct
|
||||
char buf[128];
|
||||
char dt_buf[128], *dt;
|
||||
|
||||
assert( CV_IS_SEQ( seq ));
|
||||
CV_Assert( CV_IS_SEQ( seq ));
|
||||
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_SEQ );
|
||||
|
||||
if( level >= 0 )
|
||||
@@ -671,7 +671,7 @@ static void icvWriteSeqTree( CvFileStorage* fs, const char* name, const void* st
|
||||
strcmp(recursive_value,"False") != 0 &&
|
||||
strcmp(recursive_value,"FALSE") != 0;
|
||||
|
||||
assert( CV_IS_SEQ( seq ));
|
||||
CV_Assert( CV_IS_SEQ( seq ));
|
||||
|
||||
if( !is_recursive )
|
||||
{
|
||||
@@ -873,7 +873,7 @@ static void* icvReadSeqTree( CvFileStorage* fs, CvFileNode* node )
|
||||
root = seq;
|
||||
if( level > prev_level )
|
||||
{
|
||||
assert( level == prev_level + 1 );
|
||||
CV_Assert( level == prev_level + 1 );
|
||||
parent = prev_seq;
|
||||
prev_seq = 0;
|
||||
if( parent )
|
||||
@@ -933,7 +933,7 @@ static void icvWriteGraph( CvFileStorage* fs, const char* name, const void* stru
|
||||
char edge_dt_buf[128], *edge_dt;
|
||||
int write_buf_size;
|
||||
|
||||
assert( CV_IS_GRAPH(graph) );
|
||||
CV_Assert( CV_IS_GRAPH(graph) );
|
||||
vtx_count = cvGraphGetVtxCount( graph );
|
||||
edge_count = cvGraphGetEdgeCount( graph );
|
||||
flag_buf = (int*)cvAlloc( vtx_count*sizeof(flag_buf[0]));
|
||||
|
||||
@@ -37,7 +37,7 @@ icvXMLSkipSpaces( CvFileStorage* fs, char* ptr, int mode )
|
||||
|
||||
if( c == '-' )
|
||||
{
|
||||
assert( ptr[1] == '-' && ptr[2] == '>' );
|
||||
CV_Assert( ptr[1] == '-' && ptr[2] == '>' );
|
||||
mode = 0;
|
||||
ptr += 3;
|
||||
}
|
||||
@@ -484,7 +484,7 @@ icvXMLParseTag( CvFileStorage* fs, char* ptr, CvStringHashNode** _tag,
|
||||
else if( *ptr == '!' )
|
||||
{
|
||||
tag_type = CV_XML_DIRECTIVE_TAG;
|
||||
assert( ptr[1] != '-' || ptr[2] != '-' );
|
||||
CV_Assert( ptr[1] != '-' || ptr[2] != '-' );
|
||||
ptr++;
|
||||
}
|
||||
else
|
||||
@@ -549,7 +549,7 @@ icvXMLParseTag( CvFileStorage* fs, char* ptr, CvStringHashNode** _tag,
|
||||
}
|
||||
|
||||
ptr = icvXMLParseValue( fs, ptr, &stub, CV_NODE_STRING );
|
||||
assert( stub.tag == CV_NODE_STRING );
|
||||
CV_Assert( stub.tag == CV_NODE_STRING );
|
||||
last->attr[count*2+1] = stub.data.str.ptr;
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -797,7 +797,7 @@ void icvYMLEndWriteStruct( CvFileStorage* fs )
|
||||
|
||||
if( !CV_NODE_IS_FLOW(parent_flags) )
|
||||
fs->struct_indent -= CV_YML_INDENT + CV_NODE_IS_FLOW(struct_flags);
|
||||
assert( fs->struct_indent >= 0 );
|
||||
CV_Assert( fs->struct_indent >= 0 );
|
||||
|
||||
fs->struct_flags = parent_flags;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user