Fix Linux build

gcc is justifiably annoyed by variable initialization crossed by
a goto.

(issue #51)
This commit is contained in:
Andy McFadden 2021-09-07 13:35:27 -07:00
parent 5950cb7c74
commit b42cc8efe9
2 changed files with 3 additions and 3 deletions

View File

@ -4538,6 +4538,8 @@ DIError A2FDProDOS::Write(const void* buf, size_t len, size_t* pActual)
bool allocSparse = (pDiskFS->GetParameter(DiskFS::kParmProDOS_AllocSparse) != 0);
uint8_t blkBuf[kBlkSize];
uint16_t keyBlock;
bool allZero = true;
const uint8_t* scanPtr = (const uint8_t*)buf;
if (len >= 0x01000000) { // 16MB
assert(false);
@ -4578,8 +4580,6 @@ DIError A2FDProDOS::Write(const void* buf, size_t len, size_t* pActual)
* where we store it as a seedling. (GS/OS seems to do this, ProDOS 8
* v2.0.3 tends to allocate the first block.)
*/
bool allZero = true;
const uint8_t* scanPtr = (const uint8_t*)buf;
for (unsigned int i = 0; i < len; ++i, ++scanPtr) {
if (*scanPtr != 0x00) {
allZero = false;

View File

@ -30,7 +30,7 @@ int TwoImgHeader::InitHeader(int imageFormat, uint32_t imageSize,
{
if (imageSize == 0)
return -1;
if (imageFormat < kImageFormatDOS || imageFormat > (int) kImageFormatNibble)
if (imageFormat < (int) kImageFormatDOS || imageFormat > (int) kImageFormatNibble)
return -1;
if (imageFormat != kImageFormatNibble &&