mirror of
https://github.com/fadden/ciderpress.git
synced 2025-01-17 23:31:41 +00:00
Don't use %zd format
Visual Studio still doesn't support it.
This commit is contained in:
parent
8e910b23ca
commit
29e64011e1
@ -571,8 +571,8 @@ void A2FileCPM::Dump(void) const
|
|||||||
*/
|
*/
|
||||||
DIError A2FDCPM::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDCPM::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" CP/M reading %zd bytes from '%s' (offset=%ld)",
|
LOGI(" CP/M reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
|
|
||||||
A2FileCPM* pFile = (A2FileCPM*) fpFile;
|
A2FileCPM* pFile = (A2FileCPM*) fpFile;
|
||||||
|
|
||||||
|
@ -514,12 +514,13 @@ static const uint8_t kFavoriteBitDec[kNumFavorites] = {
|
|||||||
dierr = pGFD->Read(&sctBuf, sizeof(sctBuf), &actual);
|
dierr = pGFD->Read(&sctBuf, sizeof(sctBuf), &actual);
|
||||||
if (dierr == kDIErrNone) {
|
if (dierr == kDIErrNone) {
|
||||||
if (actual > /*kMaxExcessByteCount*/ 256) {
|
if (actual > /*kMaxExcessByteCount*/ 256) {
|
||||||
LOGI(" DDD looks like too much data in input file (%zd extra)",
|
LOGW(" DDD looks like too much data in input file (%lu extra)",
|
||||||
actual);
|
(unsigned long) actual);
|
||||||
dierr = kDIErrBadCompressedData;
|
dierr = kDIErrBadCompressedData;
|
||||||
goto bail;
|
goto bail;
|
||||||
} else {
|
} else {
|
||||||
LOGI(" DDD excess bytes (%zd) within normal parameters", actual);
|
LOGI(" DDD excess bytes (%lu) within normal parameters",
|
||||||
|
(unsigned long) actual);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2884,8 +2884,8 @@ bail:
|
|||||||
*/
|
*/
|
||||||
DIError A2FDDOS::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDDOS::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" DOS reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" DOS reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
|
|
||||||
A2FileDOS* pFile = (A2FileDOS*) fpFile;
|
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();
|
DiskFSDOS33* pDiskFS = (DiskFSDOS33*) fpFile->GetDiskFS();
|
||||||
uint8_t sctBuf[kSctSize];
|
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
|
if (len >= 0x01000000) { // 16MB
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -394,8 +394,8 @@ DIError A2FileFAT::Open(A2FileDescr** ppOpenFile, bool readOnly,
|
|||||||
*/
|
*/
|
||||||
DIError A2FDFAT::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDFAT::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGD(" FAT reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" FAT reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
|
|
||||||
A2FileFAT* pFile = (A2FileFAT*) fpFile;
|
A2FileFAT* pFile = (A2FileFAT*) fpFile;
|
||||||
|
|
||||||
|
@ -142,8 +142,8 @@ DIError GFDFile::Read(void* buf, size_t length, size_t* pActual)
|
|||||||
if (pActual == NULL) {
|
if (pActual == NULL) {
|
||||||
if (actual != length) {
|
if (actual != length) {
|
||||||
dierr = ErrnoOrGeneric();
|
dierr = ErrnoOrGeneric();
|
||||||
LOGI(" GDFile Read failed on %zd bytes (actual=%zd, err=%d)",
|
LOGW(" GDFile Read failed on %lu bytes (actual=%lu, err=%d)",
|
||||||
length, actual, dierr);
|
(unsigned long) length, (unsigned long) actual, dierr);
|
||||||
return dierr;
|
return dierr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -163,7 +163,8 @@ DIError GFDFile::Write(const void* buf, size_t length, size_t* pActual)
|
|||||||
assert(pActual == NULL); // not handling this yet
|
assert(pActual == NULL); // not handling this yet
|
||||||
if (::fwrite(buf, length, 1, fFp) != 1) {
|
if (::fwrite(buf, length, 1, fFp) != 1) {
|
||||||
dierr = ErrnoOrGeneric();
|
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;
|
||||||
}
|
}
|
||||||
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 (fCurrentOffset + (long)length > fLength) {
|
||||||
if (pActual == NULL) {
|
if (pActual == NULL) {
|
||||||
LOGI(" GFDBuffer underrrun off=%ld len=%zd flen=%ld",
|
LOGW(" GFDBuffer underrrun off=%ld len=%lu flen=%ld",
|
||||||
(long) fCurrentOffset, length, (long) fLength);
|
(long) fCurrentOffset, (unsigned long) length, (long) fLength);
|
||||||
return kDIErrDataUnderrun;
|
return kDIErrDataUnderrun;
|
||||||
} else {
|
} else {
|
||||||
/* set *pActual and adjust "length" */
|
/* 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
|
assert(pActual == NULL); // not handling this yet
|
||||||
if (fCurrentOffset + (long)length > fLength) {
|
if (fCurrentOffset + (long)length > fLength) {
|
||||||
if (!fDoExpand) {
|
if (!fDoExpand) {
|
||||||
LOGI(" GFDBuffer overrun off=%ld len=%zd flen=%ld",
|
LOGI(" GFDBuffer overrun off=%ld len=%lu flen=%ld",
|
||||||
(long) fCurrentOffset, length, (long) fLength);
|
(long) fCurrentOffset, (unsigned long) length, (long) fLength);
|
||||||
return kDIErrDataOverrun;
|
return kDIErrDataOverrun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,8 +523,8 @@ void A2FileGutenberg::Dump(void) const
|
|||||||
*/
|
*/
|
||||||
DIError A2FDGutenberg::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDGutenberg::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" Gutenberg reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" Gutenberg reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
|
|
||||||
A2FileGutenberg* pFile = (A2FileGutenberg*) fpFile;
|
A2FileGutenberg* pFile = (A2FileGutenberg*) fpFile;
|
||||||
|
|
||||||
|
@ -1855,8 +1855,9 @@ DIError A2FDHFS::Read(void* buf, size_t len, size_t* pActual)
|
|||||||
{
|
{
|
||||||
long result;
|
long result;
|
||||||
|
|
||||||
LOGI(" HFS reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" HFS reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
|
(unsigned long) len, fpFile->GetPathName(),
|
||||||
|
hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
|
||||||
|
|
||||||
//A2FileHFS* pFile = (A2FileHFS*) fpFile;
|
//A2FileHFS* pFile = (A2FileHFS*) fpFile;
|
||||||
|
|
||||||
@ -1896,8 +1897,9 @@ DIError A2FDHFS::Write(const void* buf, size_t len, size_t* pActual)
|
|||||||
{
|
{
|
||||||
long result;
|
long result;
|
||||||
|
|
||||||
LOGI(" HFS writing %zd bytes to '%s' (offset=%ld)",
|
LOGD(" HFS writing %lu bytes to '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
|
(unsigned long) len, fpFile->GetPathName(),
|
||||||
|
hfs_seek(fHfsFile, 0, HFS_SEEK_CUR));
|
||||||
|
|
||||||
fModified = true; // assume something gets changed
|
fModified = true; // assume something gets changed
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ DIError OuterGzip::Save(GenericFD* pOuterGFD, GenericFD* pWrapperGFD,
|
|||||||
|
|
||||||
written = gzwrite(gzfp, buf, actual);
|
written = gzwrite(gzfp, buf, actual);
|
||||||
if (written == 0) {
|
if (written == 0) {
|
||||||
LOGI("Failed writing %zd bytes to gzio", actual);
|
LOGE("Failed writing %lu bytes to gzio", (unsigned long) actual);
|
||||||
dierr = kDIErrGeneric;
|
dierr = kDIErrGeneric;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ DIError OuterGzip::Save(GenericFD* pOuterGFD, GenericFD* pWrapperGFD,
|
|||||||
}
|
}
|
||||||
assert(wrapperLength == 0); // not expecting any slop
|
assert(wrapperLength == 0); // not expecting any slop
|
||||||
|
|
||||||
LOGI(" GZ wrote %ld bytes", totalWritten);
|
LOGD(" GZ wrote %ld bytes", totalWritten);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Success!
|
* Success!
|
||||||
|
@ -1579,8 +1579,8 @@ DIError A2FilePascal::Open(A2FileDescr** ppOpenFile, bool readOnly,
|
|||||||
*/
|
*/
|
||||||
DIError A2FDPascal::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDPascal::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" Pascal reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" Pascal reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
|
|
||||||
A2FilePascal* pFile = (A2FilePascal*) fpFile;
|
A2FilePascal* pFile = (A2FilePascal*) fpFile;
|
||||||
|
|
||||||
@ -1644,7 +1644,7 @@ DIError A2FDPascal::Write(const void* buf, size_t len, size_t* pActual)
|
|||||||
uint8_t blkBuf[kBlkSize];
|
uint8_t blkBuf[kBlkSize];
|
||||||
size_t origLen = len;
|
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
|
if (len >= 0x01000000) { // 16MB
|
||||||
assert(false);
|
assert(false);
|
||||||
@ -1669,8 +1669,8 @@ DIError A2FDPascal::Write(const void* buf, size_t len, size_t* pActual)
|
|||||||
blocksAvail = pNextFile->fStartBlock - pFile->fStartBlock;
|
blocksAvail = pNextFile->fStartBlock - pFile->fStartBlock;
|
||||||
|
|
||||||
blocksNeeded = (len + kBlkSize -1) / kBlkSize;
|
blocksNeeded = (len + kBlkSize -1) / kBlkSize;
|
||||||
LOGI("Pascal write '%s' %zd bytes: avail=%ld needed=%ld",
|
LOGD("Pascal write '%s' %lu bytes: avail=%ld needed=%ld",
|
||||||
pFile->GetPathName(), len, blocksAvail, blocksNeeded);
|
pFile->GetPathName(), (unsigned long) len, blocksAvail, blocksNeeded);
|
||||||
if (blocksAvail < blocksNeeded)
|
if (blocksAvail < blocksNeeded)
|
||||||
return kDIErrDiskFull;
|
return kDIErrDiskFull;
|
||||||
|
|
||||||
|
@ -3652,8 +3652,8 @@ DIError DiskFSProDOS::SetFileInfo(A2File* pGenericFile, long fileType,
|
|||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
if ((size_t) (*ptr & 0x0f) != strlen(pFile->fDirEntry.fileName)) {
|
if ((size_t) (*ptr & 0x0f) != strlen(pFile->fDirEntry.fileName)) {
|
||||||
LOGI("ProDOS GLITCH: wrong file? (len=%d vs %zd)",
|
LOGW("ProDOS GLITCH: wrong file? (len=%d vs %u)",
|
||||||
*ptr & 0x0f, strlen(pFile->fDirEntry.fileName));
|
*ptr & 0x0f, (unsigned int) strlen(pFile->fDirEntry.fileName));
|
||||||
assert(false);
|
assert(false);
|
||||||
dierr = kDIErrBadDirectory;
|
dierr = kDIErrBadDirectory;
|
||||||
goto bail;
|
goto bail;
|
||||||
@ -4392,8 +4392,8 @@ void A2FileProDOS::Dump(void) const
|
|||||||
*/
|
*/
|
||||||
DIError A2FDProDOS::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDProDOS::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" ProDOS reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" ProDOS reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
//if (fBlockList == NULL)
|
//if (fBlockList == NULL)
|
||||||
// return kDIErrNotReady;
|
// return kDIErrNotReady;
|
||||||
|
|
||||||
@ -4772,8 +4772,8 @@ DIError A2FDProDOS::WriteDirectory(const void* buf, size_t len, size_t* pActual)
|
|||||||
{
|
{
|
||||||
DIError dierr = kDIErrNone;
|
DIError dierr = kDIErrNone;
|
||||||
|
|
||||||
LOGI("ProDOS writing %zd bytes to directory '%s'",
|
LOGD("ProDOS writing %lu bytes to directory '%s'",
|
||||||
len, fpFile->GetPathName());
|
(unsigned long) len, fpFile->GetPathName());
|
||||||
|
|
||||||
assert(len >= (size_t)kBlkSize);
|
assert(len >= (size_t)kBlkSize);
|
||||||
assert((len % kBlkSize) == 0);
|
assert((len % kBlkSize) == 0);
|
||||||
|
@ -533,8 +533,8 @@ DIError A2FileRDOS::Open(A2FileDescr** ppOpenFile, bool readOnly,
|
|||||||
*/
|
*/
|
||||||
DIError A2FDRDOS::Read(void* buf, size_t len, size_t* pActual)
|
DIError A2FDRDOS::Read(void* buf, size_t len, size_t* pActual)
|
||||||
{
|
{
|
||||||
LOGI(" RDOS reading %zd bytes from '%s' (offset=%ld)",
|
LOGD(" RDOS reading %lu bytes from '%s' (offset=%ld)",
|
||||||
len, fpFile->GetPathName(), (long) fOffset);
|
(unsigned long) len, fpFile->GetPathName(), (long) fOffset);
|
||||||
//if (!fOpen)
|
//if (!fOpen)
|
||||||
// return kDIErrNotReady;
|
// return kDIErrNotReady;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user