diff options
Diffstat (limited to 'src/misc/vec/vecPtr.h')
-rw-r--r-- | src/misc/vec/vecPtr.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index 0ba1bdc5..eb551d1c 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -48,6 +48,9 @@ struct Vec_Ptr_t_ /// MACRO DEFITIONS /// //////////////////////////////////////////////////////////////////////// +#define Vec_PtrForEachEntry( vVec, pEntry, i ) \ + for ( i = 0; (i < Vec_PtrSize(vVec)) && (((pEntry) = Vec_PtrEntry(vVec, i)), 1); i++ ) + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFITIONS /// //////////////////////////////////////////////////////////////////////// @@ -418,6 +421,29 @@ static inline void * Vec_PtrPop( Vec_Ptr_t * p ) /**Function************************************************************* + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_PtrRemove( Vec_Ptr_t * p, void * Entry ) +{ + int i; + for ( i = 0; i < p->nSize; i++ ) + if ( p->pArray[i] == Entry ) + break; + assert( i < p->nSize ); + for ( i++; i < p->nSize; i++ ) + p->pArray[i-1] = p->pArray[i]; + p->nSize--; +} + +/**Function************************************************************* + Synopsis [Moves the first nItems to the end.] Description [] |