summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecInt.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-27 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-27 08:01:00 -0700
commit28db025b8393e307328d51ff6901c4ebab669e95 (patch)
tree3866dd659505646c64eccdb672930bf0ebb849c2 /src/misc/vec/vecInt.h
parent9093ca53201519ef03dedb7044345fc716cc0643 (diff)
downloadabc-28db025b8393e307328d51ff6901c4ebab669e95.tar.gz
abc-28db025b8393e307328d51ff6901c4ebab669e95.tar.bz2
abc-28db025b8393e307328d51ff6901c4ebab669e95.zip
Version abc50827
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*************************************************************