summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-31 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-31 08:01:00 -0700
commitab7cb9c6ad52934b80e44f2bb5ae94049a5a4ae5 (patch)
treeeecf964e680ab7f91dc9f2635cfd508f44769afd /src/misc/vec
parent2b85f5ba649bcc81873697718fe8a9085d09c31d (diff)
downloadabc-ab7cb9c6ad52934b80e44f2bb5ae94049a5a4ae5.tar.gz
abc-ab7cb9c6ad52934b80e44f2bb5ae94049a5a4ae5.tar.bz2
abc-ab7cb9c6ad52934b80e44f2bb5ae94049a5a4ae5.zip
Version abc50831
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vecVec.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h
index bb911bfe..af7ca571 100644
--- a/src/misc/vec/vecVec.h
+++ b/src/misc/vec/vecVec.h
@@ -52,7 +52,7 @@ struct Vec_Vec_t_
#define Vec_VecForEachLevel( vGlob, vVec, i ) \
for ( i = 0; (i < Vec_VecSize(vGlob)) && (((vVec) = Vec_VecEntry(vGlob, i)), 1); i++ )
#define Vec_VecForEachLevelStart( vGlob, vVec, i, LevelStart ) \
- for ( i = LevelStart; (i < Vec_PtrSize(vGlob)) && (((vVec) = Vec_VecEntry(vGlob, i)), 1); i++ )
+ for ( i = LevelStart; (i < Vec_VecSize(vGlob)) && (((vVec) = Vec_VecEntry(vGlob, i)), 1); i++ )
#define Vec_VecForEachLevelStartStop( vGlob, vVec, i, LevelStart, LevelStop ) \
for ( i = LevelStart; (i <= LevelStop) && (((vVec) = Vec_VecEntry(vGlob, i)), 1); i++ )
#define Vec_VecForEachLevelReverse( vGlob, vVec, i ) \
@@ -234,6 +234,25 @@ static inline void Vec_VecPush( Vec_Vec_t * p, int Level, void * Entry )
Vec_PtrPush( p->pArray[Level], Entry );
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_VecPushUnique( Vec_Vec_t * p, int Level, void * Entry )
+{
+ if ( p->nSize < Level + 1 )
+ Vec_VecPush( p, Level, Entry );
+ else
+ Vec_PtrPushUnique( p->pArray[Level], Entry );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////