question about storage32.c code and while loop

EA Durbin ead1234 at hotmail.com
Tue Sep 12 23:08:38 CDT 2006


I've mentioned this before but I'm no expert C programmer. Can someone 
explain why we do the following in storage32.c?

    if (cbRead > 0)
    {
        cbTotalRead += cbRead;

        resWrite = BlockChainStream_WriteAt(bbTempChain,
                                            offset,
                                            cbRead,
                                            buffer,
                                            &cbWritten);

        if (FAILED(resWrite))
            break;

        cbTotalWritten += cbWritten;
        offset.u.LowPart += This->smallBlockSize;
    }
  } while (cbRead > 0);
  HeapFree(GetProcessHeap(),0,buffer);

  if (FAILED(resRead) || FAILED(resWrite))
  {
    ERR("conversion failed: resRead = 0x%08lx, resWrite = 0x%08lx\n", 
resRead, resWrite);
    BlockChainStream_Destroy(bbTempChain);
    return NULL;
  }




in the while loop above

while (cbRead > 0);

it appears it terminates without doing anything due to the semicolon, is 
this intentional or is this semicolon not supposed to be there and its 
supposed to execute the line below it? If it is intentional why is the empty 
while loop here?





More information about the wine-devel mailing list