Don't use %zd format

Visual Studio still doesn't support it.
This commit is contained in:
Andy McFadden 2014-12-11 17:34:25 -08:00
parent 8e910b23ca
commit 29e64011e1
11 changed files with 42 additions and 38 deletions

View File

@ -571,8 +571,8 @@ void A2FileCPM::Dump(void) const
*/
DIError A2FDCPM::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" CP/M reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGI(" CP/M reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
A2FileCPM* pFile = (A2FileCPM*) fpFile;

View File

@ -514,12 +514,13 @@ static const uint8_t kFavoriteBitDec[kNumFavorites] = {
dierr = pGFD->Read(&sctBuf, sizeof(sctBuf), &actual);
if (dierr == kDIErrNone) {
if (actual > /*kMaxExcessByteCount*/ 256) {
LOGI(" DDD looks like too much data in input file (%zd extra)",
actual);
LOGW(" DDD looks like too much data in input file (%lu extra)",
(unsigned long) actual);
dierr = kDIErrBadCompressedData;
goto bail;
} else {
LOGI(" DDD excess bytes (%zd) within normal parameters", actual);
LOGI(" DDD excess bytes (%lu) within normal parameters",
(unsigned long) actual);
}
}

View File

@ -2884,8 +2884,8 @@ bail:
*/
DIError A2FDDOS::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" DOS reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" DOS reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
A2FileDOS* pFile = (A2FileDOS*) fpFile;
@ -2976,7 +2976,7 @@ DIError A2FDDOS::Write(const void* buf, size_t len, size_t* pActual)
DiskFSDOS33* pDiskFS = (DiskFSDOS33*) fpFile->GetDiskFS();
uint8_t sctBuf[kSctSize];
LOGI(" DOS Write len=%zd %s", len, pFile->GetPathName());
LOGD(" DOS Write len=%lu %s", (unsigned long) len, pFile->GetPathName());
if (len >= 0x01000000) { // 16MB
assert(false);

View File

@ -394,8 +394,8 @@ DIError A2FileFAT::Open(A2FileDescr** ppOpenFile, bool readOnly,
*/
DIError A2FDFAT::Read(void* buf, size_t len, size_t* pActual)
{
LOGD(" FAT reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" FAT reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
A2FileFAT* pFile = (A2FileFAT*) fpFile;

View File

@ -142,8 +142,8 @@ DIError GFDFile::Read(void* buf, size_t length, size_t* pActual)
if (pActual == NULL) {
if (actual != length) {
dierr = ErrnoOrGeneric();
LOGI(" GDFile Read failed on %zd bytes (actual=%zd, err=%d)",
length, actual, dierr);
LOGW(" GDFile Read failed on %lu bytes (actual=%lu, err=%d)",
(unsigned long) length, (unsigned long) actual, dierr);
return dierr;
}
} else {
@ -163,7 +163,8 @@ DIError GFDFile::Write(const void* buf, size_t length, size_t* pActual)
assert(pActual == NULL); // not handling this yet
if (::fwrite(buf, length, 1, fFp) != 1) {
dierr = ErrnoOrGeneric();
LOGI(" GDFile Write failed on %zd bytes (err=%d)", length, dierr);
LOGW(" GDFile Write failed on %lu bytes (err=%d)",
(unsigned long) length, dierr);
return dierr;
}
return dierr;
@ -440,8 +441,8 @@ DIError GFDBuffer::Read(void* buf, size_t length, size_t* pActual)
if (fCurrentOffset + (long)length > fLength) {
if (pActual == NULL) {
LOGI(" GFDBuffer underrrun off=%ld len=%zd flen=%ld",
(long) fCurrentOffset, length, (long) fLength);
LOGW(" GFDBuffer underrrun off=%ld len=%lu flen=%ld",
(long) fCurrentOffset, (unsigned long) length, (long) fLength);
return kDIErrDataUnderrun;
} else {
/* set *pActual and adjust "length" */
@ -469,8 +470,8 @@ DIError GFDBuffer::Write(const void* buf, size_t length, size_t* pActual)
assert(pActual == NULL); // not handling this yet
if (fCurrentOffset + (long)length > fLength) {
if (!fDoExpand) {
LOGI(" GFDBuffer overrun off=%ld len=%zd flen=%ld",
(long) fCurrentOffset, length, (long) fLength);
LOGI(" GFDBuffer overrun off=%ld len=%lu flen=%ld",
(long) fCurrentOffset, (unsigned long) length, (long) fLength);
return kDIErrDataOverrun;
}

View File

@ -523,8 +523,8 @@ void A2FileGutenberg::Dump(void) const
*/
DIError A2FDGutenberg::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" Gutenberg reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" Gutenberg reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
A2FileGutenberg* pFile = (A2FileGutenberg*) fpFile;

View File

@ -1855,8 +1855,9 @@ DIError A2FDHFS::Read(void* buf, size_t len, size_t* pActual)
{
long result;
LOGI(" HFS reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
LOGD(" HFS reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(),
hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
//A2FileHFS* pFile = (A2FileHFS*) fpFile;
@ -1896,8 +1897,9 @@ DIError A2FDHFS::Write(const void* buf, size_t len, size_t* pActual)
{
long result;
LOGI(" HFS writing %zd bytes to '%s' (offset=%ld)",
len, fpFile->GetPathName(), hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
LOGD(" HFS writing %lu bytes to '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(),
hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
fModified = true; // assume something gets changed

View File

@ -328,7 +328,7 @@ DIError OuterGzip::Save(GenericFD* pOuterGFD, GenericFD* pWrapperGFD,
written = gzwrite(gzfp, buf, actual);
if (written == 0) {
LOGI("Failed writing %zd bytes to gzio", actual);
LOGE("Failed writing %lu bytes to gzio", (unsigned long) actual);
dierr = kDIErrGeneric;
goto bail;
}
@ -338,7 +338,7 @@ DIError OuterGzip::Save(GenericFD* pOuterGFD, GenericFD* pWrapperGFD,
}
assert(wrapperLength == 0); // not expecting any slop
LOGI(" GZ wrote %ld bytes", totalWritten);
LOGD(" GZ wrote %ld bytes", totalWritten);
/*
* Success!

View File

@ -1579,8 +1579,8 @@ DIError A2FilePascal::Open(A2FileDescr** ppOpenFile, bool readOnly,
*/
DIError A2FDPascal::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" Pascal reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" Pascal reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
A2FilePascal* pFile = (A2FilePascal*) fpFile;
@ -1644,7 +1644,7 @@ DIError A2FDPascal::Write(const void* buf, size_t len, size_t* pActual)
uint8_t blkBuf[kBlkSize];
size_t origLen = len;
LOGI(" DOS Write len=%zd %s", len, pFile->GetPathName());
LOGD(" DOS Write len=%lu %s", (unsigned long) len, pFile->GetPathName());
if (len >= 0x01000000) { // 16MB
assert(false);
@ -1669,8 +1669,8 @@ DIError A2FDPascal::Write(const void* buf, size_t len, size_t* pActual)
blocksAvail = pNextFile->fStartBlock - pFile->fStartBlock;
blocksNeeded = (len + kBlkSize -1) / kBlkSize;
LOGI("Pascal write '%s' %zd bytes: avail=%ld needed=%ld",
pFile->GetPathName(), len, blocksAvail, blocksNeeded);
LOGD("Pascal write '%s' %lu bytes: avail=%ld needed=%ld",
pFile->GetPathName(), (unsigned long) len, blocksAvail, blocksNeeded);
if (blocksAvail < blocksNeeded)
return kDIErrDiskFull;

View File

@ -3652,8 +3652,8 @@ DIError DiskFSProDOS::SetFileInfo(A2File* pGenericFile, long fileType,
goto bail;
}
if ((size_t) (*ptr & 0x0f) != strlen(pFile->fDirEntry.fileName)) {
LOGI("ProDOS GLITCH: wrong file? (len=%d vs %zd)",
*ptr & 0x0f, strlen(pFile->fDirEntry.fileName));
LOGW("ProDOS GLITCH: wrong file? (len=%d vs %u)",
*ptr & 0x0f, (unsigned int) strlen(pFile->fDirEntry.fileName));
assert(false);
dierr = kDIErrBadDirectory;
goto bail;
@ -4392,8 +4392,8 @@ void A2FileProDOS::Dump(void) const
*/
DIError A2FDProDOS::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" ProDOS reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" ProDOS reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
//if (fBlockList == NULL)
// return kDIErrNotReady;
@ -4772,8 +4772,8 @@ DIError A2FDProDOS::WriteDirectory(const void* buf, size_t len, size_t* pActual)
{
DIError dierr = kDIErrNone;
LOGI("ProDOS writing %zd bytes to directory '%s'",
len, fpFile->GetPathName());
LOGD("ProDOS writing %lu bytes to directory '%s'",
(unsigned long) len, fpFile->GetPathName());
assert(len >= (size_t)kBlkSize);
assert((len % kBlkSize) == 0);

View File

@ -533,8 +533,8 @@ DIError A2FileRDOS::Open(A2FileDescr** ppOpenFile, bool readOnly,
*/
DIError A2FDRDOS::Read(void* buf, size_t len, size_t* pActual)
{
LOGI(" RDOS reading %zd bytes from '%s' (offset=%ld)",
len, fpFile->GetPathName(), (long) fOffset);
LOGD(" RDOS reading %lu bytes from '%s' (offset=%ld)",
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
//if (!fOpen)
// return kDIErrNotReady;