[tool] Update format specifiers for 64-bit integers in output

This commit is contained in:
2025-08-01 02:22:26 +01:00
parent 818101bf42
commit 87341b4cbd
3 changed files with 30 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ int32_t aaruf_verify_image(void *context)
if(ctx->magic != AARU_MAGIC) return AARUF_ERROR_NOT_AARUFORMAT;
// This will traverse all blocks and check their CRC64 without uncompressing them
fprintf(stderr, "Checking index integrity at %lu.\n", ctx->header.indexOffset);
fprintf(stderr, "Checking index integrity at %llu.\n", ctx->header.indexOffset);
fseek(ctx->imageStream, ctx->header.indexOffset, SEEK_SET);
read_bytes = fread(&index_header, 1, sizeof(IndexHeader), ctx->imageStream);
@@ -62,7 +62,7 @@ int32_t aaruf_verify_image(void *context)
return AARUF_ERROR_CANNOT_READ_INDEX;
}
fprintf(stderr, "Index at %lu contains %d entries.\n", ctx->header.indexOffset, index_header.entries);
fprintf(stderr, "Index at %llu contains %d entries.\n", ctx->header.indexOffset, index_header.entries);
index_entries = malloc(sizeof(IndexEntry) * index_header.entries);
@@ -88,7 +88,7 @@ int32_t aaruf_verify_image(void *context)
if(crc64 != index_header.crc64)
{
fprintf(stderr, "Expected index CRC 0x%16lX but got 0x%16lX.\n", index_header.crc64, crc64);
fprintf(stderr, "Expected index CRC 0x%16llX but got 0x%16lX.\n", index_header.crc64, crc64);
free(index_entries);
return AARUF_ERROR_INVALID_BLOCK_CRC;
}
@@ -148,7 +148,7 @@ int32_t aaruf_verify_image(void *context)
if(crc64 != block_header.cmpCrc64)
{
fprintf(stderr, "Expected block CRC 0x%16lX but got 0x%16lX.\n", block_header.cmpCrc64, crc64);
fprintf(stderr, "Expected block CRC 0x%16llX but got 0x%16lX.\n", block_header.cmpCrc64, crc64);
free(index_entries);
return AARUF_ERROR_INVALID_BLOCK_CRC;
}
@@ -191,7 +191,7 @@ int32_t aaruf_verify_image(void *context)
if(crc64 != ddt_header.cmpCrc64)
{
fprintf(stderr, "Expected DDT CRC 0x%16lX but got 0x%16lX.\n", ddt_header.cmpCrc64, crc64);
fprintf(stderr, "Expected DDT CRC 0x%16llX but got 0x%16llX.\n", ddt_header.cmpCrc64, crc64);
free(index_entries);
return AARUF_ERROR_INVALID_BLOCK_CRC;
}
@@ -225,7 +225,7 @@ int32_t aaruf_verify_image(void *context)
if(crc64 != tracks_header.crc64)
{
fprintf(stderr, "Expected DDT CRC 0x%16lX but got 0x%16lX.\n", tracks_header.crc64, crc64);
fprintf(stderr, "Expected DDT CRC 0x%16llX but got 0x%16llX.\n", tracks_header.crc64, crc64);
free(index_entries);
return AARUF_ERROR_INVALID_BLOCK_CRC;
}

View File

