diff options
Diffstat (limited to 'src/misc/vec/vecBit.h')
-rw-r--r-- | src/misc/vec/vecBit.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/misc/vec/vecBit.h b/src/misc/vec/vecBit.h index 2c0c65e5..cb89e982 100644 --- a/src/misc/vec/vecBit.h +++ b/src/misc/vec/vecBit.h @@ -310,6 +310,13 @@ static inline void Vec_BitWriteEntry( Vec_Bit_t * p, int i, int Entry ) p->pArray[i >> 5] &= ~(1 << (i & 31)); else assert(0); } +static inline int Vec_BitAddEntry( Vec_Bit_t * p, int i ) +{ + if ( Vec_BitEntry(p, i) ) + return 1; + Vec_BitWriteEntry( p, i, 1 ); + return 0; +} /**Function************************************************************* @@ -601,6 +608,24 @@ static inline int Vec_BitCount( Vec_Bit_t * p ) return Counter; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_BitReset( Vec_Bit_t * p ) +{ + int i, nWords = (p->nSize >> 5) + ((p->nSize & 31) > 0); + for ( i = 0; i < nWords; i++ ) + p->pArray[i] = 0; +} + ABC_NAMESPACE_HEADER_END #endif |