summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r--src/misc/vec/vecInt.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index 919b7e5a..793dd567 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -39,8 +39,8 @@
typedef struct Vec_Int_t_ Vec_Int_t;
struct Vec_Int_t_
{
- int nSize;
int nCap;
+ int nSize;
int * pArray;
};
@@ -322,9 +322,31 @@ static inline void Vec_IntFill( Vec_Int_t * p, int nSize, int Entry )
{
int i;
Vec_IntGrow( p, nSize );
+ for ( i = 0; i < nSize; i++ )
+ p->pArray[i] = Entry;
p->nSize = nSize;
- for ( i = 0; i < p->nSize; i++ )
+}
+
+/**Function*************************************************************
+
+ Synopsis [Fills the vector with given number of entries.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_IntFillExtra( Vec_Int_t * p, int nSize, int Entry )
+{
+ int i;
+ if ( p->nSize >= nSize )
+ return;
+ Vec_IntGrow( p, nSize );
+ for ( i = p->nSize; i < nSize; i++ )
p->pArray[i] = Entry;
+ p->nSize = nSize;
}
/**Function*************************************************************