@@ -58,9 +58,9 @@ int info(char *path)
printf("\tApplication version: %d.%d\n", ctx->header.applicationMinorVersion, ctx->header.applicationMajorVersion);
printf("\tImage format version: %d.%d\n", ctx->header.imageMajorVersion, ctx->header.imageMinorVersion);
printf("\tMedia type: %d\n", ctx->header.mediaType);
printf("\tIndex offset: %lu\n", ctx->header.indexOffset);
printf("\tCreation time: %ld\n", ctx->header.creationTime);
printf("\tLast written time: %ld\n", ctx->header.lastWrittenTime);
printf("\tIndex offset: %llu\n", ctx->header.indexOffset);
printf("\tCreation time: %lld\n", ctx->header.creationTime);
printf("\tLast written time: %lld\n", ctx->header.lastWrittenTime);
// TODO: Traverse media tags
@@ -241,9 +241,9 @@ int info(char *path)
printf("\tTrack entry %d:\n", i);
printf("\t\tSequence: %d\n", ctx->trackEntries[i].sequence);
printf("\t\tType: %d\n", ctx->trackEntries[i].type);
printf("\t\tStart: %ld\n", ctx->trackEntries[i].start);
printf("\t\tEnd: %ld\n", ctx->trackEntries[i].end);
printf("\t\tPregap: %ld\n", ctx->trackEntries[i].pregap);
printf("\t\tStart: %lld\n", ctx->trackEntries[i].start);
printf("\t\tEnd: %lld\n", ctx->trackEntries[i].end);
printf("\t\tPregap: %lld\n", ctx->trackEntries[i].pregap);
printf("\t\tSession: %d\n", ctx->trackEntries[i].session);
printf("\t\tISRC: %.13s\n", ctx->trackEntries[i].isrc);
printf("\t\tFlags: %d\n", ctx->trackEntries[i].flags);
@@ -361,8 +361,8 @@ int info(char *path)
for(j = 0; j < ctx->dumpHardwareEntriesWithData[i].entry.extents; j++)
{
printf("\t\tExtent %d:\n", j);
printf("\t\t\tStart: %lu\n", ctx->dumpHardwareEntriesWithData[i].extents[j].start);
printf("\t\t\tEnd: %lu\n", ctx->dumpHardwareEntriesWithData[i].extents[j].end);
printf("\t\t\tStart: %llu\n", ctx->dumpHardwareEntriesWithData[i].extents[j].start);
printf("\t\t\tEnd: %llu\n", ctx->dumpHardwareEntriesWithData[i].extents[j].end);
}
}
}
@@ -376,20 +376,20 @@ int info(char *path)
if(ctx->blockHeaderCache.max_items > 0)
{
if(ctx->blockHeaderCache.cache != NULL) printf("Block header cache has been initialized.\n");
printf("Block header cache can contain a maximum of %lu items.\n", ctx->blockHeaderCache.max_items);
printf("Block header cache can contain a maximum of %llu items.\n", ctx->blockHeaderCache.max_items);
}
if(ctx->blockCache.max_items > 0)
{
if(ctx->blockCache.cache != NULL) printf("Block cache has been initialized.\n");
printf("Block cache can contain a maximum of %lu items.\n", ctx->blockCache.max_items);
printf("Block cache can contain a maximum of %llu items.\n", ctx->blockCache.max_items);
}
printf("Aaru's ImageInfo:\n");
printf("\tHas partitions?: %s\n", ctx->imageInfo.HasPartitions ? "yes" : "no");
printf("\tHas sessions?: %s\n", ctx->imageInfo.HasSessions ? "yes" : "no");
printf("\tImage size without headers: %lu bytes\n", ctx->imageInfo.ImageSize);
printf("\tImage contains %lu sectors\n", ctx->imageInfo.Sectors);
printf("\tImage size without headers: %llu bytes\n", ctx->imageInfo.ImageSize);
printf("\tImage contains %llu sectors\n", ctx->imageInfo.Sectors);
printf("\tBiggest sector is %d bytes\n", ctx->imageInfo.SectorSize);
printf("\tImage version: %s\n", ctx->imageInfo.Version);
@@ -405,8 +405,8 @@ int info(char *path)
if(ctx->imageInfo.ApplicationVersion != NULL)
printf("\tApplication version: %s\n", ctx->imageInfo.ApplicationVersion);
if(ctx->imageInfo.Creator != NULL) printf("\tCreator: %s\n", ctx->imageInfo.Creator);
printf("\tCreation time: %ld\n", ctx->imageInfo.CreationTime);
printf("\tLast written time: %ld\n", ctx->imageInfo.LastModificationTime);
printf("\tCreation time: %lld\n", ctx->imageInfo.CreationTime);
printf("\tLast written time: %lld\n", ctx->imageInfo.LastModificationTime);
if(ctx->imageInfo.Comments != NULL) printf("\tComments: %s\n", ctx->imageInfo.Comments);
if(ctx->imageInfo.MediaTitle != NULL) printf("\tMedia title: %s\n", ctx->imageInfo.MediaTitle);
if(ctx->imageInfo.MediaManufacturer != NULL) printf("\tMedia manufacturer: %s\n", ctx->imageInfo.MediaManufacturer);

View File

@@ -81,12 +81,12 @@ int verify_sectors(char *path)
for(s = 0; s < ctx->imageInfo.Sectors; s++)
{
printf("\rVerifying sector %lu...", s);
printf("\rVerifying sector %llu...", s);
res = aaruf_read_sector_long(ctx, s, buffer, &buffer_len);
if(res != AARUF_STATUS_OK)
{
fprintf(stderr, "\rError %d reading sector %lu\n.", res, s);
fprintf(stderr, "\rError %d reading sector %llu\n.", res, s);
continue;
}
@@ -98,15 +98,15 @@ int verify_sectors(char *path)
if(unknown)
{
unknowns++;
printf("\rSector %lu cannot be verified.\n", s);
printf("\rSector %llu cannot be verified.\n", s);
continue;
}
if(has_edc && !edc_correct) printf("\rSector %lu has an incorrect EDC value.\n", s);
if (has_edc && !edc_correct) printf("\rSector %llu has an incorrect EDC value.\n", s);
if(has_ecc_p && !ecc_p_correct) printf("\rSector %lu has an incorrect EDC value.\n", s);
if (has_ecc_p && !ecc_p_correct) printf("\rSector %llu has an incorrect EDC value.\n", s);
if(has_ecc_q && !ecc_q_correct) printf("\rSector %lu has an incorrect EDC value.\n", s);
if (has_ecc_q && !ecc_q_correct) printf("\rSector %llu has an incorrect EDC value.\n", s);
errors++;
any_error = true;
@@ -117,10 +117,10 @@ int verify_sectors(char *path)
else
printf("\rAll sector checksums are correct.\n");
printf("Total sectors........... %lu\n", ctx->imageInfo.Sectors);
printf("Total errors............ %lu\n", errors);
printf("Total unknowns.......... %lu\n", unknowns);
printf("Total errors+unknowns... %lu\n", errors + unknowns);
printf("Total sectors........... %llu\n", ctx->imageInfo.Sectors);
printf("Total errors............ %llu\n", errors);
printf("Total unknowns.......... %llu\n", unknowns);
printf("Total errors+unknowns... %llu\n", errors + unknowns);
return AARUF_STATUS_OK;
}