fix: replace %ldd/%ld by PRId64 to remove warnings on all archs

This commit is contained in:
Stéphane Lesimple
2021-01-15 19:38:58 +01:00
parent a3aedbd4a2
commit e8eb7824aa
33 changed files with 484 additions and 471 deletions

View File

@@ -694,7 +694,7 @@ static int query_dvd(DeviceHandle *dh, int probe_only)
dh->userAreaSize = (gint64)(ua_end-ua_start);
if(dh->userAreaSize < 0 || dh->userAreaSize > MAX_DVD_SL_SIZE)
{ LogWarning(_("READ DVD STRUCTURE: implausible medium size, %lld-%lld=%lld sectors\n"),
{ LogWarning(_("READ DVD STRUCTURE: implausible medium size, %" PRId64 "-%" PRId64 "=%" PRId64 " sectors\n"),
(gint64)ua_end, (gint64)ua_start, (gint64)dh->userAreaSize);
dh->userAreaSize = 0;
}
@@ -704,7 +704,7 @@ static int query_dvd(DeviceHandle *dh, int probe_only)
dh->userAreaSize = (gint64)(ua_end0-ua_start)*2;
if(dh->userAreaSize < 0 || dh->userAreaSize > MAX_DVD_DL_SIZE)
{ LogWarning(_("READ DVD STRUCTURE: implausible medium size, %lld-%lld=%lld sectors\n"),
{ LogWarning(_("READ DVD STRUCTURE: implausible medium size, %" PRId64 "-%" PRId64 "=%" PRId64 " sectors\n"),
(gint64)ua_end0, (gint64)ua_start, (gint64)dh->userAreaSize);
dh->userAreaSize = 0;
}
@@ -1371,7 +1371,7 @@ int QueryBlankCapacity(DeviceHandle *dh)
{ gint64 size;
size = (gint64)(buf[idx]<<24 | buf[idx+1]<<16 | buf[idx+2]<<8 | buf[idx+3]);
Verbose("#DVD: Cap list %d - type %x, size %lld\n", i, buf[idx+4]>>2, size);
Verbose("#DVD: Cap list %d - type %x, size %" PRId64 "\n", i, buf[idx+4]>>2, size);
switch(buf[idx+4]>>2) /* format type */
{ case 0x00: /* all media */
@@ -1441,7 +1441,7 @@ int QueryBlankCapacity(DeviceHandle *dh)
size = (gint64)(buf[idx]<<24 | buf[idx+1]<<16 | buf[idx+2]<<8 | buf[idx+3]);
sa_size = buf[idx+5]<<16 | buf[idx+6]<<8 | buf[idx+7];
Verbose("#BD: Cap list %d - type %x, size %lld, spare %d\n",
Verbose("#BD: Cap list %d - type %x, size %" PRId64 ", spare %d\n",
i, buf[idx+4]>>2, size, sa_size);
switch(buf[idx+4]>>2) /* format type */
@@ -1772,8 +1772,8 @@ static int check_sector(DeviceHandle *dh, GString *msg_out, guint64 sector, int
}
if(n_sectors == 1)
g_string_append_printf(msg_out, _("Sector %lld: %s\n"), sector, msg);
else g_string_append_printf(msg_out, _("Sectors %lld-%lld: %s\n"),
g_string_append_printf(msg_out, _("Sector %" PRId64 ": %s\n"), sector, msg);
else g_string_append_printf(msg_out, _("Sectors %" PRId64 "-%" PRId64 ": %s\n"),
sector, sector+n_sectors-1, msg);
return result;
@@ -1838,7 +1838,7 @@ static void read_capacity(Image *image)
}
dh->readCapacity = (gint64)(buf[0]<<24 | buf[1]<<16 | buf[2]<<8 | buf[3]);
Verbose(" -> %lld\n", dh->readCapacity);
Verbose(" -> %" PRId64 "\n", dh->readCapacity);
FreeAlignedBuffer(ab);
/*** Validate capacity */
@@ -1853,7 +1853,7 @@ static void read_capacity(Image *image)
implausible = TRUE;
if(implausible && !dh->simImage)
{ LogWarning(_("READ CAPACITY: implausible medium size, %lld sectors\n"),
{ LogWarning(_("READ CAPACITY: implausible medium size, %" PRId64 " sectors\n"),
(gint64)dh->readCapacity);
dh->readCapacity = 0;
}
@@ -1873,7 +1873,7 @@ static gint64 query_size(Image *image)
for the medium size. */
if(image->expectedSectors > 0)
{ Verbose("Medium size obtained from ECC header: %lld sectors\n", image->expectedSectors);
{ Verbose("Medium size obtained from ECC header: %" PRId64 " sectors\n", image->expectedSectors);
return image->expectedSectors;
}
else Verbose("Medium size could NOT be determined from ECC header.\n");
@@ -1897,7 +1897,7 @@ static gint64 query_size(Image *image)
/* For CD media, thats all we have to do */
if(dh->mainType == CD)
{ Verbose("CD medium - using size from READ CAPACITY: %lld sectors\n", dh->readCapacity+1);
{ Verbose("CD medium - using size from READ CAPACITY: %" PRId64 " sectors\n", dh->readCapacity+1);
return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */
}
@@ -1905,7 +1905,7 @@ static gint64 query_size(Image *image)
work as unformatted sectors can be always read. Stick with READ CAPACITY. */
if(dh->mainType == BD)
{ Verbose("BD medium - using size from READ CAPACITY: %lld sectors\n", dh->readCapacity+1);
{ Verbose("BD medium - using size from READ CAPACITY: %" PRId64 " sectors\n", dh->readCapacity+1);
return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */
}
@@ -1915,7 +1915,7 @@ static gint64 query_size(Image *image)
so we have to be careful here. */
if(dh->readCapacity == dh->userAreaSize) /* If they are equal just return one */
{ Verbose("READ CAPACITY and READ DVD STRUCTURE agree: %lld sectors\n", dh->readCapacity+1);
{ Verbose("READ CAPACITY and READ DVD STRUCTURE agree: %" PRId64 " sectors\n", dh->readCapacity+1);
return dh->readCapacity+1;
}
else /* Tricky case. Try some heuristics. */
@@ -1930,8 +1930,8 @@ static gint64 query_size(Image *image)
warning = g_string_sized_new(1024);
g_string_printf(warning,
_("Different media sizes depending on query method:\n"
"READ CAPACITY: %lld sectors\n"
"READ DVD STRUCTURE: %lld sectors\n\n"),
"READ CAPACITY: %" PRId64 " sectors\n"
"READ DVD STRUCTURE: %" PRId64 " sectors\n\n"),
dh->readCapacity+1, dh->userAreaSize+1);
g_string_append(warning, _("Evaluation of returned medium sizes:\n\n"));
@@ -2508,7 +2508,7 @@ int ReadSectors(DeviceHandle *dh, unsigned char *buf, gint64 s, int nsectors)
// if(dh->canReadDefective && nsectors > 1 && Closure->sectorSkip == 0)
if(nsectors > 1 && Closure->sectorSkip == 0)
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
_("Sectors %lld - %lld: %s\n"),
_("Sectors %" PRId64 " - %" PRId64 ": %s\n"),
s, s+nsectors-1, GetLastSenseString(FALSE));
return status;
}
@@ -2522,13 +2522,13 @@ int ReadSectors(DeviceHandle *dh, unsigned char *buf, gint64 s, int nsectors)
if(last_key == 3 && last_asc == 255 && last_ascq == 2 && dh->rawBuffer)
{ unsigned char *frame = dh->rawBuffer->workBuf->buf;
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
_("Sector %lld, try %d: %s Sector returned: %d.\n"),
_("Sector %" PRId64 ", try %d: %s Sector returned: %d.\n"),
s, retry, GetLastSenseString(FALSE),
MSFtoLBA(frame[12], frame[13], frame[14]));
}
else
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
_("Sector %lld, try %d: %s\n"),
_("Sector %" PRId64 ", try %d: %s\n"),
s, retry, GetLastSenseString(FALSE));
/* Last attempt; create failure notice */
@@ -2539,7 +2539,7 @@ int ReadSectors(DeviceHandle *dh, unsigned char *buf, gint64 s, int nsectors)
else /* good return status */
{ if(recommended_attempts > 1 && retry > 1)
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
_("Sector %lld, try %d: success\n"), s, retry);
_("Sector %" PRId64 ", try %d: success\n"), s, retry);
break;
}
@@ -2711,7 +2711,7 @@ Image* OpenImageFromDevice(char *device, int query_only)
Verbose("# Calling query_size()\n");
dh->sectors = query_size(image);
Verbose("# returned: %lld sectors\n", dh->sectors);
Verbose("# returned: %" PRId64 " sectors\n", dh->sectors);
subTypeMasked = dh->subType & MAIN_TYPE_MASK;
/* Handle the special case of blank CDs, that have no subType
@@ -2727,11 +2727,11 @@ Image* OpenImageFromDevice(char *device, int query_only)
case CD:
{ char *tmp;
if(!image->isoInfo) // || dh->rs02Size > 0)
tmp = g_strdup_printf(_("Medium: %s, %lld sectors%s"),
tmp = g_strdup_printf(_("Medium: %s, %" PRId64 " sectors%s"),
dh->typeDescr, dh->sectors,
image->expectedSectors ? ", Ecc" : ""); //fixme: validate
else
tmp = g_strdup_printf(_("Medium \"%s\": %s, %lld sectors%s created %s"),
tmp = g_strdup_printf(_("Medium \"%s\": %s, %" PRId64 " sectors%s created %s"),
image->isoInfo->volumeLabel,
dh->typeDescr, dh->sectors,
image->expectedSectors ? ", Ecc," : ",", //fixme: validate