diff options
Diffstat (limited to '')
-rw-r--r-- | src/nids.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nids.cpp b/src/nids.cpp index 23c11b0..26a7964 100644 --- a/src/nids.cpp +++ b/src/nids.cpp | |||
@@ -104,7 +104,7 @@ void Bu::Nids::initialize( int iBlockSize, int iPreAllocate ) | |||
104 | 104 | ||
105 | Block *block = (Block *)new char[iBlockSize]; | 105 | Block *block = (Block *)new char[iBlockSize]; |
106 | memset( block, 0, iBlockSize ); | 106 | memset( block, 0, iBlockSize ); |
107 | block->uFirstBlock = block->uNextBlock = block->uPrevBlock = blockUnused; | 107 | block->uFirstBlock = block->uNextBlock /*=block->uPrevBlock*/ = blockUnused; |
108 | for( int j = 0; j < iPreAllocate; j++ ) | 108 | for( int j = 0; j < iPreAllocate; j++ ) |
109 | { | 109 | { |
110 | sStore.write( block, iBlockSize ); | 110 | sStore.write( block, iBlockSize ); |
@@ -122,9 +122,9 @@ void Bu::Nids::updateHeader() | |||
122 | } | 122 | } |
123 | 123 | ||
124 | void Bu::Nids::initBlock( uint32_t uPos, uint32_t uFirstBlock, | 124 | void Bu::Nids::initBlock( uint32_t uPos, uint32_t uFirstBlock, |
125 | uint32_t uPrevBlock, bool bNew ) | 125 | /*uint32_t uPrevBlock,*/ bool bNew ) |
126 | { | 126 | { |
127 | Block b = { uPos, blockUnused, uPrevBlock, 0, 0, { } }; | 127 | Block b = { uPos, blockUnused, /*uPrevBlock, 0,*/ 0, { } }; |
128 | if( uFirstBlock != blockUnused ) | 128 | if( uFirstBlock != blockUnused ) |
129 | b.uFirstBlock = uFirstBlock; | 129 | b.uFirstBlock = uFirstBlock; |
130 | bsBlockUsed.setBit( uPos ); | 130 | bsBlockUsed.setBit( uPos ); |
@@ -142,27 +142,27 @@ void Bu::Nids::initBlock( uint32_t uPos, uint32_t uFirstBlock, | |||
142 | iUsed++; | 142 | iUsed++; |
143 | } | 143 | } |
144 | 144 | ||
145 | uint32_t Bu::Nids::createBlock( uint32_t uFirstBlock, uint32_t uPrevBlock, | 145 | uint32_t Bu::Nids::createBlock( uint32_t uFirstBlock, /*uint32_t uPrevBlock,*/ |
146 | int /*iPreAllocate*/ ) | 146 | int /*iPreAllocate*/ ) |
147 | { | 147 | { |
148 | for( int j = 0; j < iBlocks; j++ ) | 148 | for( int j = 0; j < iBlocks; j++ ) |
149 | { | 149 | { |
150 | if( !bsBlockUsed.getBit( j ) ) | 150 | if( !bsBlockUsed.getBit( j ) ) |
151 | { | 151 | { |
152 | initBlock( j, uFirstBlock, uPrevBlock ); | 152 | initBlock( j, uFirstBlock/*, uPrevBlock*/ ); |
153 | return j; | 153 | return j; |
154 | } | 154 | } |
155 | } | 155 | } |
156 | // Oh, we don't have any blocks left...allocate a new one. | 156 | // Oh, we don't have any blocks left...allocate a new one. |
157 | iBlocks++; | 157 | iBlocks++; |
158 | bsBlockUsed.setSize( iBlocks, false ); | 158 | bsBlockUsed.setSize( iBlocks, false ); |
159 | initBlock( iBlocks-1, uFirstBlock, uPrevBlock, true ); | 159 | initBlock( iBlocks-1, uFirstBlock/*, uPrevBlock*/, true ); |
160 | return iBlocks-1; | 160 | return iBlocks-1; |
161 | } | 161 | } |
162 | 162 | ||
163 | int Bu::Nids::createStream( int iPreAllocate ) | 163 | int Bu::Nids::createStream( int iPreAllocate ) |
164 | { | 164 | { |
165 | return createBlock( blockUnused, blockUnused, iPreAllocate ); | 165 | return createBlock( blockUnused, /*blockUnused,*/ iPreAllocate ); |
166 | } | 166 | } |
167 | 167 | ||
168 | void Bu::Nids::deleteStream( int /*iID*/ ) | 168 | void Bu::Nids::deleteStream( int /*iID*/ ) |
@@ -224,7 +224,7 @@ void Bu::Nids::updateStreamSize( uint32_t uIndex, uint32_t uSize ) | |||
224 | { | 224 | { |
225 | if( !sStore.canWrite() ) | 225 | if( !sStore.canWrite() ) |
226 | return; | 226 | return; |
227 | sStore.setPos( iBlockStart + (iBlockSize*uIndex)+4*3 ); | 227 | sStore.setPos( iBlockStart + (iBlockSize*uIndex)+4*2 ); |
228 | sStore.write( &uSize, 4 ); | 228 | sStore.write( &uSize, 4 ); |
229 | } | 229 | } |
230 | 230 | ||