From 3f4fc5e4507f7fb9df431fc116529b4c209ab97c Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 7 Apr 2006 08:01:00 -0700 Subject: Version abc60407 --- src/misc/vec/vecVec.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/misc/vec/vecVec.h') diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h index 8518184a..54dcaa37 100644 --- a/src/misc/vec/vecVec.h +++ b/src/misc/vec/vecVec.h @@ -121,6 +121,28 @@ static inline Vec_Vec_t * Vec_VecStart( int nSize ) return p; } +/**Function************************************************************* + + Synopsis [Allocates a vector with the given capacity.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_VecExpand( Vec_Vec_t * p, int Level ) +{ + int i; + if ( p->nSize >= Level + 1 ) + return; + Vec_PtrGrow( (Vec_Ptr_t *)p, Level + 1 ); + for ( i = p->nSize; i <= Level; i++ ) + p->pArray[i] = Vec_PtrAlloc( 0 ); + p->nSize = Level + 1; +} + /**Function************************************************************* Synopsis [] -- cgit v1.2.3