ole32: Remove the BIG_BLOCK_SIZE define.

Big block sizes can be 512 or 4096, so we define arrays that are large
enough in either case.
This commit is contained in:
Vincent Povirk 2010-03-10 14:46:53 -06:00 committed by Alexandre Julliard
parent b90ab46a82
commit 7b43123762
2 changed files with 9 additions and 7 deletions

View File

@ -2651,7 +2651,7 @@ static HRESULT StorageImpl_Construct(
if (create)
{
ULARGE_INTEGER size;
BYTE bigBlockBuffer[BIG_BLOCK_SIZE];
BYTE bigBlockBuffer[MAX_BIG_BLOCK_SIZE];
/*
* Initialize all header variables:
@ -2848,7 +2848,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
StorageImpl* This)
{
ULONG depotBlockIndexPos;
BYTE depotBuffer[BIG_BLOCK_SIZE];
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
BOOL success;
ULONG depotBlockOffset;
ULONG blocksPerDepot = This->bigBlockSize / sizeof(ULONG);
@ -2983,7 +2983,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
*/
static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex)
{
BYTE blockBuffer[BIG_BLOCK_SIZE];
BYTE blockBuffer[MAX_BIG_BLOCK_SIZE];
/*
* Initialize blocks as free
@ -3066,7 +3066,7 @@ static ULONG Storage32Impl_AddExtBlockDepot(StorageImpl* This)
{
ULONG numExtBlocks = This->extBigBlockDepotCount;
ULONG nextExtBlock = This->extBigBlockDepotStart;
BYTE depotBuffer[BIG_BLOCK_SIZE];
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
ULONG index = BLOCK_UNUSED;
ULONG nextBlockOffset = This->bigBlockSize - sizeof(ULONG);
ULONG blocksPerDepotBlock = This->bigBlockSize / sizeof(ULONG);
@ -3156,7 +3156,7 @@ static HRESULT StorageImpl_GetNextBlockInChain(
ULONG offsetInDepot = blockIndex * sizeof (ULONG);
ULONG depotBlockCount = offsetInDepot / This->bigBlockSize;
ULONG depotBlockOffset = offsetInDepot % This->bigBlockSize;
BYTE depotBuffer[BIG_BLOCK_SIZE];
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
BOOL success;
ULONG depotBlockIndexPos;
int index;
@ -5745,7 +5745,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
ULONG sbdIndex = This->parentStorage->smallBlockDepotStart;
ULONG nextBlock, newsbdIndex;
BYTE smallBlockDepot[BIG_BLOCK_SIZE];
BYTE smallBlockDepot[MAX_BIG_BLOCK_SIZE];
nextBlock = sbdIndex;
while (nextBlock != BLOCK_END_OF_CHAIN)

View File

@ -81,6 +81,9 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
#define HEADER_SIZE 512
#define MIN_BIG_BLOCK_SIZE 0x200
#define MAX_BIG_BLOCK_SIZE 0x1000
/*
* Type of child entry link
*/
@ -98,7 +101,6 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
* if the blocksize is different. Some changes will have to be done if it
* becomes the case.
*/
#define BIG_BLOCK_SIZE 0x200
#define COUNT_BBDEPOTINHEADER 109
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128