diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-05-25 05:42:26 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-05-25 05:42:26 +0000 |
commit | 286dc953c1e0e4a75589e4068e29a317a03f23dd (patch) | |
tree | 2144b0e7847222b0c6b8f6e87d8a5118e85e8b66 /src/myriadstream.cpp | |
parent | a0c6e974a3393642bda80fed5bce464a6c6cf2ec (diff) | |
download | libbu++-286dc953c1e0e4a75589e4068e29a317a03f23dd.tar.gz libbu++-286dc953c1e0e4a75589e4068e29a317a03f23dd.tar.bz2 libbu++-286dc953c1e0e4a75589e4068e29a317a03f23dd.tar.xz libbu++-286dc953c1e0e4a75589e4068e29a317a03f23dd.zip |
More myriad tests and features, passes perfectly so far.
Diffstat (limited to 'src/myriadstream.cpp')
-rw-r--r-- | src/myriadstream.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/myriadstream.cpp b/src/myriadstream.cpp index 41c5b53..b0b1d05 100644 --- a/src/myriadstream.cpp +++ b/src/myriadstream.cpp | |||
@@ -139,9 +139,7 @@ size_t Bu::MyriadStream::write( const void *pBuf, size_t nBytes ) | |||
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | iCurBlock = rMyriad.findEmptyBlock(); | 142 | iCurBlock = rMyriad.streamAddBlock( pStream ); |
143 | pStream->aBlocks.append( iCurBlock ); | ||
144 | rMyriad.bsBlockUsed.setBit( iCurBlock ); | ||
145 | #ifdef MYRIAD_STREAM_DEBUG | 143 | #ifdef MYRIAD_STREAM_DEBUG |
146 | sio << "MyriadStream: write: " << __LINE__ << ": New block allocated and appended: " | 144 | sio << "MyriadStream: write: " << __LINE__ << ": New block allocated and appended: " |
147 | << iCurBlock << "." << sio.nl; | 145 | << iCurBlock << "." << sio.nl; |
@@ -283,6 +281,8 @@ void Bu::MyriadStream::setBlocking( bool /*bBlocking*/ ) | |||
283 | 281 | ||
284 | void Bu::MyriadStream::setSize( long iSize ) | 282 | void Bu::MyriadStream::setSize( long iSize ) |
285 | { | 283 | { |
284 | if( iSize < 0 ) | ||
285 | iSize = 0; | ||
286 | rMyriad.setStreamSize( pStream, iSize ); | 286 | rMyriad.setStreamSize( pStream, iSize ); |
287 | if( iPos > iSize ) | 287 | if( iPos > iSize ) |
288 | iPos = iSize; | 288 | iPos = iSize; |