author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (side-by-side diff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/tools/qbitarray.cpp | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
-rw-r--r-- | qmake/tools/qbitarray.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/tools/qbitarray.cpp b/qmake/tools/qbitarray.cpp index 4f4e14b..1aaf963 100644 --- a/qmake/tools/qbitarray.cpp +++ b/qmake/tools/qbitarray.cpp @@ -152,97 +152,98 @@ QBitArray::QBitArray() : QByteArray( 0, 0 ) \sa fill() */ QBitArray::QBitArray( uint size ) : QByteArray( 0, 0 ) { bitarr_data *x = new bitarr_data; Q_CHECK_PTR( x ); x->nbits = 0; setSharedBlock( x ); resize( size ); } /*! \fn QBitArray::QBitArray( const QBitArray &a ) Constructs a shallow copy of \a a. */ /*! \fn QBitArray &QBitArray::operator=( const QBitArray &a ) Assigns a shallow copy of \a a to this bit array and returns a reference to this array. */ /*! Pad last byte with 0-bits. */ void QBitArray::pad0() { uint sz = size(); if ( sz && sz%8 ) *(data()+sz/8) &= (1 << (sz%8)) - 1; } /*! \fn uint QBitArray::size() const Returns the bit array's size (number of bits). \sa resize() */ /*! Resizes the bit array to \a size bits and returns TRUE if the bit - array could be resized; otherwise returns FALSE. + array could be resized; otherwise returns FALSE. The array becomes + a null array if \a size == 0. If the array is expanded, the new bits are set to 0. \sa size() */ bool QBitArray::resize( uint size ) { uint s = this->size(); if ( !QByteArray::resize( (size+7)/8 ) ) return FALSE; // cannot resize SHBLOCK->nbits = size; if ( size != 0 ) { // not null array int ds = (int)(size+7)/8 - (int)(s+7)/8;// number of bytes difference if ( ds > 0 ) // expanding array memset( data() + (s+7)/8, 0, ds ); // reset new data } return TRUE; } /*! Fills the bit array with \a v (1's if \a v is TRUE, or 0's if \a v is FALSE). fill() resizes the bit array to \a size bits if \a size is nonnegative. Returns FALSE if a nonnegative \e size was specified and the bit array could not be resized; otherwise returns TRUE. \sa resize() */ bool QBitArray::fill( bool v, int size ) { if ( size >= 0 ) { // resize first if ( !resize( size ) ) return FALSE; // cannot resize } else { size = this->size(); } if ( size > 0 ) memset( data(), v ? 0xff : 0, (size + 7) / 8 ); if ( v ) pad0(); return TRUE; } |