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

4
configure vendored
View File

@@ -19,8 +19,8 @@ if [ "$DEBUG_PRINTF_FORMAT" = 1 ]; then
# not catched by the compiler because of the _() macro
REQUIRED_CFLAGS="-DDEBUG_PRINTF_FORMAT $REQUIRED_CFLAGS"
else
# warnings given by -Wformat-security are bogus
# because of _(), see above comment.
# warnings given by -Wformat-security are bogus because of _(),
# see above comment if you actually want to check for format errors
RECOMMENDED_CFLAGS="$RECOMMENDED_CFLAGS -Wno-format-security"
fi

View File

@@ -231,7 +231,7 @@ void PrintCrcBuf(CrcBuf *cb)
return;
PrintLog("CrcBuf contents, image path %s:\n", cb->imageName ? cb->imageName : "none (medium)" );
PrintLog(" crcSize: %lld, dataSectors: %lld, coveredSectors: %lld, allSectors: %lld\n",
PrintLog(" crcSize: %" PRId64 ", dataSectors: %" PRId64 ", coveredSectors: %" PRId64 ", allSectors: %" PRId64 "\n",
cb->crcSize, cb->dataSectors, cb->coveredSectors, cb->allSectors);
PrintLog(" md5State:");
@@ -258,5 +258,5 @@ void PrintCrcBuf(CrcBuf *cb)
if(!GetBit(cb->valid, i))
{ missing++;
}
PrintLog(" missing crcs: %lld\n", missing);
PrintLog(" missing crcs: %" PRId64 "\n", missing);
}

View File

@@ -100,7 +100,7 @@ static void random_error1(Image *image, char *arg)
if(block_sel[i] && block_idx[i]<image->sectorSize)
{ if(!LargeSeek(image->file, (gint64)(2048*block_idx[i])))
Stop(_("Failed seeking to sector %lld in image: %s"),block_idx[i],strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),block_idx[i],strerror(errno));
CreateMissingSector(missing, block_idx[i], image->imageFP, FINGERPRINT_SECTOR, NULL);
@@ -108,7 +108,7 @@ static void random_error1(Image *image, char *arg)
write_size = image->inLast;
if(LargeWrite(image->file, missing, write_size) != write_size)
Stop(_("Failed writing to sector %lld in image: %s"),block_idx[i],strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),block_idx[i],strerror(errno));
}
block_idx[i]++;
@@ -188,12 +188,12 @@ static void random_error2(Image *image, char *arg)
{ unsigned char missing[2048];
if(!LargeSeek(image->file, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), s, strerror(errno));
CreateMissingSector(missing, s, image->imageFP, image->fpSector, NULL);
if(LargeWrite(image->file, missing, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), s, strerror(errno));
}
}
@@ -236,11 +236,11 @@ static void random_error2(Image *image, char *arg)
else s = RS02EccSectorIndex(lay, i-eh->dataBytes, si);
if(!LargeSeek(image->file, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), s, strerror(errno));
CreateMissingSector(missing, s, image->imageFP, image->fpSector, NULL);
if(LargeWrite(image->file, missing, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), s, strerror(errno));
}
}
@@ -360,12 +360,12 @@ static void random_error3(Image *image, char *arg)
}
if(!LargeSeek(file, (gint64)(2048*file_s))) // FIXME: wrong for ecc files
Stop(_("Failed seeking to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), s, strerror(errno));
CreateMissingSector(missing, s, image->imageFP, image->fpSector, NULL);
if(LargeWrite(file, missing, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), s, strerror(errno));
}
}
@@ -459,7 +459,7 @@ void Byteset(char *arg)
byte = atoi(cpos+1);
if(s<0 || s>=image->sectorSize)
Stop(_("Sector must be in range [0..%lld]\n"),image->sectorSize-1);
Stop(_("Sector must be in range [0..%" PRId64 "]\n"),image->sectorSize-1);
if(i<0 || i>=2048)
Stop(_("Byte position must be in range [0..2047]"));
@@ -467,7 +467,7 @@ void Byteset(char *arg)
if(byte<0 || byte>=256)
Stop(_("Byte value must be in range [0..255]"));
PrintLog(_("Setting byte %d in sector %lld to value %d.\n"), i, s, byte);
PrintLog(_("Setting byte %d in sector %" PRId64 " to value %d.\n"), i, s, byte);
/*** Set the byte */
@@ -521,9 +521,9 @@ void Erase(char *arg)
else start = end = atoi(arg);
if(start>end || start < 0 || end >= image->sectorSize)
Stop(_("Sectors must be in range [0..%lld].\n"),image->sectorSize-1);
Stop(_("Sectors must be in range [0..%" PRId64 "].\n"),image->sectorSize-1);
PrintLog(_("Erasing sectors [%lld,%lld]\n"),start,end);
PrintLog(_("Erasing sectors [%" PRId64 ",%" PRId64 "]\n"),start,end);
/*** Erase them. */
@@ -542,7 +542,7 @@ void Erase(char *arg)
n = LargeWrite(image->file, missing, m);
if(n != m)
Stop(_("Failed writing to sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),s,strerror(errno));
}
/*** Clean up */
@@ -569,9 +569,9 @@ void TruncateImageFile(char *arg)
end = atoi(arg);
if(end >= image->sectorSize)
Stop(_("New length must be in range [0..%lld].\n"),image->sectorSize-1);
Stop(_("New length must be in range [0..%" PRId64 "].\n"),image->sectorSize-1);
PrintLog(_("Truncating image to %lld sectors.\n"),end);
PrintLog(_("Truncating image to %" PRId64 " sectors.\n"),end);
/*** Truncate it. */
@@ -607,10 +607,10 @@ void RandomImage(char *image_name, char *n_sectors, int mark)
/*** Print banner */
PrintLog(_("\nCreating random image with %lld sectors.\n\n"
PrintLog(_("\nCreating random image with %" PRId64 " sectors.\n\n"
"There is no need for permanently storing this image;\n"
"you can always reproduce it by calling\n"
"dvdisaster --debug %s %lld --random-seed %d\n\n"),
"dvdisaster --debug %s %" PRId64 " --random-seed %d\n\n"),
sectors,
mark ? "--marked-image" : "--random-image",
sectors, Closure->randomSeed);
@@ -659,7 +659,7 @@ void RandomImage(char *image_name, char *n_sectors, int mark)
s++;
if(n != 2048)
Stop(_("Failed writing to sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),s,strerror(errno));
percent = (100*s)/sectors;
if(last_percent != percent)
@@ -697,20 +697,20 @@ void ZeroUnreadable(void)
{ int n = LargeRead(image->file, buf, 2048);
if(n != 2048)
Stop(_("Could not read image sector %lld:\n%s\n"),s,strerror(errno));
Stop(_("Could not read image sector %" PRId64 ":\n%s\n"),s,strerror(errno));
/* Replace the dead sector marker */
if(CheckForMissingSector(buf, s, image->imageFP, FINGERPRINT_SECTOR) != SECTOR_PRESENT)
{
if(!LargeSeek(image->file, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),s,strerror(errno));
n = LargeWrite(image->file, zeros, 2048);
n=2048;
if(n != 2048)
Stop(_("Failed writing to sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),s,strerror(errno));
cnt++;
}
@@ -722,7 +722,7 @@ void ZeroUnreadable(void)
}
}
PrintProgress(_("%lld \"unreadable sector\" markers replaced.\n"), cnt);
PrintProgress(_("%" PRId64 " \"unreadable sector\" markers replaced.\n"), cnt);
CloseImage(image);
}
@@ -799,16 +799,16 @@ void ShowHeader(char *arg)
sector = atoi(arg);
if(sector < 0 || sector >= image->sectorSize)
Stop(_("Sector must be in range [0..%lld]\n"),image->sectorSize-1);
Stop(_("Sector must be in range [0..%" PRId64 "]\n"),image->sectorSize-1);
/*** Load it. */
if(!LargeSeek(image->file, (gint64)(2048*sector)))
Stop(_("Failed seeking to sector %lld in image: %s"),sector,strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),sector,strerror(errno));
n = LargeRead(image->file, eh, 2048);
if(n != 2048)
Stop(_("Failed reading sector %lld in image: %s"),sector,strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"),sector,strerror(errno));
/*** Clean up */
@@ -840,18 +840,18 @@ void ShowSector(char *arg)
sector = atoi(arg);
if(sector < 0 || sector >= image->sectorSize)
Stop(_("Sector must be in range [0..%lld]\n"),image->sectorSize-1);
Stop(_("Sector must be in range [0..%" PRId64 "]\n"),image->sectorSize-1);
PrintLog(_("Contents of sector %lld:\n\n"),sector);
PrintLog(_("Contents of sector %" PRId64 ":\n\n"),sector);
/*** Show it. */
if(!LargeSeek(image->file, (gint64)(2048*sector)))
Stop(_("Failed seeking to sector %lld in image: %s"),sector,strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),sector,strerror(errno));
n = LargeRead(image->file, buf, 2048);
if(n != 2048)
Stop(_("Failed reading sector %lld in image: %s"),sector,strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"),sector,strerror(errno));
if(Closure->debugCDump)
CDump(buf, sector, 2048, 16);
@@ -888,10 +888,10 @@ void ReadSector(char *arg)
if(sector < 0 || sector >= image->dh->sectors)
{ CloseImage(image);
FreeAlignedBuffer(ab);
Stop(_("Sector must be in range [0..%lld]\n"),image->dh->sectors-1);
Stop(_("Sector must be in range [0..%" PRId64 "]\n"),image->dh->sectors-1);
}
PrintLog(_("Contents of sector %lld:\n\n"),sector);
PrintLog(_("Contents of sector %" PRId64 ":\n\n"),sector);
/*** Read it. */
@@ -902,7 +902,7 @@ void ReadSector(char *arg)
if(status)
{ CloseImage(image);
FreeAlignedBuffer(ab);
Stop(_("Failed reading sector %lld: %s"),sector,strerror(errno));
Stop(_("Failed reading sector %" PRId64 ": %s"),sector,strerror(errno));
}
if(Closure->debugCDump)
@@ -951,10 +951,10 @@ void RawSector(char *arg)
if(lba < 0 || lba >= image->dh->sectors)
{ CloseImage(image);
FreeAlignedBuffer(ab);
Stop(_("Sector must be in range [0..%lld]\n"),image->dh->sectors-1);
Stop(_("Sector must be in range [0..%" PRId64 "]\n"),image->dh->sectors-1);
}
PrintLog(_("Contents of sector %lld:\n\n"),lba);
PrintLog(_("Contents of sector %" PRId64 ":\n\n"),lba);
/*** Try the raw read */
@@ -1162,7 +1162,7 @@ void CopySector(char *arg)
LargeStat(from_path, &sectors); sectors /= 2048;
if(from_sector<0 || from_sector>sectors-1)
Stop(_("Source sector must be in range [0..%lld]\n"), sectors-1);
Stop(_("Source sector must be in range [0..%" PRId64 "]\n"), sectors-1);
if(!(to = LargeOpen(to_path, O_WRONLY, IMG_PERMS)))
@@ -1170,27 +1170,27 @@ void CopySector(char *arg)
LargeStat(to_path, &sectors); sectors /= 2048;
if(to_sector<0 || to_sector>sectors-1)
Stop(_("Destination sector must be in range [0..%lld]\n"), sectors-1);
Stop(_("Destination sector must be in range [0..%" PRId64 "]\n"), sectors-1);
/*** Copy the sector */
PrintLog(_("Copying sector %lld from %s to sector %lld in %s.\n"),
PrintLog(_("Copying sector %" PRId64 " from %s to sector %" PRId64 " in %s.\n"),
from_sector, from_path, to_sector, to_path);
if(!LargeSeek(from, (gint64)(2048*from_sector)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
from_sector, strerror(errno));
if(LargeRead(from, buf, 2048) != 2048)
Stop(_("Failed reading sector %lld in image: %s"),
Stop(_("Failed reading sector %" PRId64 " in image: %s"),
from_sector, strerror(errno));
if(!LargeSeek(to, (gint64)(2048*to_sector)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
to_sector, strerror(errno));
if(LargeWrite(to, buf, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),
to_sector, strerror(errno));
/*** Clean up */
@@ -1233,9 +1233,9 @@ void MergeImages(char *arg, int mode)
/*** Compare/merge the images */
if(!mode) PrintLog("Comparing %s (%lld sectors) with %s (%lld sectors).\n",
if(!mode) PrintLog("Comparing %s (%" PRId64 " sectors) with %s (%" PRId64 " sectors).\n",
left_path, left_sectors, right_path, right_sectors);
else PrintLog("Merging %s (%lld sectors) with %s (%lld sectors).\n",
else PrintLog("Merging %s (%" PRId64 " sectors) with %s (%" PRId64 " sectors).\n",
left_path, left_sectors, right_path, right_sectors);
/*** Compare them */
@@ -1249,33 +1249,33 @@ void MergeImages(char *arg, int mode)
{ unsigned char left_buf[2048], right_buf[2048];
if(LargeRead(left, left_buf, 2048) != 2048)
Stop(_("Failed reading sector %lld in image: %s"),
Stop(_("Failed reading sector %" PRId64 " in image: %s"),
s, strerror(errno));
if(LargeRead(right, right_buf, 2048) != 2048)
Stop(_("Failed reading sector %lld in image: %s"),
Stop(_("Failed reading sector %" PRId64 " in image: %s"),
s, strerror(errno));
if(memcmp(left_buf, right_buf, 2048))
{
if(CheckForMissingSector(left_buf, s, NULL, 0) != SECTOR_PRESENT)
{ if(!mode) PrintLog("< Sector %lld missing\n", s);
{ if(!mode) PrintLog("< Sector %" PRId64 " missing\n", s);
else
{ PrintLog("< Sector %lld missing; copied from %s.\n", s, right_path);
{ PrintLog("< Sector %" PRId64 " missing; copied from %s.\n", s, right_path);
if(!LargeSeek(left, (2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
s, strerror(errno));
if(LargeWrite(left, right_buf, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),
s, strerror(errno));
}
}
else if(CheckForMissingSector(right_buf, s, NULL, 0) != SECTOR_PRESENT)
{ PrintLog("> Sector %lld missing\n", s);
{ PrintLog("> Sector %" PRId64 " missing\n", s);
}
else
{ PrintLog("! Sector %lld differs in images\n", s);
{ PrintLog("! Sector %" PRId64 " differs in images\n", s);
}
}
@@ -1287,27 +1287,27 @@ void MergeImages(char *arg, int mode)
}
if(left_sectors > right_sectors)
{ PrintLog("%lld sectors missing at the end of %s\n",
{ PrintLog("%" PRId64 " sectors missing at the end of %s\n",
left_sectors-right_sectors, right_path);
}
if(left_sectors < right_sectors)
{ if(!mode)
PrintLog("%lld sectors missing at the end of %s\n",
PrintLog("%" PRId64 " sectors missing at the end of %s\n",
right_sectors-left_sectors, left_path);
else
{ unsigned char buf[2048];
PrintLog("Transferring %lld sectors from the end of %s to %s.\n",
PrintLog("Transferring %" PRId64 " sectors from the end of %s to %s.\n",
right_sectors-left_sectors, right_path, left_path);
for(s=left_sectors; s<right_sectors; s++)
{ if(LargeRead(right, buf, 2048) != 2048)
Stop(_("Failed reading sector %lld in image: %s"),
Stop(_("Failed reading sector %" PRId64 " in image: %s"),
s, strerror(errno));
if(LargeWrite(left, buf, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image: %s"),
s, strerror(errno));
}
}

View File

@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
wrong packing. */
if(sizeof(EccHeader) != 4096)
Stop("sizeof(EccHeader) is %d, but must be 4096.\n", sizeof(EccHeader));
Stop("sizeof(EccHeader) is %zu, but must be 4096.\n", sizeof(EccHeader));
/*** CPU type detection. Must be done before parsing the options
as some may be CPU-related. */
@@ -806,8 +806,8 @@ int main(int argc, char *argv[])
}
else
{ if(image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
}
image = OpenEccFileForImage(image, Closure->eccName, O_RDWR, IMG_PERMS);

View File

@@ -38,6 +38,19 @@
#define _GNU_SOURCE
/* under MinGW, __attribute__ format printf doesn't work and outputs warnings for %lld,
* even if it's supported and doesn't output any warning under -Wformat when directly
* used with the real printf() func. However 'gnu_printf' works, see
* https://github.com/ocornut/imgui/issues/3592
*/
#ifdef __MINGW32__ /* defined under 32 and 64 bits mingw */
# define PRINTF_FLAVOR gnu_printf
#else
# define PRINTF_FLAVOR printf
#endif
#define PRINTF_FORMAT2(ARG1,ARG2) __attribute__((format(PRINTF_FLAVOR, ARG1, ARG2)))
#define PRINTF_FORMAT(ARG) PRINTF_FORMAT2(ARG,ARG+1)
#include <glib.h>
#include <glib/gprintf.h>
#ifndef CLI
@@ -48,6 +61,7 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <inttypes.h> /* PRId64 et. al */
#ifdef WITH_NLS_YES
#include <libintl.h>
#include <locale.h>
@@ -662,7 +676,7 @@ void RedrawCurve(Curve*, int);
void HexDump(unsigned char*, int, int);
void LaTeXify(gint32*, int, int);
void AppendToTextFile(char*,char*, ...);
void AppendToTextFile(char*,char*, ...) PRINTF_FORMAT(2);
void CopySector(char*);
void Byteset(char*);
void Erase(char*);
@@ -807,8 +821,8 @@ LabelWithOnlineHelp* CreateLabelWithOnlineHelp(char*, char*);
LabelWithOnlineHelp* CloneLabelWithOnlineHelp(LabelWithOnlineHelp*, char*);
void FreeLabelWithOnlineHelp(LabelWithOnlineHelp*);
void SetOnlineHelpLinkText(LabelWithOnlineHelp*, char*);
void AddHelpListItem(LabelWithOnlineHelp*, char*, ...);
void AddHelpParagraph(LabelWithOnlineHelp*, char*, ...);
void AddHelpListItem(LabelWithOnlineHelp*, char*, ...) PRINTF_FORMAT(2);
void AddHelpParagraph(LabelWithOnlineHelp*, char*, ...) PRINTF_FORMAT(2);
void AddHelpWidget(LabelWithOnlineHelp*, GtkWidget*);
/* Specific online help dialogs */
@@ -819,7 +833,7 @@ void ShowLog();
void UpdateLog();
void AboutDialog();
void AboutText(GtkWidget*, char*, ...);
void AboutText(GtkWidget*, char*, ...) PRINTF_FORMAT(2);
void AboutLink(GtkWidget*, char*, char*);
void AboutTextWithLink(GtkWidget*, char*, char*);
#endif
@@ -970,7 +984,7 @@ int CountC2Errors(unsigned char*);
void DefaultLogFile();
void VPrintLogFile(char*, va_list);
void PrintLogFile(char*, ...);
void PrintLogFile(char*, ...) PRINTF_FORMAT(1);
/***
*** maintenance.c
@@ -1049,7 +1063,7 @@ void* malloc_ext(int,char*,int);
void* realloc_ext(void*, int, char*, int);
void* try_malloc_ext(int,char*,int);
char* strdup_ext(const char*,char*,int);
char* strdup_printf_ext(char*, char*, int, ...);
char* strdup_printf_ext(char*, char*, int, ...) PRINTF_FORMAT2(2,4);
char* strdup_vprintf_ext(char*, va_list, char*, int);
gchar* g_locale_to_utf8_ext(const gchar*, gssize, gsize*, gsize*, GError**, char*, int);
void free_ext(void*,char*,int);
@@ -1134,22 +1148,22 @@ void gint64_to_uchar(unsigned char*, gint64);
void CalcSectors(guint64, guint64*, int*);
void PrintCLI(char*, ...);
void PrintLog(char*, ...);
void PrintLogWithAsterisks(char*, ...);
void Verbose(char*, ...);
void PrintTimeToLog(GTimer*, char*, ...);
void PrintProgress(char*, ...);
void PrintCLI(char*, ...) PRINTF_FORMAT(1);
void PrintLog(char*, ...) PRINTF_FORMAT(1);
void PrintLogWithAsterisks(char*, ...) PRINTF_FORMAT(1);
void Verbose(char*, ...) PRINTF_FORMAT(1);
void PrintTimeToLog(GTimer*, char*, ...) PRINTF_FORMAT(2);
void PrintProgress(char*, ...) PRINTF_FORMAT(1);
void ClearProgress(void);
#ifndef CLI
void PrintCLIorLabel(GtkLabel*, char*, ...);
void PrintCLIorLabel(GtkLabel*, char*, ...) PRINTF_FORMAT(2);
#else
void PrintCLIorLabel(void*, char*, ...);
void PrintCLIorLabel(void*, char*, ...) PRINTF_FORMAT(2);
#endif
int GetLongestTranslation(char*, ...);
void LogWarning(char*, ...);
void Stop(char*, ...);
void LogWarning(char*, ...) PRINTF_FORMAT(1);
void Stop(char*, ...) PRINTF_FORMAT(1);
void RegisterCleanup(char*, void (*)(gpointer), gpointer);
void UnregisterCleanup(void);
@@ -1160,27 +1174,27 @@ void ShowWidget(GtkWidget*);
void AllowActions(gboolean);
void ShowMessage(GtkWindow*, char*, GtkMessageType);
GtkWidget* CreateMessage(char*, GtkMessageType, ...);
void SetLabelText(GtkLabel*, char*, ...);
GtkWidget* CreateMessage(char*, GtkMessageType, ...) PRINTF_FORMAT2(1,3);
void SetLabelText(GtkLabel*, char*, ...) PRINTF_FORMAT(2);
void SetProgress(GtkWidget*, int, int);
int ModalDialog(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...);
int ModalWarning(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...);
int ModalDialog(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...) PRINTF_FORMAT(4);
int ModalWarning(GtkMessageType, GtkButtonsType, void (*)(GtkDialog*), char*, ...) PRINTF_FORMAT(4);
#define ModalWarningOrCLI(a,b,c,d,...) ModalWarning(a,b,c,d,__VA_ARGS__)
#else
int ModalWarning(char*, ...);
int ModalWarning(char*, ...) PRINTF_FORMAT(1);
#define ModalWarningOrCLI(a,b,c,d,...) ModalWarning(d,__VA_ARGS__)
#endif
#ifndef CLI
void SetText(PangoLayout*, char*, int*, int*);
void SwitchAndSetFootline(GtkWidget*, int, GtkWidget*, char*, ...);
void SwitchAndSetFootline(GtkWidget*, int, GtkWidget*, char*, ...) PRINTF_FORMAT(4);
void ReverseCancelOK(GtkDialog*);
void TimedInsensitive(GtkWidget*, int);
int GetLabelWidth(GtkLabel*, char*, ...);
void LockLabelSize(GtkLabel*, char*, ...);
int GetLabelWidth(GtkLabel*, char*, ...) PRINTF_FORMAT(2);
void LockLabelSize(GtkLabel*, char*, ...) PRINTF_FORMAT(2);
#endif
int ConfirmImageDeletion(char *);

View File

@@ -84,7 +84,7 @@ void PrintEccHeader(EccHeader *eh)
print_hex("mediumSum ", eh->mediumSum, 16);
print_hex("eccSum ", eh->eccSum, 16);
print_hex("sectors ", eh->sectors, 8);
PrintCLI("sectors (native) %lld\n", uchar_to_gint64(eh->sectors));
PrintCLI("sectors (native) %" PRId64 "\n", uchar_to_gint64(eh->sectors));
PrintCLI("dataBytes %8x\n", eh->dataBytes);
PrintCLI("eccBytes %8x\n", eh->eccBytes);
PrintCLI("creatorVersion %8x\n", eh->creatorVersion);
@@ -93,8 +93,8 @@ void PrintEccHeader(EccHeader *eh)
PrintCLI("selfCRC %8x\n", eh->selfCRC);
print_hex("crcSum ", eh->crcSum, 16);
PrintCLI("inLast %8x\n", eh->inLast);
PrintCLI("sectorsPerLayer %lld\n", eh->sectorsPerLayer);
PrintCLI("sectorsAddedByEcc %lld\n", eh->sectorsAddedByEcc);
PrintCLI("sectorsPerLayer %" PRId64 "\n", eh->sectorsPerLayer);
PrintCLI("sectorsAddedByEcc %" PRId64 "\n", eh->sectorsAddedByEcc);
PrintCLI("\n");
}
@@ -118,7 +118,7 @@ void print_crc_block(CrcBlock *cb)
PrintCLI("inLast %8x\n", cb->inLast);
PrintCLI("dataBytes %8x\n", cb->dataBytes);
PrintCLI("eccBytes %8x\n", cb->eccBytes);
PrintCLI("sectorsPerLayer %lld\n", cb->sectorsPerLayer);
PrintCLI("sectorsPerLayer %" PRId64 "\n", cb->sectorsPerLayer);
PrintCLI("selfCRC %8x\n", cb->selfCRC);
PrintCLI("\n");

View File

@@ -266,12 +266,12 @@ int GetImageFingerprint(Image *image, guint8 *fp_out, guint64 sector)
case 1: /* unreadable */
if(fp_out)
memset(fp_out, 0, 16);
Verbose("GetImageFingerprint(%lld): cached unreadable\n", sector);
Verbose("GetImageFingerprint(%" PRId64 "): cached unreadable\n", sector);
return FALSE;
case 2: /* already cached */
if(fp_out)
memcpy(fp_out, image->imageFP, 16);
Verbose("GetImageFingerprint(%lld): cached\n", sector);
Verbose("GetImageFingerprint(%" PRId64 "): cached\n", sector);
return TRUE;
}
@@ -281,7 +281,7 @@ int GetImageFingerprint(Image *image, guint8 *fp_out, guint64 sector)
image->fpSector = sector;
if(status != 1) /* read error */
{ image->fpState = 1;
Verbose("GetImageFingerprint(%lld): not readable\n", sector);
Verbose("GetImageFingerprint(%" PRId64 "): not readable\n", sector);
}
else
{ struct MD5Context md5ctxt;
@@ -293,7 +293,7 @@ int GetImageFingerprint(Image *image, guint8 *fp_out, guint64 sector)
MD5Final(image->imageFP, &md5ctxt);
if(fp_out)
memcpy(fp_out, image->imageFP, 16);
Verbose("GetImageFingerprint(%lld): read & cached\n", sector);
Verbose("GetImageFingerprint(%" PRId64 "): read & cached\n", sector);
}
FreeAlignedBuffer(ab);

View File

@@ -189,7 +189,7 @@ mi->usedCapacity1,
#else
NULL,
#endif
_("%lld sectors (%lld MiB), from READ CAPACITY\n"),
_("%" PRId64 " sectors (%" PRId64 " MiB), from READ CAPACITY\n"),
dh->readCapacity+1, (dh->readCapacity+1)>>9);
print_tab(" ",tab_width);
PrintCLIorLabel(
@@ -198,7 +198,7 @@ mi->usedCapacity2,
#else
NULL,
#endif
_("%lld sectors (%lld MiB), from DVD structure\n"),
_("%" PRId64 " sectors (%" PRId64 " MiB), from DVD structure\n"),
dh->userAreaSize, dh->userAreaSize>>9);
print_tab("Blank capacity:",tab_width);
@@ -208,7 +208,7 @@ mi->blankCapacity,
#else
NULL,
#endif
_("%lld sectors (%lld MiB)\n"),
_("%" PRId64 " sectors (%" PRId64 " MiB)\n"),
dh->blankCapacity, (dh->blankCapacity)>>9);
/* Filesystem properties */
@@ -238,7 +238,7 @@ mi->isoSize,
#else
NULL,
#endif
_("%d sectors (%lld MiB)\n"),
_("%d sectors (%" PRId64 " MiB)\n"),
image->isoInfo->volumeSize, (gint64)image->isoInfo->volumeSize>>9);
print_tab("Creation time:",tab_width);
PrintCLIorLabel(
@@ -280,9 +280,9 @@ NULL,
((double)eh->eccBytes*100.0)/(double)eh->dataBytes);
print_tab("Augmented image size:",tab_width);
#ifndef CLI
PrintCLIorLabel(mi->eccSize, _("%lld sectors (%lld MiB)\n"),
PrintCLIorLabel(mi->eccSize, _("%" PRIu64 " sectors (%" PRId64 " MiB)\n"),
#else
PrintCLIorLabel(NULL, _("%lld sectors (%lld MiB)\n"),
PrintCLIorLabel(NULL, _("%" PRId64 " sectors (%" PRId64 " MiB)\n"),
#endif
image->expectedSectors, image->expectedSectors>>9);

View File

@@ -325,7 +325,7 @@ static void file_select_cb(GtkWidget *widget, gpointer data)
calculate_failures(rec);
evaluate_vectors(rec);
render_sector(rec);
SetLabelText(GTK_LABEL(rec->rightLabel), _("%s loaded, LBA %lld, %d samples."),
SetLabelText(GTK_LABEL(rec->rightLabel), _("%s loaded, LBA %" PRId64 ", %d samples."),
rec->filepath, rec->rb->lba, rec->rb->samplesRead);
break;
@@ -387,14 +387,14 @@ static void save_sector(raw_editor_context *rec)
if(!LargeSeek(image, (gint64)(2048*rb->lba)))
{ LargeClose(image);
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
rb->lba, "raw-editor", strerror(errno));
}
n = LargeWrite(image, rb->recovered+rb->dataOffset, 2048);
if(n != 2048)
{ LargeClose(image);
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
rb->lba, "raw-editor", strerror(errno));
}

View File

@@ -277,7 +277,7 @@ int SaveDefectiveSector(RawBuffer *rb, int can_c2_scan)
#else
NULL,
#endif
_(" [Appended %d/%d sectors to cache file %s; LBA=%lld, ssize=%d, %d sectors]\n"),
_(" [Appended %d/%d sectors to cache file %s; LBA=%" PRId64 ", ssize=%d, %d sectors]\n"),
count, rb->samplesRead, filename, dsh->lba, dsh->sectorSize, dsh->nSectors);
g_free(filename);

View File

@@ -507,12 +507,12 @@ static void print_progress(read_closure *rc, int immediate)
if(rc->ei)
n = g_snprintf(rc->progressMsg, 256,
_("Repairable: %2d.%1d%% (correctable: %lld; now reading [%lld..%lld], size %lld)"),
_("Repairable: %2d.%1d%% (correctable: %" PRId64 "; now reading [%" PRId64 "..%" PRId64 "], size %" PRId64 ")"),
percent/10, percent%10, rc->correctable,
rc->intervalStart, rc->intervalStart+rc->intervalSize-1, rc->intervalSize);
else
n = g_snprintf(rc->progressMsg, 256,
_("Repairable: %2d.%1d%% (missing: %lld; now reading [%lld..%lld], size %lld)"),
_("Repairable: %2d.%1d%% (missing: %" PRId64 "; now reading [%" PRId64 "..%" PRId64 "], size %" PRId64 ")"),
percent/10, percent%10, rc->expectedSectors-rc->readable,
rc->intervalStart, rc->intervalStart+rc->intervalSize-1, rc->intervalSize);
@@ -686,10 +686,10 @@ static void open_and_determine_mode(read_closure *rc)
sinv = RS02SectorIndex(rc->lay, slice, idx);
if(slice == -1)
Verbose("Header %lld found at sector %lld\n", idx, s);
Verbose("Header %" PRId64 " found at sector %" PRId64 "\n", idx, s);
else
if(s != sinv) Verbose("Failed for sector %lld / %lld:\n"
"slice %lld, idx %lld\n",
if(s != sinv) Verbose("Failed for sector %" PRId64 " / %" PRId64 ":\n"
"slice %" PRId64 ", idx %" PRId64 "\n",
s, sinv, slice, idx);
}
Verbose("RS02SliceIndex() verification finished.\n");
@@ -761,9 +761,9 @@ static void check_size(read_closure *rc)
int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Medium contains %lld sectors more as recorded in the .ecc file\n"
"(Medium: %lld sectors; expected from .ecc file: %lld sectors).\n"
"Only the first %lld medium sectors will be processed.\n"),
_("Medium contains %" PRId64 " sectors more as recorded in the .ecc file\n"
"(Medium: %" PRId64 " sectors; expected from .ecc file: %" PRId64 " sectors).\n"
"Only the first %" PRId64 " medium sectors will be processed.\n"),
rc->dh->sectors-rc->sectors, rc->dh->sectors, rc->sectors,
rc->sectors);
@@ -782,10 +782,9 @@ static void check_size(read_closure *rc)
int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Medium contains %lld sectors less as recorded in the .ecc file\n"
"(Medium: %lld sectors; expected from .ecc file: %lld sectors).\n"),
rc->sectors-rc->dh->sectors, rc->dh->sectors, rc->sectors,
rc->sectors);
_("Medium contains %" PRId64 " sectors less as recorded in the .ecc file\n"
"(Medium: %" PRId64 " sectors; expected from .ecc file: %" PRId64 " sectors).\n"),
rc->sectors - rc->dh->sectors, rc->dh->sectors, rc->sectors);
if(!answer)
{
@@ -828,9 +827,9 @@ void GetReadingRange(gint64 sectors, gint64 *firstSector, gint64 *lastSector)
#endif
if(first > last || first < 0 || last >= sectors)
Stop(_("Sectors must be in range [0..%lld].\n"), sectors-1);
Stop(_("Sectors must be in range [0..%" PRId64 "].\n"), sectors-1);
PrintLog(_("Limiting sector range to [%lld,%lld].\n"), first, last);
PrintLog(_("Limiting sector range to [%" PRId64 ",%" PRId64 "].\n"), first, last);
}
else
{ first = 0;
@@ -950,8 +949,8 @@ void check_image_size(read_closure *rc, gint64 image_file_sectors)
int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than inserted medium\n"
"(Image file: %lld sectors; medium: %lld sectors).\n"),
_("Image file is %" PRId64 " sectors longer than inserted medium\n"
"(Image file: %" PRId64 " sectors; medium: %" PRId64 " sectors).\n"),
image_file_sectors-rc->expectedSectors,
image_file_sectors, rc->expectedSectors);
@@ -1234,9 +1233,9 @@ static void build_interval_from_image(read_closure *rc)
/*** Tell user results of image file analysis */
if(rc->readMode == ECC_IN_FILE || rc->readMode == ECC_IN_IMAGE)
PrintLog(_("Analysing existing image file: %lld readable, %lld correctable, %lld still missing.\n"),
PrintLog(_("Analysing existing image file: %" PRId64 " readable, %" PRId64 " correctable, %" PRId64 " still missing.\n"),
rc->readable, rc->correctable, rc->expectedSectors-rc->readable-rc->correctable);
else PrintLog(_("Analysing existing image file: %lld readable, %lld still missing.\n"),
else PrintLog(_("Analysing existing image file: %" PRId64 " readable, %" PRId64 " still missing.\n"),
rc->readable, rc->expectedSectors-rc->readable-rc->correctable);
#ifndef CLI
@@ -1331,7 +1330,7 @@ void fill_gap(read_closure *rc)
/*** Tell user what's going on */
t = g_strdup_printf(_("Filling image area [%lld..%lld]"),
t = g_strdup_printf(_("Filling image area [%" PRId64 "..%" PRId64 "]"),
firstUnwritten, rc->intervalStart-1);
clear_progress(rc);
#ifndef CLI
@@ -1346,7 +1345,7 @@ void fill_gap(read_closure *rc)
/*** Seek to end of image */
if(!LargeSeek(rc->image, (gint64)(2048*firstUnwritten)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
firstUnwritten, "fill", strerror(errno));
/*** Fill image with dead sector markers until rc->intervalStart */
@@ -1360,7 +1359,7 @@ void fill_gap(read_closure *rc)
CreateMissingSector(buf, i, rc->fingerprint, FINGERPRINT_SECTOR, rc->volumeLabel);
n = LargeWrite(rc->image, buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
i, "fill", strerror(errno));
/* Check whether user hit the Stop button */
@@ -1426,13 +1425,13 @@ void fill_correctable_gap(read_closure *rc, gint64 correctable)
unsigned char buf[2048];
if(!LargeSeek(rc->image, (gint64)(2048*ds)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
ds, "skip-corr", strerror(errno));
for(ds=rc->highestWrittenSector+1; ds<=correctable; ds++)
{ CreateMissingSector(buf, ds, rc->fingerprint, FINGERPRINT_SECTOR, rc->volumeLabel);
if(LargeWrite(rc->image, buf, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
ds, "skip-corr", strerror(errno));
}
rc->highestWrittenSector = correctable;
@@ -1646,7 +1645,7 @@ reopen_image:
for(;;)
{ int cluster_mask = rc->dh->clusterSize-1;
Verbose("... Processing Interval [%lld..%lld], size %d\n",
Verbose("... Processing Interval [%" PRId64 "..%" PRId64 "], size %" PRId64 "\n",
rc->intervalStart, rc->intervalStart+rc->intervalSize-1, rc->intervalSize);
/* If we jumped beyond the highest writtensector,
@@ -1729,13 +1728,13 @@ reread:
if(!Closure->guiMode)
#endif
Stop(_("Sector %lld: %s\nCan not recover from above error.\n"
Stop(_("Sector %" PRId64 ": %s\nCan not recover from above error.\n"
"Use the --ignore-fatal-sense option to override."),
s, GetLastSenseString(FALSE));
#ifndef CLI
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, insert_buttons,
_("Sector %lld: %s\n\n"
_("Sector %" PRId64 ": %s\n\n"
"It may not be possible to recover from this error.\n"
"Should the reading continue and ignore this error?"),
s, GetLastSenseString(FALSE));
@@ -1768,7 +1767,7 @@ reread:
{ gint64 b;
if(!LargeSeek(rc->image, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
s,"store",strerror(errno));
/* Store sector(s) in the image file if they pass the CRC test,
@@ -1791,7 +1790,7 @@ reread:
{ //unsigned char buf[2048];
PrintCLI("\n");
PrintCLI(_("CRC error in sector %lld\n"),b);
PrintCLI(_("CRC error in sector %" PRId64 "\n"),b);
print_progress(rc, TRUE);
#if 0 // remark: Do we still need to mark CRC defects as completely missing?
@@ -1800,7 +1799,7 @@ reread:
#endif
n = LargeWrite(rc->image, rc->buf+i*2048, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
b, "unv", strerror(errno));
#ifndef CLI
@@ -1815,7 +1814,7 @@ reread:
case CRC_GOOD:
n = LargeWrite(rc->image, rc->buf+i*2048, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
b, "store", strerror(errno));
if(rc->map)
@@ -1970,7 +1969,7 @@ Closure->status,
#else
NULL,
#endif
_("Sectors %lld-%lld: %s\n"),
_("Sectors %" PRId64 "-%" PRId64 ": %s\n"),
s, s+nsectors-1, GetLastSenseString(FALSE));
else PrintCLIorLabel(
#ifndef CLI
@@ -1978,7 +1977,7 @@ Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s\n"),
_("Sector %" PRId64 ": %s\n"),
s, GetLastSenseString(FALSE));
rc->unreadable += nsectors;
@@ -1986,7 +1985,7 @@ NULL,
/* Write nsectors of "dead sector" markers */
if(!LargeSeek(rc->image, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
s, "nds", strerror(errno));
for(i=0; i<nsectors; i++)
@@ -1994,7 +1993,7 @@ NULL,
n = LargeWrite(rc->image, buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
s, "nds", strerror(errno));
#ifndef CLI
@@ -2009,13 +2008,13 @@ NULL,
Store the remainder of the current interval in the queue. */
if(s+nsectors-1 >= rc->intervalEnd) /* This was the last sector; interval used up */
{ Verbose("... Interval [%lld..%lld] used up\n", rc->intervalStart, rc->intervalEnd);
{ Verbose("... Interval [%" PRId64 "..%" PRId64 "] used up\n", rc->intervalStart, rc->intervalEnd);
}
else /* Insert remainder of interval into queue */
{ rc->intervalStart = s+nsectors;
rc->intervalSize = rc->intervalEnd-rc->intervalStart+1;
Verbose("... Interval %lld [%lld..%lld] added\n",
Verbose("... Interval %" PRId64 " [%" PRId64 "..%" PRId64 "] added\n",
rc->intervalSize, rc->intervalStart, rc->intervalStart+rc->intervalSize-1);
add_interval(rc, rc->intervalStart, rc->intervalSize);
@@ -2051,7 +2050,7 @@ NULL,
/* Split the new interval */
if(rc->intervalSize>1)
{ Verbose("*** Splitting [%lld..%lld]\n",
{ Verbose("*** Splitting [%" PRId64 "..%" PRId64 "]\n",
rc->intervalStart,rc->intervalStart+rc->intervalSize-1);
add_interval(rc, rc->intervalStart, rc->intervalSize/2);
@@ -2061,7 +2060,7 @@ NULL,
else /* 1 sector intervals can't be split further */
{
rc->intervalEnd = rc->intervalStart;
Verbose("*** Popped [%lld]\n",rc->intervalStart);
Verbose("*** Popped [%" PRId64 "]\n",rc->intervalStart);
}
//print_intervals(rc);
@@ -2113,7 +2112,7 @@ finished:
percent/10, percent%10);
PrintLog(_("\n%s\n"
"(%lld readable, %lld correctable, %lld still missing).\n"),
"(%" PRId64 " readable, %" PRId64 " correctable, %" PRId64 " still missing).\n"),
t, rc->readable, rc->correctable, rc->expectedSectors-total);
#ifndef CLI
if(Closure->guiMode)
@@ -2143,7 +2142,7 @@ finished:
Closure->sectorSkip);
PrintLog(_("\n%s\n"
"%2d.%1d%% of the image have been read (%lld sectors).\n"),
"%2d.%1d%% of the image have been read (%" PRId64 " sectors).\n"),
t, percent/10, percent%10, rc->readable);
#ifndef CLI

View File

@@ -101,7 +101,7 @@ static gboolean curve_idle_func(gpointer data)
gtk_label_set_text(GTK_LABEL(Closure->readLinearSpeed), utf);
g_free(utf);
g_snprintf(buf, 80, _("Unreadable / skipped sectors: %lld"), Closure->readErrors);
g_snprintf(buf, 80, _("Unreadable / skipped sectors: %" PRId64 ""), Closure->readErrors);
utf = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
gtk_label_set_text(GTK_LABEL(Closure->readLinearErrors), utf);

View File

@@ -123,7 +123,7 @@ static void cleanup(gpointer data)
if(Closure->guiMode)
{ if(rc->unreportedError)
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by unrecoverable error.</span> %lld sectors read, %lld sectors unreadable/skipped so far."),
_("<span %s>Aborted by unrecoverable error.</span> %" PRId64 " sectors read, %" PRId64 " sectors unreadable/skipped so far."),
Closure->redMarkup, rc->readOK, Closure->readErrors);
}
#endif
@@ -385,7 +385,7 @@ reopen_image:
if(!Closure->readStart && !Closure->readEnd
&& rc->readMarker < rc->image->dh->sectors-1 && Closure->readingPasses <= 1)
{ PrintLog(_("Completing image %s. Continuing with sector %lld.\n"),
{ PrintLog(_("Completing image %s. Continuing with sector %" PRId64 ".\n"),
Closure->imageName, rc->readMarker);
rc->firstSector = rc->readMarker;
#ifndef CLI
@@ -423,7 +423,7 @@ static void fill_gap(read_closure *rc)
s = rc->readMarker;
if(!LargeSeek(rc->writerImage, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
s, "fill", strerror(errno));
while(s < rc->firstSector)
@@ -432,7 +432,7 @@ static void fill_gap(read_closure *rc)
CreateMissingSector(buf, s, rc->image->imageFP, FINGERPRINT_SECTOR, rc->volumeLabel);
n = LargeWrite(rc->writerImage, buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
s, "fill", strerror(errno));
s++;
}
@@ -545,7 +545,7 @@ static void show_progress(read_closure *rc)
#ifndef CLI
if(Closure->guiMode && rc->lastErrorsPrinted != Closure->readErrors)
{ SetLabelText(GTK_LABEL(Closure->readLinearErrors),
_("Unreadable / skipped sectors: %lld"), Closure->readErrors);
_("Unreadable / skipped sectors: %" PRId64 ""), Closure->readErrors);
rc->lastErrorsPrinted = Closure->readErrors;
}
#endif
@@ -636,10 +636,10 @@ static void show_progress(read_closure *rc)
if(sp >= Closure->speedWarning)
{ if(delta > 0.0)
PrintCLI(_("Sector %lld: Speed increased to %4.1fx\n"),
PrintCLI(_("Sector %" PRId64 ": Speed increased to %4.1fx\n"),
rc->readPos, fabs(rc->speed));
else
PrintCLI(_("Sector %lld: Speed dropped to %4.1fx\n"),
PrintCLI(_("Sector %" PRId64 ": Speed dropped to %4.1fx\n"),
rc->readPos, fabs(rc->speed));
}
}
@@ -700,14 +700,14 @@ static gpointer worker_thread(read_closure *rc)
{ int n;
if(!LargeSeek(rc->writerImage, (gint64)(2048*s)))
{ rc->workerError = g_strdup_printf(_("Failed seeking to sector %lld in image [%s]: %s"),
{ rc->workerError = g_strdup_printf(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
s, "store", strerror(errno));
goto update_mutex;
}
n = LargeWrite(rc->writerImage, rc->alignedBuf[rc->writePtr]->buf, 2048*nsectors);
if(n != 2048*nsectors)
{ rc->workerError = g_strdup_printf(_("Failed writing to sector %lld in image [%s]: %s"),
{ rc->workerError = g_strdup_printf(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
s, "store", strerror(errno));
goto update_mutex;
}
@@ -994,7 +994,7 @@ next_reading_pass:
{
if(Closure->stopActions == STOP_CURRENT_ACTION) /* suppress memleak warning when closing window */
{ SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by user request!</span> %lld sectors read, %lld sectors unreadable/skipped so far."),
_("<span %s>Aborted by user request!</span> %" PRId64 " sectors read, %" PRId64 " sectors unreadable/skipped so far."),
Closure->redMarkup, rc->readOK,Closure->readErrors);
}
rc->unreportedError = FALSE; /* suppress respective error message */
@@ -1040,7 +1040,7 @@ reread:
else
{ if(!LargeSeek(rc->readerImage, (gint64)(2048*rc->readPos)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
rc->readPos, "reread", strerror(errno));
if(rc->readPos+nsectors > rc->readMarker)
@@ -1052,7 +1052,7 @@ reread:
n = LargeRead(rc->readerImage, sector_buf, 2048);
if(n != 2048)
Stop(_("unexpected read error in image for sector %lld"),rc->readPos);
Stop(_("unexpected read error in image for sector %" PRId64 ""),rc->readPos);
err = CheckForMissingSector(sector_buf, rc->readPos+i,
rc->image->fpState == 2 ? rc->image->imageFP : NULL,
rc->image->fpSector);
@@ -1107,13 +1107,13 @@ reread:
if(!Closure->guiMode)
#endif
Stop(_("Sector %lld: %s\nCan not recover from above error.\n"
Stop(_("Sector %" PRId64 ": %s\nCan not recover from above error.\n"
"Use the --ignore-fatal-sense option to override."),
rc->readPos, GetLastSenseString(FALSE));
#ifndef CLI
answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, insert_buttons,
_("Sector %lld: %s\n\n"
_("Sector %" PRId64 ": %s\n\n"
"It may not be possible to recover from this error.\n"
"Should the reading continue and ignore this error?"),
rc->readPos, GetLastSenseString(FALSE));
@@ -1124,7 +1124,7 @@ reread:
if(!answer)
{
SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by user request!</span> %lld sectors read, %lld sectors unreadable/skipped so far."),
_("<span %s>Aborted by user request!</span> %" PRId64 " sectors read, %" PRId64 " sectors unreadable/skipped so far."),
Closure->redMarkup, rc->readOK,Closure->readErrors);
rc->unreportedError = FALSE; /* suppress respective error message */
goto terminate;
@@ -1140,7 +1140,7 @@ reread:
for(i=0; i<nsectors; i++)
{ if(rc->image->dh->c2[i])
{ if(!status) /* Do not print C2 and error messages together */
PrintCLI(_("Sector %lld: %3d C2 errors.%s\n"),
PrintCLI(_("Sector %" PRId64 ": %3d C2 errors.%s\n"),
rc->readPos+i, rc->image->dh->c2[i], " ");
if(rc->image->dh->c2[i] > rc->maxC2) /* remember highest value */
@@ -1277,7 +1277,7 @@ Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s Skipping %d sectors.\n"),
_("Sector %" PRId64 ": %s Skipping %d sectors.\n"),
rc->readPos, GetLastSenseString(FALSE), nfill-1);
for(i=0; i<nfill; i++) /* workaround: large values for nfill */
{ Closure->readErrors++; /* would exceed sampling of green/red */
@@ -1310,7 +1310,7 @@ Closure->status,
#else
NULL,
#endif
_("Sector %lld: %s\n"),
_("Sector %" PRId64 ": %s\n"),
rc->readPos, GetLastSenseString(FALSE));
if(rc->readPos >= rc->image->dh->sectors - 2) tao_tail++;
Closure->readErrors++;
@@ -1389,8 +1389,8 @@ step_counter:
/* We were re-reading an incomplete image */
if(rc->rereading)
{ if(!Closure->readErrors) t = g_strdup_printf(_("%lld sectors read. "),rc->readOK);
else t = g_strdup_printf(_("%lld sectors read; %lld unreadable sectors."),rc->readOK,Closure->readErrors);
{ if(!Closure->readErrors) t = g_strdup_printf(_("%" PRId64 " sectors read. "),rc->readOK);
else t = g_strdup_printf(_("%" PRId64 " sectors read; %" PRId64 " unreadable sectors."),rc->readOK,Closure->readErrors);
}
/* We were reading the image for the first time */
@@ -1402,7 +1402,7 @@ step_counter:
{
if(rc->image->eccFile) /* ...maybe wrong image size? */
{ if(rc->image->dh->sectors != rc->image->expectedSectors)
t = g_strdup_printf(_("All sectors successfully read, but wrong image length (%lld sectors difference)"), rc->image->dh->sectors - rc->image->expectedSectors);
t = g_strdup_printf(_("All sectors successfully read, but wrong image length (%" PRId64 " sectors difference)"), rc->image->dh->sectors - rc->image->expectedSectors);
}
/* ...or bad ecc md5 sum (theoretically impossible by now)? */
if( rc->readOK == rc->image->dh->sectors /* no user limited range */
@@ -1422,14 +1422,14 @@ step_counter:
}
else /* we have unreadable or damaged sectors */
{ if(Closure->readErrors && !Closure->crcErrors)
t = g_strdup_printf(_("%lld unreadable sectors."),Closure->readErrors);
t = g_strdup_printf(_("%" PRId64 " unreadable sectors."),Closure->readErrors);
else if(!Closure->readErrors && Closure->crcErrors)
{ if(md5_failure & CRC_MD5_BAD)
t = g_strdup_printf(_("%lld CRC errors and a md5sum mismatch in the CRC section."),Closure->crcErrors);
t = g_strdup_printf(_("%" PRId64 " CRC errors and a md5sum mismatch in the CRC section."),Closure->crcErrors);
else
t = g_strdup_printf(_("%lld CRC errors."),Closure->crcErrors);
t = g_strdup_printf(_("%" PRId64 " CRC errors."),Closure->crcErrors);
}
else t = g_strdup_printf(_("%lld CRC errors, %lld unreadable sectors."),
else t = g_strdup_printf(_("%" PRId64 " CRC errors, %" PRId64 " unreadable sectors."),
Closure->crcErrors, Closure->readErrors);
}
}

View File

@@ -62,7 +62,7 @@ void DumpSector(RawBuffer *rb, char *path)
fclose(file);
PrintCLI(_("Sector %lld dumped to %s\n"), rb->lba, filename);
PrintCLI(_("Sector %" PRId64 " dumped to %s\n"), rb->lba, filename);
g_free(filename);
}
@@ -477,7 +477,7 @@ static int simple_lec(RawBuffer *rb, unsigned char *frame, char *msg)
if(q_failures || p_failures || q_corrected || p_corrected)
{
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld L-EC P/Q results: %d/%d failures, %d/%d corrected (%s).\n",
"Sector %" PRId64 " L-EC P/Q results: %d/%d failures, %d/%d corrected (%s).\n",
rb->lba, p_failures, q_failures, p_corrected, q_corrected, msg);
return 1;
}
@@ -559,7 +559,7 @@ int ValidateRawSector(RawBuffer *rb, unsigned char *frame, char *msg)
if(lec_did_sth)
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by L-EC.\n",
"Sector %" PRId64 ": Recovered in raw reader by L-EC.\n",
rb->lba);
return TRUE;
@@ -892,7 +892,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Good. Data section passes EDC test.\n",
"Sector %" PRId64 ": Good. Data section passes EDC test.\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -908,7 +908,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader after correcting sync pattern.\n",
"Sector %" PRId64 ": Recovered in raw reader after correcting sync pattern.\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -925,7 +925,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{
PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by iterative L-EC.\n",
"Sector %" PRId64 ": Recovered in raw reader by iterative L-EC.\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
@@ -960,7 +960,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by plausible sector search (0).\n",
"Sector %" PRId64 ": Recovered in raw reader by plausible sector search (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -971,7 +971,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by brute force plausible sector search (0).\n",
"Sector %" PRId64 ": Recovered in raw reader by brute force plausible sector search (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -982,7 +982,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by mutual ack heuristic (0).\n",
"Sector %" PRId64 ": Recovered in raw reader by mutual ack heuristic (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -993,7 +993,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by heuristic L-EC (0).\n",
"Sector %" PRId64 ": Recovered in raw reader by heuristic L-EC (0).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -1004,7 +1004,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by plausible sector search (1).\n",
"Sector %" PRId64 ": Recovered in raw reader by plausible sector search (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -1015,7 +1015,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by brute force plausible sector search (1).\n",
"Sector %" PRId64 ": Recovered in raw reader by brute force plausible sector search (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -1026,7 +1026,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by mutual ack heuristic (1).\n",
"Sector %" PRId64 ": Recovered in raw reader by mutual ack heuristic (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;
@@ -1037,7 +1037,7 @@ int TryCDFrameRecovery(RawBuffer *rb, unsigned char *outbuf)
if(CheckEDC(rb->recovered, rb->xaMode)
&& CheckMSF(rb->recovered, rb->lba, STRICT_MSF_CHECK))
{ PrintCLIorLabel(STATUS_LABEL_OR_NULL,
"Sector %lld: Recovered in raw reader by heuristic L-EC (1).\n",
"Sector %" PRId64 ": Recovered in raw reader by heuristic L-EC (1).\n",
rb->lba);
memcpy(outbuf, rb->recovered+rb->dataOffset, 2048);
return 0;

View File

@@ -172,7 +172,7 @@ void RS01ReadSector(Image *image, unsigned char *buf, gint64 s)
{ int n,expected;
if(!LargeSeek(image->file, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
s, strerror(errno));
/* Prepare for short reads at the last image sector.
@@ -188,7 +188,7 @@ void RS01ReadSector(Image *image, unsigned char *buf, gint64 s)
n = LargeRead(image->file, buf, expected);
if(n != expected)
Stop(_("Failed reading sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"),s,strerror(errno));
}
}
@@ -305,8 +305,8 @@ void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, in
if(!current_missing || s==image->sectorSize-1)
{ if(first_missing>=0)
{ if(first_missing == last_missing)
PrintCLI(_("* missing sector : %lld\n"), first_missing);
else PrintCLI(_("* missing sectors : %lld - %lld\n"), first_missing, last_missing);
PrintCLI(_("* missing sector : %" PRId64 "\n"), first_missing);
else PrintCLI(_("* missing sectors : %" PRId64 " - %" PRId64 "\n"), first_missing, last_missing);
first_missing = -1;
}
}
@@ -353,7 +353,7 @@ void RS01ScanImage(Method *method, Image* image, struct MD5Context *ecc_ctxt, in
}
if(crc != crcbuf[crcidx++] && !current_missing)
{ PrintCLI(_("* CRC error, sector: %lld\n"), s);
{ PrintCLI(_("* CRC error, sector: %" PRId64 "\n"), s);
image->crcErrors++;
}
}

View File

@@ -73,7 +73,7 @@ static int calculate_redundancy(char *image_name)
fs = strtoll(Closure->redundancy, NULL, 10);
if(fs < ecc_file_size(sectors, 8) || fs > ecc_file_size(sectors, 100))
Stop(_("Ecc file size %lldm out of useful range [%lld .. %lld]"),
Stop(_("Ecc file size %" PRId64 "m out of useful range [%" PRId64 " .. %" PRId64 "]"),
fs, ecc_file_size(sectors, 8), ecc_file_size(sectors, 100));
for(nr=100; nr>8; nr--)
if(fs >= ecc_file_size(sectors, nr))
@@ -291,8 +291,8 @@ void RS01Create(void)
Stop(_("Image file %s: %s."),Closure->imageName, strerror(errno));
}
if(image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
if(!Closure->eccName || !strlen(Closure->eccName))
@@ -398,7 +398,7 @@ void RS01Create(void)
SetProgress(wl->encPBar1, 100, 100);
#endif
Stop(_("%lld sectors unread or missing due to errors.\n"), image->sectorsMissing);
Stop(_("%" PRId64 " sectors unread or missing due to errors.\n"), image->sectorsMissing);
}
}
}

View File

@@ -192,7 +192,7 @@ void RS01Fix(Image *image)
image->file->size += n;
image->inLast += n;
if(n != padding)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
image->sectorSize, "SC", strerror(errno));
}
@@ -206,9 +206,9 @@ void RS01Fix(Image *image)
if(diff>0 && diff<=2)
{
int answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
_("Image file is %" PRId64 " sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
"%" PRId64 " sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
@@ -252,7 +252,7 @@ void RS01Fix(Image *image)
if(!LargeTruncate(image->file, expected_image_size))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
#endif
@@ -274,7 +274,7 @@ void RS01Fix(Image *image)
if(!LargeTruncate(image->file, expected_image_size))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
}
@@ -448,7 +448,7 @@ void RS01Fix(Image *image)
else if(crc != fc->crcBuf[i][cache_sector])
{ erasure_map[i] = 3;
erasure_list[erasure_count++] = i;
PrintCLI(_("CRC error in sector %lld\n"),block_idx[i]);
PrintCLI(_("CRC error in sector %" PRId64 "\n"),block_idx[i]);
}
}
}
@@ -479,7 +479,7 @@ void RS01Fix(Image *image)
{ PrintCLI(_("* %3d unrepairable sectors: "), erasure_count);
for(i=0; i<erasure_count; i++)
PrintCLI("%lld ", block_idx[erasure_list[i]]);
PrintCLI("%" PRId64 " ", block_idx[erasure_list[i]]);
PrintCLI("\n");
}
@@ -498,14 +498,14 @@ void RS01Fix(Image *image)
continue; /* It's (already) dead, Jim ;-) */
if(!LargeSeek(image->file, (gint64)(2048*idx)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
idx, "FD", strerror(errno));
CreateMissingSector(buf, idx, eh->mediumFP, eh->fpSector, NULL);
n = LargeWrite(image->file, buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image [%s]: %s"),
Stop(_("Failed writing to sector %" PRId64 " in image [%s]: %s"),
idx, "WD", strerror(errno));
}
}
@@ -670,7 +670,7 @@ void RS01Fix(Image *image)
for(i=0; i<erasure_count; i++)
{ gint64 idx = block_idx[erasure_list[i]];
PrintLog("%lld ", idx);
PrintLog("%" PRId64 " ", idx);
}
PrintLog("\n");
break;
@@ -724,14 +724,14 @@ void RS01Fix(Image *image)
{ int old = fc->imgBlock[location][offset];
int new = old ^ gf_alpha_to[mod_fieldmax(gf_index_of[num1] + gf_index_of[num2] + GF_FIELDMAX - gf_index_of[den])];
PrintCLI(_("-> Error located in sector %lld at byte %4d (value %02x '%c', expected %02x '%c')\n"),
PrintCLI(_("-> Error located in sector %" PRId64 " at byte %4d (value %02x '%c', expected %02x '%c')\n"),
block_idx[location], bi,
old, canprint(old) ? old : '.',
new, canprint(new) ? new : '.');
}
if(!erasure_map[location])
PrintLog(_("Unexpected byte error in sector %lld, byte %d\n"),
PrintLog(_("Unexpected byte error in sector %" PRId64 ", byte %d\n"),
block_idx[location], bi);
fc->imgBlock[location][offset] ^= gf_alpha_to[mod_fieldmax(gf_index_of[num1] + gf_index_of[num2] + GF_FIELDMAX - gf_index_of[den])];
@@ -753,12 +753,12 @@ void RS01Fix(Image *image)
{ gint64 idx = block_idx[erasure_list[i]];
int length;
PrintCLI("%lld ", idx);
PrintCLI("%" PRId64 " ", idx);
/* Write the recovered sector */
if(!LargeSeek(image->file, (gint64)(2048*idx)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
idx, "FW", strerror(errno));
if(idx < image->expectedSectors-1) length = 2048;
@@ -766,7 +766,7 @@ void RS01Fix(Image *image)
n = LargeWrite(image->file, cache_offset+fc->imgBlock[erasure_list[i]], length);
if(n != length)
Stop(_("could not write medium sector %lld:\n%s"),idx,strerror(errno));
Stop(_("could not write medium sector %" PRId64 ":\n%s"),idx,strerror(errno));
}
PrintCLI("\n");
@@ -808,14 +808,14 @@ skip:
/*** Print results */
PrintProgress(_("Ecc progress: 100.0%%\n"));
if(corrected > 0) PrintLog(_("Repaired sectors: %lld \n"),corrected);
if(corrected > 0) PrintLog(_("Repaired sectors: %" PRId64 " \n"),corrected);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
{ PrintLog(_("Unrepaired sectors: %" PRId64 "\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
"(%" PRId64 " repaired; <span %s>%" PRId64 " unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
}

View File

@@ -92,11 +92,11 @@ void RS01AddVerifyValues(Method *method, int percent,
return;
if(newMissing)
SetLabelText(GTK_LABEL(wl->cmpMissingSectors), "<span %s>%lld</span>",
SetLabelText(GTK_LABEL(wl->cmpMissingSectors), "<span %s>%" PRId64 "</span>",
Closure->redMarkup, totalMissing);
if(newCrcErrors)
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors), "<span %s>%lld</span>",
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors), "<span %s>%" PRId64 "</span>",
Closure->redMarkup, totalCrcErrors);
sii->cmpSpiral = wl->cmpSpiral;
@@ -431,18 +431,18 @@ void RS01Verify(Image *image)
}
if(image->inLast == 2048)
{ PrintLog(_("present, contains %lld medium sectors.\n"), image->sectorSize);
{ PrintLog(_("present, contains %" PRId64 " medium sectors.\n"), image->sectorSize);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%lld", image->sectorSize);
SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%" PRId64 "", image->sectorSize);
#endif
}
else
{ PrintLog(_("present, contains %lld medium sectors and %d bytes.\n"),
{ PrintLog(_("present, contains %" PRId64 " medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%lld sectors + %d bytes"),
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%" PRId64 " sectors + %d bytes"),
image->sectorSize-1, image->inLast);
#endif
}
@@ -468,11 +468,11 @@ void RS01Verify(Image *image)
if(image->sectorSize < image->expectedSectors)
{ diff = image->expectedSectors - image->sectorSize;
PrintLog(_("* truncated image : %lld sectors too short\n"), diff);
PrintLog(_("* truncated image : %" PRId64 " sectors too short\n"), diff);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors),
_("<span %s>%lld (%lld sectors too short)</span>"),
_("<span %s>%" PRId64 " (%" PRId64 " sectors too short)</span>"),
Closure->redMarkup, image->sectorSize, diff);
#endif
image->sectorsMissing += diff;
@@ -488,19 +488,19 @@ void RS01Verify(Image *image)
if(Closure->guiMode)
{ if(image->crcErrors)
SetLabelText(GTK_LABEL(wl->cmpChkSumErrors),
"<span %s>%lld</span>", Closure->redMarkup, image->crcErrors);
"<span %s>%" PRId64 "</span>", Closure->redMarkup, image->crcErrors);
if(image->sectorsMissing)
SetLabelText(GTK_LABEL(wl->cmpMissingSectors),
"<span %s>%lld</span>", Closure->redMarkup, image->sectorsMissing);
"<span %s>%" PRId64 "</span>", Closure->redMarkup, image->sectorsMissing);
}
#endif
if(excess_sectors)
{ PrintLog(_("* image too long : %lld excess sectors\n"), excess_sectors);
{ PrintLog(_("* image too long : %" PRId64 " excess sectors\n"), excess_sectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors),
_("<span %s>%lld (%lld excess sectors)</span>"),
_("<span %s>%" PRId64 " (%" PRId64 " excess sectors)</span>"),
Closure->redMarkup, image->sectorSize, excess_sectors);
SetLabelText(GTK_LABEL(wl->cmpImageResult),
_("<span %s>Bad image.</span>"),
@@ -527,7 +527,7 @@ void RS01Verify(Image *image)
#endif
}
else
{ PrintLog(_("* suspicious image : all sectors present, but %lld CRC errors\n"
{ PrintLog(_("* suspicious image : all sectors present, but %" PRId64 " CRC errors\n"
"- image md5sum : %s\n"),image->crcErrors,idigest);
#ifndef CLI
@@ -540,8 +540,8 @@ void RS01Verify(Image *image)
}
else /* sectors are missing */
{ if(!image->crcErrors)
PrintLog(_("* BAD image : %lld sectors missing\n"), image->sectorsMissing);
else PrintLog(_("* BAD image : %lld sectors missing, %lld CRC errors\n"),
PrintLog(_("* BAD image : %" PRId64 " sectors missing\n"), image->sectorsMissing);
else PrintLog(_("* BAD image : %" PRId64 " sectors missing, %" PRId64 " CRC errors\n"),
image->sectorsMissing, image->crcErrors);
#ifndef CLI
if(Closure->guiMode)
@@ -711,19 +711,19 @@ process_ecc:
if(!image->file)
{ if(!ecc_in_last)
{ PrintLog(_("- medium sectors : %lld\n"), image->expectedSectors);
{ PrintLog(_("- medium sectors : %" PRId64 "\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld", image->expectedSectors);
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%" PRId64 "", image->expectedSectors);
#endif
}
else
{ PrintLog(_("- medium sectors : %lld sectors + %d bytes\n"),
{ PrintLog(_("- medium sectors : %" PRId64 " sectors + %d bytes\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("%lld sectors + %d bytes"),
_("%" PRId64 " sectors + %d bytes"),
image->expectedSectors-1, ecc_in_last);
#endif
}
@@ -734,19 +734,19 @@ process_ecc:
if(image->sectorSize == image->expectedSectors
&& (!ecc_in_last || image->inLast == eh->inLast))
{ if(!ecc_in_last)
{ PrintLog(_("- medium sectors : %lld (good)\n"), image->expectedSectors);
{ PrintLog(_("- medium sectors : %" PRId64 " (good)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld", image->expectedSectors);
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%" PRId64 "", image->expectedSectors);
#endif
}
else
{ PrintLog(_("- medium sectors : %lld sectors + %d bytes (good)\n"),
{ PrintLog(_("- medium sectors : %" PRId64 " sectors + %d bytes (good)\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("%lld sectors + %d bytes"),
_("%" PRId64 " sectors + %d bytes"),
image->expectedSectors-1, ecc_in_last);
#endif
}
@@ -755,23 +755,23 @@ process_ecc:
else /* sector sizes differ */
{ /* TAO case (1 or 2 sectors more than expected) */
if(image->sectorSize > image->expectedSectors && image->sectorSize - image->expectedSectors <= 2)
{ PrintLog(_("* medium sectors : %lld (BAD, perhaps TAO/DAO mismatch)\n"), image->expectedSectors);
{ PrintLog(_("* medium sectors : %" PRId64 " (BAD, perhaps TAO/DAO mismatch)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
{ if(!ecc_in_last)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld</span>",
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%" PRId64 "</span>",
Closure->redMarkup, image->expectedSectors);
else SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld sectors + %d bytes</span>",
else SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%" PRId64 " sectors + %d bytes</span>",
Closure->redMarkup, image->expectedSectors-1, ecc_in_last);
}
#endif
}
else /* more than 2 Sectors difference */
{ if(!ecc_in_last)
{ PrintLog(_("* medium sectors : %lld (BAD)\n"), image->expectedSectors);
{ PrintLog(_("* medium sectors : %" PRId64 " (BAD)\n"), image->expectedSectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%lld</span>",
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "<span %s>%" PRId64 "</span>",
Closure->redMarkup, image->expectedSectors);
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match error correction file.</span>"), Closure->redMarkup);
@@ -779,12 +779,12 @@ process_ecc:
#endif
}
else /* byte size difference */
{ PrintLog(_("* medium sectors : %lld sectors + %d bytes (BAD)\n"),
{ PrintLog(_("* medium sectors : %" PRId64 " sectors + %d bytes (BAD)\n"),
image->expectedSectors-1, ecc_in_last);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
_("<span %s>%lld sectors + %d bytes</span>"),
_("<span %s>%" PRId64 " sectors + %d bytes</span>"),
Closure->redMarkup, image->expectedSectors-1, ecc_in_last);
if(!ecc_advice)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match error correction file.</span>"), Closure->redMarkup);
@@ -866,17 +866,17 @@ process_ecc:
ecc_blocks = (image->eccFile->size-image->expectedSectors*sizeof(guint32)-sizeof(EccHeader))/eh->eccBytes;
if(ecc_expected == ecc_blocks)
{ PrintLog(_("- ecc blocks : %lld (good)\n"),ecc_blocks);
{ PrintLog(_("- ecc blocks : %" PRId64 " (good)\n"),ecc_blocks);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), "%lld", ecc_blocks);
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), "%" PRId64 "", ecc_blocks);
#endif
}
else
{ PrintLog(_("* ecc blocks : %lld (BAD, expected %lld)\n"),ecc_blocks,ecc_expected);
{ PrintLog(_("* ecc blocks : %" PRId64 " (BAD, expected %" PRId64 ")\n"),ecc_blocks,ecc_expected);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), _("<span %s>%lld (bad, expected %lld)</span>"),Closure->redMarkup,ecc_blocks,ecc_expected);
SetLabelText(GTK_LABEL(wl->cmpEccBlocks), _("<span %s>%" PRId64 " (bad, expected %" PRId64 ")</span>"),Closure->redMarkup,ecc_blocks,ecc_expected);
#endif
}

View File

@@ -200,8 +200,8 @@ void RS01SetFixMaxValues(RS01Widgets *wl, int data_bytes, int ecc_bytes, gint64
static gboolean results_idle_func(gpointer data)
{ RS01Widgets *wl = (RS01Widgets*)data;
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %lld"), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%lld</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %" PRId64 ""), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%" PRId64 "</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixProgress), _("Progress: %3d.%1d%%"), wl->percent/10, wl->percent%10);
return FALSE;

View File

@@ -236,12 +236,12 @@ void RS02ReadSector(Image *image, RS02Layout *lay, unsigned char *buf, gint64 s)
/* Read a real sector */
if(!LargeSeek(image->file, (gint64)(2048*s)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
s, strerror(errno));
n = LargeRead(image->file, buf, 2048);
if(n != 2048)
Stop(_("Failed reading sector %lld in image: %s"),s,strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"),s,strerror(errno));
}
/***
@@ -527,20 +527,20 @@ RS02Layout *CalcRS02Layout(Image *image)
Verbose("Calculated layout for RS02 image:\n");
Verbose("data sectors = %lld\n", lay->dataSectors);
Verbose("crc sectors = %lld\n", lay->crcSectors);
Verbose("protected sectors = %lld (incl. 2 hdr sectors)\n", lay->protectedSectors);
Verbose("reed solomon secs = %lld (%d roots, %d data)\n", lay->rsSectors,lay->nroots,lay->ndata);
Verbose("header repeats = %lld (using modulo %lld)\n", lay->headers, lay->headerModulo);
Verbose("added sectors = %lld\n", lay->eccSectors);
Verbose("total image size = %lld\n", lay->eccSectors+lay->dataSectors);
Verbose("data sectors = %" PRId64 "\n", lay->dataSectors);
Verbose("crc sectors = %" PRId64 "\n", lay->crcSectors);
Verbose("protected sectors = %" PRId64 " (incl. 2 hdr sectors)\n", lay->protectedSectors);
Verbose("reed solomon secs = %" PRId64 " (%d roots, %d data)\n", lay->rsSectors,lay->nroots,lay->ndata);
Verbose("header repeats = %" PRId64 " (using modulo %" PRId64 ")\n", lay->headers, lay->headerModulo);
Verbose("added sectors = %" PRId64 "\n", lay->eccSectors);
Verbose("total image size = %" PRId64 "\n", lay->eccSectors+lay->dataSectors);
if(requested_roots > 0)
Verbose("medium capacity = n.a.\n");
else Verbose("medium capacity = %lld\n", lay->mediumCapacity);
else Verbose("medium capacity = %" PRId64 "\n", lay->mediumCapacity);
Verbose("\nInterleaving layout:\n");
Verbose("%lld sectors per ecc layer\n",lay->sectorsPerLayer);
Verbose("first layer sector with CRC data %lld (sector# %lld)\n",
Verbose("%" PRId64 " sectors per ecc layer\n",lay->sectorsPerLayer);
Verbose("first layer sector with CRC data %" PRId64 " (sector# %" PRId64 ")\n",
lay->firstCrcLayerIndex, lay->dataSectors+2);
Verbose("\n");
@@ -577,11 +577,11 @@ void WriteRS02Headers(LargeFile *file, RS02Layout *lay, EccHeader *eh)
int n;
if(!LargeSeek(file, 2048*lay->firstEccHeader))
Stop(_("Failed seeking to ecc header at %lld: %s\n"), lay->firstEccHeader, strerror(errno));
Stop(_("Failed seeking to ecc header at %" PRId64 ": %s\n"), lay->firstEccHeader, strerror(errno));
n = LargeWrite(file, eh, sizeof(EccHeader));
if(n != sizeof(EccHeader))
Stop(_("Failed writing ecc header at %lld: %s\n"), lay->firstEccHeader, strerror(errno));
Stop(_("Failed writing ecc header at %" PRId64 ": %s\n"), lay->firstEccHeader, strerror(errno));
hpos = (lay->protectedSectors + lay->headerModulo - 1) / lay->headerModulo;
hpos *= lay->headerModulo;
@@ -589,11 +589,11 @@ void WriteRS02Headers(LargeFile *file, RS02Layout *lay, EccHeader *eh)
while(hpos < end)
{
if(!LargeSeek(file, 2048*hpos))
Stop(_("Failed seeking to ecc header at %lld: %s\n"), hpos, strerror(errno));
Stop(_("Failed seeking to ecc header at %" PRId64 ": %s\n"), hpos, strerror(errno));
n = LargeWrite(file, eh, sizeof(EccHeader));
if(n != sizeof(EccHeader))
Stop(_("Failed writing ecc header at %lld: %s\n"), hpos, strerror(errno));
Stop(_("Failed writing ecc header at %" PRId64 ": %s\n"), hpos, strerror(errno));
hpos += lay->headerModulo;
}
@@ -790,18 +790,18 @@ RS02Layout *RS02LayoutFromImage(Image *image)
finish:
Verbose("Calculated layout for RS02 image:\n");
Verbose("data sectors = %lld\n", lay->dataSectors);
Verbose("crc sectors = %lld\n", lay->crcSectors);
Verbose("protected sectors = %lld (incl. 2 hdr sectors)\n", lay->protectedSectors);
Verbose("reed solomon secs = %lld (%d roots, %d data)\n", lay->rsSectors,lay->nroots,lay->ndata);
Verbose("header repeats = %lld (using modulo %lld)\n", lay->headers, lay->headerModulo);
Verbose("added sectors = %lld\n", lay->eccSectors);
Verbose("total image size = %lld\n", lay->eccSectors+lay->dataSectors);
Verbose("data sectors = %" PRId64 "\n", lay->dataSectors);
Verbose("crc sectors = %" PRId64 "\n", lay->crcSectors);
Verbose("protected sectors = %" PRId64 " (incl. 2 hdr sectors)\n", lay->protectedSectors);
Verbose("reed solomon secs = %" PRId64 " (%d roots, %d data)\n", lay->rsSectors,lay->nroots,lay->ndata);
Verbose("header repeats = %" PRId64 " (using modulo %" PRId64 ")\n", lay->headers, lay->headerModulo);
Verbose("added sectors = %" PRId64 "\n", lay->eccSectors);
Verbose("total image size = %" PRId64 "\n", lay->eccSectors+lay->dataSectors);
Verbose("medium capacity = n.a.\n");
Verbose("\nInterleaving layout:\n");
Verbose("%lld sectors per ecc layer\n",lay->sectorsPerLayer);
Verbose("first layer sector with CRC data %lld (sector# %lld)\n",
Verbose("%" PRId64 " sectors per ecc layer\n",lay->sectorsPerLayer);
Verbose("first layer sector with CRC data %" PRId64 " (sector# %" PRId64 ")\n",
lay->firstCrcLayerIndex, lay->dataSectors+2);
Verbose("\n");

View File

@@ -154,7 +154,7 @@ static void remove_old_ecc(ecc_closure *ec)
#endif
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image \"%s\" already contains error correction information.\n"
"Truncating image to data part (%lld sectors).\n"),
"Truncating image to data part (%" PRId64 " sectors).\n"),
Closure->imageName, data_sectors);
#ifndef CLI
else answer = TRUE;
@@ -172,8 +172,8 @@ static void remove_old_ecc(ecc_closure *ec)
PrintLog(_("Image size is now"));
if(ec->image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), ec->image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), ec->image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
ec->image->sectorSize-1, ec->image->inLast);
}
}
@@ -226,7 +226,7 @@ static void check_image(ecc_closure *ec)
n = LargeRead(image->file, buf, expected);
if(n != expected)
Stop(_("Failed reading sector %lld in image: %s"),sectors,strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"),sectors,strerror(errno));
/* Look for the dead sector marker */
@@ -237,7 +237,7 @@ static void check_image(ecc_closure *ec)
"Error correction information can only be\n"
"appended to complete (undamaged) images.\n"));
else
Stop(_("Sector %lld in the image is marked unreadable\n"
Stop(_("Sector %" PRId64 " in the image is marked unreadable\n"
"and seems to come from a different medium.\n\n"
"The image was probably mastered from defective content.\n"
"For example it might contain one or more files which came\n"
@@ -374,7 +374,7 @@ static void write_crc(ecc_closure *ec)
/*** Calculate the CRCs */
if(!LargeSeek(image->file, 2048*crc_sector))
Stop(_("Failed seeking to sector %lld in image: %s"), crc_sector, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), crc_sector, strerror(errno));
for(layer_sector=0; layer_sector<lay->sectorsPerLayer; layer_sector++)
{ gint64 layer_index = (layer_sector + layer_offset) % lay->sectorsPerLayer;
@@ -397,7 +397,7 @@ static void write_crc(ecc_closure *ec)
{ int n = LargeWrite(image->file, crc_buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), crc_sector, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), crc_sector, strerror(errno));
MD5Update(&md5ctxt, (unsigned char*)crc_buf, n);
crc_sector++;
@@ -423,7 +423,7 @@ static void write_crc(ecc_closure *ec)
n = LargeWrite(image->file, crc_buf, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), crc_sector, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), crc_sector, strerror(errno));
MD5Update(&md5ctxt, (unsigned char*)crc_buf, n);
}
@@ -1029,10 +1029,10 @@ static gint32 *enc_alpha_to;
{ gint64 s = RS02EccSectorIndex(lay, k, chunk + si);
if(!LargeSeek(image->file, 2048*s))
Stop(_("Failed seeking to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), s, strerror(errno));
if(LargeWrite(image->file, ec->slice[k]+idx, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), s, strerror(errno));
MD5Update(&ec->md5Ctxt[k], ec->slice[k]+idx, 2048);
}
@@ -1082,8 +1082,8 @@ void RS02Create(void)
}
if(image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
/*** Register the cleanup procedure for GUI mode */
@@ -1115,7 +1115,7 @@ void RS02Create(void)
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
{ ec->msg = g_strdup_printf(_("Encoding with Method RS02: %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
{ ec->msg = g_strdup_printf(_("Encoding with Method RS02: %" PRId64 " MiB data, %" PRId64 " MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, lay->eccSectors/512, lay->nroots, lay->redundancy);
SetLabelText(GTK_LABEL(wl->encHeadline),
@@ -1124,7 +1124,7 @@ void RS02Create(void)
}
else
#endif
{ ec->msg = g_strdup_printf(_("Augmenting image with Method RS02:\n %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
{ ec->msg = g_strdup_printf(_("Augmenting image with Method RS02:\n %" PRId64 " MiB data, %" PRId64 " MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, lay->eccSectors/512, lay->nroots, lay->redundancy);
PrintLog("%s\n",ec->msg);
@@ -1134,7 +1134,7 @@ void RS02Create(void)
if(lay->nroots < 8)
Stop(_("Not enough space on medium left for error correction data.\n"
"Data portion of image: %lld sect.; maximum possible size: %lld sect.\n"
"Data portion of image: %" PRId64 " sect.; maximum possible size: %" PRId64 " sect.\n"
"If reducing the image size or using a larger medium is\n"
"not an option, please create a separate error correction file."),
lay->dataSectors, lay->mediumCapacity);
@@ -1176,7 +1176,7 @@ void RS02Create(void)
PrintProgress(_("Ecc generation: 100.0%%\n"));
PrintLog(_("Image has been augmented with error correction data.\n"
"New image size is %lld MiB (%lld sectors).\n"),
"New image size is %" PRId64 " MiB (%" PRId64 " sectors).\n"),
(lay->dataSectors + lay->eccSectors)/512,
lay->dataSectors+lay->eccSectors);
@@ -1186,7 +1186,7 @@ void RS02Create(void)
SetLabelText(GTK_LABEL(wl->encFootline),
_("Image has been augmented with error correction data.\n"
"New image size is %lld MiB (%lld sectors).\n"),
"New image size is %" PRId64 " MiB (%" PRId64 " sectors).\n"),
(lay->dataSectors + lay->eccSectors)/512,
lay->dataSectors+lay->eccSectors);
}

View File

@@ -247,9 +247,9 @@ void RS02Fix(Image *image)
if(diff>0 && diff<=2)
{ int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
_("Image file is %" PRId64 " sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
"%" PRId64 " sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
@@ -287,7 +287,7 @@ void RS02Fix(Image *image)
if(!TruncateImage(image, (gint64)(2048*expected_sectors)))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
#endif
@@ -305,7 +305,7 @@ void RS02Fix(Image *image)
if(!TruncateImage(image, (gint64)(2048*expected_sectors)))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
}
@@ -411,10 +411,10 @@ void RS02Fix(Image *image)
{ gint64 esi = RS02EccSectorIndex(lay, i, ecc_idx+j);
if(!LargeSeek(image->file, 2048*esi))
Stop(_("Failed seeking to sector %lld in image: %s"), esi, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), esi, strerror(errno));
if(LargeRead(image->file, fc->imgBlock[i+ndata]+offset, 2048) != 2048)
Stop(_("Failed reading sector %lld in image: %s"), esi, strerror(errno));
Stop(_("Failed reading sector %" PRId64 " in image: %s"), esi, strerror(errno));
offset += 2048;
}
@@ -461,7 +461,7 @@ void RS02Fix(Image *image)
if(crc_valid && !erasure_map[i] && crc != crc_buf[crc_idx])
{ erasure_map[i] = 3;
erasure_list[erasure_count++] = i;
PrintCLI(_("CRC error in sector %lld\n"),block_idx[i]);
PrintCLI(_("CRC error in sector %" PRId64 "\n"),block_idx[i]);
damaged_sectors++;
crc_errors++;
}
@@ -496,13 +496,13 @@ void RS02Fix(Image *image)
#ifndef CLI
if(!Closure->guiMode)
#endif
{ PrintCLI(_("* Ecc block %lld: %3d unrepairable sectors: "), s, erasure_count);
{ PrintCLI(_("* Ecc block %" PRId64 ": %3d unrepairable sectors: "), s, erasure_count);
for(i=0; i<erasure_count; i++)
{ gint64 loc = erasure_list[i];
if(loc < ndata) PrintCLI("%lld ", block_idx[loc]);
else PrintCLI("%lld ", RS02EccSectorIndex(lay, loc-ndata, ecc_idx));
if(loc < ndata) PrintCLI("%" PRId64 " ", block_idx[loc]);
else PrintCLI("%" PRId64 " ", RS02EccSectorIndex(lay, loc-ndata, ecc_idx));
}
PrintCLI("\n");
@@ -660,8 +660,8 @@ void RS02Fix(Image *image)
for(i=0; i<erasure_count; i++)
{ gint64 loc = erasure_list[i];
if(loc < ndata) PrintLog("%lld ", block_idx[loc]);
else PrintLog("%lld ", RS02EccSectorIndex(lay, loc-ndata, ecc_idx));
if(loc < ndata) PrintLog("%" PRId64 " ", block_idx[loc]);
else PrintLog("%" PRId64 " ", RS02EccSectorIndex(lay, loc-ndata, ecc_idx));
}
PrintLog("\n");
uncorrected += erasure_count;
@@ -778,12 +778,12 @@ void RS02Fix(Image *image)
corrected++;
PrintCLI("%lld%c ", sec, type);
PrintCLI("%" PRId64 "%c ", sec, type);
/* Write the recovered sector */
if(!LargeSeek(image->file, (gint64)(2048*sec)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
sec, "FW", strerror(errno));
/* augmented images can not have sizes not a multiple of 2048,
@@ -791,7 +791,7 @@ void RS02Fix(Image *image)
n = LargeWrite(image->file, cache_offset+fc->imgBlock[i], 2048);
if(n != 2048)
Stop(_("could not write medium sector %lld:\n%s"), sec, strerror(errno));
Stop(_("could not write medium sector %" PRId64 ":\n%s"), sec, strerror(errno));
}
@@ -848,15 +848,15 @@ skip:
PrintProgress(_("Ecc progress: 100.0%%\n"));
if(corrected > 0) PrintLog(_("Repaired sectors: %lld (%lld data, %lld ecc)\n"),
if(corrected > 0) PrintLog(_("Repaired sectors: %" PRId64 " (%" PRId64 " data, %" PRId64 " ecc)\n"),
corrected, data_corr, ecc_corr);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
{ PrintLog(_("Unrepaired sectors: %" PRId64 "\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
"(%" PRId64 " repaired; <span %s>%" PRId64 " unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
}
@@ -881,9 +881,9 @@ skip:
#endif
Verbose("\nSummary of processed sectors:\n");
Verbose("%lld damaged sectors\n", damaged_sectors);
Verbose("%lld CRC errors\n", crc_errors);
Verbose("%lld of %lld ecc blocks damaged (%lld / %lld sectors)\n",
Verbose("%" PRId64 " damaged sectors\n", damaged_sectors);
Verbose("%" PRId64 " CRC errors\n", crc_errors);
Verbose("%" PRId64 " of %" PRId64 " ecc blocks damaged (%" PRId64 " / %" PRId64 " sectors)\n",
damaged_eccblocks, 2048*lay->sectorsPerLayer,
damaged_eccsecs, lay->sectorsPerLayer);
if(data_count != lay->dataSectors)

View File

@@ -78,7 +78,7 @@ static int try_sector(Image *image, gint64 pos, EccHeader **ehptr, unsigned char
/* Try reading the sector */
Verbose("try_sector: trying sector %lld\n", pos);
Verbose("try_sector: trying sector %" PRId64 "\n", pos);
if(ImageReadSectors(image, secbuf, pos, 2) != 2)
{ Verbose("try_sector: read error, trying next header\n");
@@ -244,7 +244,7 @@ int RS02Recognize(Image *image)
while(header_modulo >= 32)
{ pos = max_sectors & ~(header_modulo - 1);
Verbose("FindHeaderInMedium: Trying modulo %lld\n", header_modulo);
Verbose("FindHeaderInMedium: Trying modulo %" PRId64 "\n", header_modulo);
while(pos > 0)
{ int result;
@@ -255,12 +255,12 @@ int RS02Recognize(Image *image)
#endif
if(GetBit(try_next_header, pos))
{ Verbose("Sector %lld cached; skipping\n", pos);
{ Verbose("Sector %" PRId64 " cached; skipping\n", pos);
goto check_next_header;
}
if(GetBit(try_next_modulo, pos))
{ Verbose("Sector %lld cached; skipping modulo\n", pos);
{ Verbose("Sector %" PRId64 " cached; skipping modulo\n", pos);
goto check_next_modulo;
}

View File

@@ -401,7 +401,7 @@ static void read_crc(verify_closure *cc, RS02Layout *lay)
/* First sector containing crc data */
if(!LargeSeek(cc->image->file, 2048*(lay->dataSectors+2)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
lay->dataSectors+2, strerror(errno));
crc_sector = lay->dataSectors+2;
@@ -512,7 +512,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
PrintLog(_("- erasure counts : avg = %.1f; worst = %d per ecc block.\n"),
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
PrintLog(_("- prognosis : %lld of %lld sectors recoverable (%d.%d%%)\n"),
PrintLog(_("- prognosis : %" PRId64 " of %" PRId64 " sectors recoverable (%d.%d%%)\n"),
recoverable, expected, percentage/10, percentage%10);
#ifndef CLI
@@ -528,7 +528,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
SetLabelText(GTK_LABEL(vc->wl->cmpEcc3Msg),
_("<span %s>%lld of %lld sectors recoverable (%d.%d%%)</span>"),
_("<span %s>%" PRId64 " of %" PRId64 " sectors recoverable (%d.%d%%)</span>"),
recoverable < expected ? Closure->redMarkup : Closure->greenMarkup,
recoverable, expected, percentage/10, percentage%10);
}
@@ -617,19 +617,19 @@ void RS02Verify(Image *image)
#endif
PrintLog("\n%s: ",Closure->imageName);
PrintLog(_("present, contains %lld medium sectors.\n"),image->sectorSize);
PrintLog(_("present, contains %" PRId64 " medium sectors.\n"),image->sectorSize);
#ifndef CLI
if(Closure->guiMode)
{ if(expected_sectors == image->sectorSize)
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%lld", image->sectorSize);
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors), "%" PRId64 "", image->sectorSize);
}
else
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors), "<span %s>%lld</span>",
{ SetLabelText(GTK_LABEL(wl->cmpImageSectors), "<span %s>%" PRId64 "</span>",
Closure->redMarkup, image->sectorSize);
if(expected_sectors > image->sectorSize)
img_advice = g_strdup_printf(_("<span %s>Image file is %lld sectors shorter than expected.</span>"), Closure->redMarkup, expected_sectors - image->sectorSize);
else img_advice = g_strdup_printf(_("<span %s>Image file is %lld sectors longer than expected.</span>"), Closure->redMarkup, image->sectorSize - expected_sectors);
img_advice = g_strdup_printf(_("<span %s>Image file is %" PRId64 " sectors shorter than expected.</span>"), Closure->redMarkup, expected_sectors - image->sectorSize);
else img_advice = g_strdup_printf(_("<span %s>Image file is %" PRId64 " sectors longer than expected.</span>"), Closure->redMarkup, image->sectorSize - expected_sectors);
}
}
#endif
@@ -646,11 +646,11 @@ void RS02Verify(Image *image)
{ int n;
if(!LargeSeek(image->file, 2048*hdr_pos))
Stop(_("Failed seeking to ecc header at %lld: %s\n"), hdr_pos, strerror(errno));
Stop(_("Failed seeking to ecc header at %" PRId64 ": %s\n"), hdr_pos, strerror(errno));
n = LargeRead(image->file, &eh, sizeof(EccHeader));
if(n != sizeof(EccHeader))
Stop(_("Failed reading ecc header at %lld: %s\n"), hdr_pos, strerror(errno));
Stop(_("Failed reading ecc header at %" PRId64 ": %s\n"), hdr_pos, strerror(errno));
/* Missing header blocks are always recoverable by copying information
from the surviving headers */
@@ -694,7 +694,7 @@ void RS02Verify(Image *image)
{ if(!hdr_crc_errors && !hdr_missing)
SetLabelText(GTK_LABEL(wl->cmpEccHeaders), _("complete"));
else
{ SetLabelText(GTK_LABEL(wl->cmpEccHeaders), _("<span %s>%lld ok, %lld CRC errors, %lld missing</span>"),
{ SetLabelText(GTK_LABEL(wl->cmpEccHeaders), _("<span %s>%" PRId64 " ok, %" PRId64 " CRC errors, %" PRId64 " missing</span>"),
Closure->redMarkup, hdr_ok, hdr_crc_errors, hdr_missing);
}
}
@@ -781,8 +781,8 @@ void RS02Verify(Image *image)
if(!current_missing || s==expected_sectors-1)
{ if(first_missing>=0)
{ if(first_missing == last_missing)
PrintCLI(_("* missing sector : %lld\n"), first_missing);
else PrintCLI(_("* missing sectors : %lld - %lld\n"), first_missing, last_missing);
PrintCLI(_("* missing sector : %" PRId64 "\n"), first_missing);
else PrintCLI(_("* missing sectors : %" PRId64 " - %" PRId64 "\n"), first_missing, last_missing);
first_missing = -1;
}
}
@@ -794,7 +794,7 @@ void RS02Verify(Image *image)
{ guint32 crc = Crc32(buf, 2048);
if(cc->crcValid[crc_idx] && crc != cc->crcBuf[crc_idx])
{ PrintCLI(_("* CRC error, sector: %lld\n"), s);
{ PrintCLI(_("* CRC error, sector: %" PRId64 "\n"), s);
data_crc_errors++;
new_crc_errors++;
defective = TRUE;
@@ -834,15 +834,15 @@ void RS02Verify(Image *image)
{ add_verify_values(self, percent, new_missing, new_crc_errors);
if(data_missing || data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection),
_("<span %s>%lld sectors missing; %lld CRC errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " CRC errors</span>"),
Closure->redMarkup, data_missing, data_crc_errors);
if(crc_missing)
SetLabelText(GTK_LABEL(wl->cmpCrcSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, crc_missing);
if(ecc_missing)
SetLabelText(GTK_LABEL(wl->cmpEccSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
@@ -857,15 +857,15 @@ void RS02Verify(Image *image)
if(Closure->guiMode)
{ if(data_missing || data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection),
_("<span %s>%lld sectors missing; %lld CRC errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " CRC errors</span>"),
Closure->redMarkup, data_missing, data_crc_errors);
if(crc_missing)
SetLabelText(GTK_LABEL(wl->cmpCrcSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, crc_missing);
if(ecc_missing)
SetLabelText(GTK_LABEL(wl->cmpEccSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
@@ -889,22 +889,22 @@ void RS02Verify(Image *image)
PrintLog(_("* suspicious image : contains damaged ecc headers\n"));
else
{ if(!total_crc_errors)
PrintLog(_("* BAD image : %lld sectors missing\n"), total_missing);
PrintLog(_("* BAD image : %" PRId64 " sectors missing\n"), total_missing);
if(!total_missing)
PrintLog(_("* suspicious image : all sectors present, but %lld CRC errors\n"), total_crc_errors);
PrintLog(_("* suspicious image : all sectors present, but %" PRId64 " CRC errors\n"), total_crc_errors);
if(total_missing && total_crc_errors)
PrintLog(_("* BAD image : %lld sectors missing, %lld CRC errors\n"),
PrintLog(_("* BAD image : %" PRId64 " sectors missing, %" PRId64 " CRC errors\n"),
total_missing, total_crc_errors);
}
PrintLog(_(" ... ecc headers : %lld ok, %lld CRC errors, %lld missing\n"),
PrintLog(_(" ... ecc headers : %" PRId64 " ok, %" PRId64 " CRC errors, %" PRId64 " missing\n"),
hdr_ok, hdr_crc_errors, hdr_missing);
PrintLog(_(" ... data section : %lld sectors missing; %lld CRC errors\n"),
PrintLog(_(" ... data section : %" PRId64 " sectors missing; %" PRId64 " CRC errors\n"),
data_missing, data_crc_errors);
if(!data_missing)
PrintLog(_(" ... data md5sum : %s\n"), data_digest);
PrintLog(_(" ... crc section : %lld sectors missing\n"), crc_missing);
PrintLog(_(" ... ecc section : %lld sectors missing\n"), ecc_missing);
PrintLog(_(" ... crc section : %" PRId64 " sectors missing\n"), crc_missing);
PrintLog(_(" ... ecc section : %" PRId64 " sectors missing\n"), ecc_missing);
}
#ifndef CLI
@@ -1040,25 +1040,25 @@ continue_with_ecc:
/* Number of sectors medium is supposed to have */
if(image->sectorSize == expected_sectors)
{ PrintLog(_("- medium sectors : %lld / %lld (good)\n"),
{ PrintLog(_("- medium sectors : %" PRId64 " / %" PRId64 " (good)\n"),
expected_sectors, lay->dataSectors);
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%lld / %lld",
SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors), "%" PRId64 " / %" PRId64 "",
expected_sectors, lay->dataSectors);
#endif
}
else
{ if(image->sectorSize > expected_sectors && image->sectorSize - expected_sectors <= 2)
PrintLog(_("* medium sectors : %lld (BAD, perhaps TAO/DAO mismatch)\n"),
PrintLog(_("* medium sectors : %" PRId64 " (BAD, perhaps TAO/DAO mismatch)\n"),
expected_sectors);
else PrintLog(_("* medium sectors : %lld (BAD)\n"),expected_sectors);
else PrintLog(_("* medium sectors : %" PRId64 " (BAD)\n"),expected_sectors);
#ifndef CLI
if(Closure->guiMode)
{ SetLabelText(GTK_LABEL(wl->cmpEccMediumSectors),
"<span %s>%lld</span>", Closure->redMarkup, expected_sectors);
"<span %s>%" PRId64 "</span>", Closure->redMarkup, expected_sectors);
if(!ecc_advice && image->sectorSize > expected_sectors)
ecc_advice = g_strdup_printf(_("<span %s>Image size does not match recorded size.</span>"), Closure->redMarkup);
}

View File

@@ -138,8 +138,8 @@ void RS02SetFixMaxValues(RS02Widgets *wl, int data_bytes, int ecc_bytes, gint64
static gboolean results_idle_func(gpointer data)
{ RS02Widgets *wl = (RS02Widgets*)data;
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %lld"), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%lld</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %" PRId64 ""), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%" PRId64 "</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixProgress), _("Progress: %3d.%1d%%"), wl->percent/10, wl->percent%10);
return FALSE;

View File

@@ -195,9 +195,9 @@ void RS03ReadSectors(Image *image, RS03Layout *lay, unsigned char *buf,
gint64 n;
if(layer < 0 || layer > 255)
Stop("RS03ReadSectors: layer %lld out of range 0 .. 255\n", layer);
Stop("RS03ReadSectors: layer %" PRId64 " out of range 0 .. 255\n", layer);
if(layer_sector < 0 || layer_sector >= lay->sectorsPerLayer)
Stop("RS03ReadSectors: offset %lld out of range 0 .. %lld)\n",
Stop("RS03ReadSectors: offset %" PRId64 " out of range 0 .. %" PRId64 ")\n",
layer_sector, lay->sectorsPerLayer-1);
/* "Image" file size may not be a multiple of 2048 */
@@ -244,7 +244,7 @@ void RS03ReadSectors(Image *image, RS03Layout *lay, unsigned char *buf,
stop_sector = start_sector + how_many - 1;
if(stop_sector >= (layer+1)*lay->sectorsPerLayer)
Stop("RS03ReadSectors: range %lld..%lld crosses layer boundary\n",
Stop("RS03ReadSectors: range %" PRId64 "..%" PRId64 " crosses layer boundary\n",
start_sector, stop_sector);
target_file = image->file;
}
@@ -337,12 +337,12 @@ void RS03ReadSectors(Image *image, RS03Layout *lay, unsigned char *buf,
/* All sectors are consecutively readable in image case */
if(!LargeSeek(target_file, (gint64)(2048*start_sector)))
Stop(_("Failed seeking to sector %lld in image: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"),
start_sector, strerror(errno));
n = LargeRead(target_file, buf, byte_size);
if(n != byte_size)
Stop(_("Failed reading sector %lld in image: %s"),
Stop(_("Failed reading sector %" PRId64 " in image: %s"),
start_sector, strerror(errno));
}
@@ -464,7 +464,7 @@ RS03Layout *CalcRS03Layout(Image *image, int target)
ecc_size = strtoll(Closure->redundancy, NULL, 10);
if( ecc_size < ecc_file_size(lay->dataSectors, 8)
|| ecc_size > ecc_file_size(lay->dataSectors, 170))
Stop(_("Ecc file size %lldm out of useful range [%lld .. %lld]"),
Stop(_("Ecc file size %" PRId64 "m out of useful range [%" PRId64 " .. %" PRId64 "]"),
ecc_size,
ecc_file_size(lay->dataSectors, 8),
ecc_file_size(lay->dataSectors, 170));
@@ -522,7 +522,7 @@ RS03Layout *CalcRS03Layout(Image *image, int target)
{ dataSectors = image->sectorSize;
if(Closure->debugMode && Closure->mediumSize)
{ if(dataSectors >= Closure->mediumSize)
Stop(_("Medium size smaller than image size (%lld < %lld)"), Closure->mediumSize, dataSectors);
Stop(_("Medium size smaller than image size (%" PRId64 " < %" PRId64 ")"), Closure->mediumSize, dataSectors);
lay->mediumCapacity = Closure->mediumSize;
}
else
@@ -591,14 +591,14 @@ RS03Layout *CalcRS03Layout(Image *image, int target)
Verbose("Calculated layout for RS03 file:\n");
else Verbose("Calculated layout for RS03 image:\n");
Verbose("data sectors = %lld\n", lay->dataSectors);
Verbose("data padding = %lld\n", lay->dataPadding);
Verbose("layer size = %lld\n", lay->sectorsPerLayer);
Verbose("total sectors = %lld\n", lay->totalSectors);
Verbose("medium capacity = %lld\n", lay->mediumCapacity);
Verbose("header position = %lld\n", lay->eccHeaderPos);
Verbose("first CRC sector = %lld\n", lay->firstCrcPos);
Verbose("first ECC sector = %lld\n", lay->firstEccPos);
Verbose("data sectors = %" PRId64 "\n", lay->dataSectors);
Verbose("data padding = %" PRId64 "\n", lay->dataPadding);
Verbose("layer size = %" PRId64 "\n", lay->sectorsPerLayer);
Verbose("total sectors = %" PRId64 "\n", lay->totalSectors);
Verbose("medium capacity = %" PRId64 "\n", lay->mediumCapacity);
Verbose("header position = %" PRId64 "\n", lay->eccHeaderPos);
Verbose("first CRC sector = %" PRId64 "\n", lay->firstCrcPos);
Verbose("first ECC sector = %" PRId64 "\n", lay->firstEccPos);
Verbose("ndata = %d\n", lay->ndata);
Verbose("nroots = %d (%4.1f%%)\n", lay->nroots, lay->redundancy);
Verbose("\n");
@@ -640,11 +640,11 @@ void WriteRS03Header(LargeFile *file, RS03Layout *lay, EccHeader *eh)
{ int n;
if(!LargeSeek(file, 2048*lay->eccHeaderPos))
Stop(_("Failed seeking to ecc header at %lld: %s\n"), lay->eccHeaderPos, strerror(errno));
Stop(_("Failed seeking to ecc header at %" PRId64 ": %s\n"), lay->eccHeaderPos, strerror(errno));
n = LargeWrite(file, eh, sizeof(EccHeader));
if(n != sizeof(EccHeader))
Stop(_("Failed writing ecc header at %lld: %s\n"), lay->eccHeaderPos, strerror(errno));
Stop(_("Failed writing ecc header at %" PRId64 ": %s\n"), lay->eccHeaderPos, strerror(errno));
}
/***

View File

@@ -316,7 +316,7 @@ static void remove_old_ecc(ecc_closure *ec)
#endif
answer = ModalWarningOrCLI(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image \"%s\" already contains error correction information.\n"
"Truncating image to data part (%lld sectors).\n"),
"Truncating image to data part (%" PRId64 " sectors).\n"),
Closure->imageName, data_sectors);
#ifndef CLI
else answer = TRUE;
@@ -346,8 +346,8 @@ static void remove_old_ecc(ecc_closure *ec)
PrintLog(_("Image size is now"));
if(ec->image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), ec->image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), ec->image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
ec->image->sectorSize-1, ec->image->inLast);
}
}
@@ -716,7 +716,7 @@ static void read_next_chunk(ecc_closure *ec, guint64 chunk)
Stop(_("Incomplete image\n\n"
"The image contains missing sectors,\n"
"e.g. sector %lld.\n%s"
"e.g. sector %" PRId64 ".\n%s"
"Error correction data works like a backup; it must\n"
"be created when the image is still fully readable.\n"
"Exiting and removing partial error correction data."),
@@ -753,12 +753,12 @@ static void flush_crc(ecc_closure *ec, LargeFile *file_out)
if(!LargeSeek(file_out, crc_sect))
{ ec->abortImmediately = TRUE;
Stop(_("Failed seeking to sector %lld in image: %s"), crc_sect, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), crc_sect, strerror(errno));
}
for(i=0; i<ec->encoderLayerSectors; i++)
if(LargeWrite(file_out, ec->encoderCrc+512*i, 2048) != 2048)
{ ec->abortImmediately = TRUE;
Stop(_("Failed writing to sector %lld in image: %s"), crc_sect, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), crc_sect, strerror(errno));
}
}
@@ -778,11 +778,11 @@ static void flush_parity(ecc_closure *ec, LargeFile *file_out)
if(!LargeSeek(file_out, 2048*s))
{ ec->abortImmediately = TRUE;
Stop(_("Failed seeking to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed seeking to sector %" PRId64 " in image: %s"), s, strerror(errno));
}
if(LargeWrite(file_out, ec->slice[k]+idx, 2048) != 2048)
{ ec->abortImmediately = TRUE;
Stop(_("Failed writing to sector %lld in image: %s"), s, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), s, strerror(errno));
}
}
}
@@ -1332,8 +1332,8 @@ void RS03Create(void)
ec->image = image;
if(image->inLast == 2048)
PrintLog(_(": %lld medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %lld medium sectors and %d bytes.\n"),
PrintLog(_(": %" PRId64 " medium sectors.\n"), image->sectorSize);
else PrintLog(_(": %" PRId64 " medium sectors and %d bytes.\n"),
image->sectorSize-1, image->inLast);
/*** If the image already contains error correction information, remove it. */
@@ -1361,7 +1361,7 @@ void RS03Create(void)
ecc_sectors = lay->nroots*lay->sectorsPerLayer;
#ifndef CLI
if(Closure->guiMode) /* Preliminary fill text for the head line */
{ ec->msg = g_strdup_printf(_("Encoding with Method RS03: %lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
{ ec->msg = g_strdup_printf(_("Encoding with Method RS03: %" PRId64 " MiB data, %" PRId64 " MiB ecc (%d roots; %4.1f%% redundancy)."),
lay->dataSectors/512, ecc_sectors/512, lay->nroots, lay->redundancy);
if(lay->target == ECC_IMAGE)
@@ -1381,12 +1381,12 @@ void RS03Create(void)
if(Closure->eccTarget == ECC_IMAGE)
ec->msg = g_strdup_printf(_("Augmenting image with Method RS03 [%d threads, %s, %s I/O]:\n"
"%lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
"%" PRId64 " MiB data, %" PRId64 " MiB ecc (%d roots; %4.1f%% redundancy)."),
Closure->codecThreads, alg, iostrat,
lay->dataSectors/512, ecc_sectors/512, lay->nroots, lay->redundancy);
else
ec->msg = g_strdup_printf(_("Creating the error correction file with Method RS03 [%d threads, %s, %s I/O]:\n"
"%lld MiB data, %lld MiB ecc (%d roots; %4.1f%% redundancy)."),
"%" PRId64 " MiB data, %" PRId64 " MiB ecc (%d roots; %4.1f%% redundancy)."),
Closure->codecThreads, alg, iostrat,
lay->dataSectors/512, ecc_sectors/512, lay->nroots, lay->redundancy);
@@ -1397,7 +1397,7 @@ void RS03Create(void)
if(Closure->eccTarget == ECC_IMAGE && lay->nroots < 8)
Stop(_("Not enough space on medium left for error correction data.\n"
"Data portion of image: %lld sect.; maximum possible size: %lld sect.\n"
"Data portion of image: %" PRId64 " sect.; maximum possible size: %" PRId64 " sect.\n"
"If reducing the image size or using a larger medium is not\n"
"an option, please create a separate error correction file."),
lay->dataSectors, lay->mediumCapacity);
@@ -1446,7 +1446,7 @@ void RS03Create(void)
PrintProgress(_("Ecc generation: 100.0%%\n"));
if(Closure->eccTarget == ECC_IMAGE)
PrintLog(_("Image has been augmented with error correction data.\n"
"New image size is %lld MiB (%lld sectors).\n"),
"New image size is %" PRId64 " MiB (%" PRId64 " sectors).\n"),
(lay->totalSectors)/512,
lay->totalSectors);
else
@@ -1474,7 +1474,7 @@ void RS03Create(void)
if(Closure->eccTarget == ECC_IMAGE)
SetLabelText(GTK_LABEL(wl->encFootline),
_("Image has been augmented with error correction data.\n"
"New image size is %lld MiB (%lld sectors).\n"),
"New image size is %" PRId64 " MiB (%" PRId64 " sectors).\n"),
(lay->totalSectors)/512,
lay->totalSectors);
else

View File

@@ -314,9 +314,9 @@ void RS03Fix(Image *image)
if(diff>0 && diff<=2)
{ int answer;
answer = ModalWarningOrCLI(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file is %lld sectors longer than expected.\n"
_("Image file is %" PRId64 " sectors longer than expected.\n"
"Assuming this is a TAO mode medium.\n"
"%lld sectors will be removed from the image end.\n"),
"%" PRId64 " sectors will be removed from the image end.\n"),
diff, diff);
if(!answer)
@@ -358,7 +358,7 @@ void RS03Fix(Image *image)
if(!LargeTruncate(image->file, (gint64)expected_image_size))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
#endif
@@ -378,7 +378,7 @@ void RS03Fix(Image *image)
if(!LargeTruncate(image->file, (gint64)expected_image_size))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
PrintLog(_("Image has been truncated by %lld sectors.\n"), diff);
PrintLog(_("Image has been truncated by %" PRId64 " sectors.\n"), diff);
}
}
@@ -519,7 +519,7 @@ void RS03Fix(Image *image)
if(crc_valid && !erasure_map[i] && crc != crc_buf[crc_idx])
{ erasure_map[i] = 3;
erasure_list[erasure_count++] = i;
PrintCLI(_("CRC error in sector %lld\n"),block_idx[i]);
PrintCLI(_("CRC error in sector %" PRId64 "\n"),block_idx[i]);
damaged_sectors++;
crc_errors++;
}
@@ -556,7 +556,7 @@ void RS03Fix(Image *image)
#endif
{ int sep_printed = 0;
PrintCLI(_("* Ecc block %lld: %3d unrepairable sectors: "), s, erasure_count);
PrintCLI(_("* Ecc block %" PRId64 ": %3d unrepairable sectors: "), s, erasure_count);
for(i=0; i<erasure_count; i++)
{ /* sector counting wraps to 0 for ecc files after the data layer */
@@ -564,7 +564,7 @@ void RS03Fix(Image *image)
{ PrintCLI("; ecc file: ");
sep_printed = 1;
}
PrintCLI("%lld ", RS03SectorIndex(lay, erasure_list[i], s));
PrintCLI("%" PRId64 " ", RS03SectorIndex(lay, erasure_list[i], s));
}
PrintCLI("\n");
}
@@ -725,7 +725,7 @@ void RS03Fix(Image *image)
{ PrintCLI(_("; ecc file: "));
sep_printed = 1;
}
PrintCLI("%lld ", RS03SectorIndex(lay, erasure_list[i], s));
PrintCLI("%" PRId64 " ", RS03SectorIndex(lay, erasure_list[i], s));
}
PrintCLI("\n");
uncorrected += erasure_count;
@@ -849,7 +849,7 @@ void RS03Fix(Image *image)
{ PrintCLI(_("; ecc file: "));
sep_printed = 1;
}
PrintCLI("%lld%c ", sec, type);
PrintCLI("%" PRId64 "%c ", sec, type);
/* Write the recovered sector */
@@ -862,12 +862,12 @@ void RS03Fix(Image *image)
|| i < ndata-1)
{
if(!LargeSeek(image->file, (gint64)(2048*sec)))
Stop(_("Failed seeking to sector %lld in image [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in image [%s]: %s"),
sec, "FW", strerror(errno));
n = LargeWrite(image->file, cache_offset+fc->imgBlock[i], length);
if(n != length)
Stop(_("could not write medium sector %lld:\n%s"), sec, strerror(errno));
Stop(_("could not write medium sector %" PRId64 ":\n%s"), sec, strerror(errno));
}
/* Write back into the error correction file
@@ -878,12 +878,12 @@ void RS03Fix(Image *image)
if(lay->target == ECC_FILE && i >= ndata-1)
{
if(!LargeSeek(image->eccFile, (gint64)(2048*sec)))
Stop(_("Failed seeking to sector %lld in ecc file [%s]: %s"),
Stop(_("Failed seeking to sector %" PRId64 " in ecc file [%s]: %s"),
sec, "FW", strerror(errno));
n = LargeWrite(image->eccFile, cache_offset+fc->imgBlock[i], 2048);
if(n != 2048)
Stop(_("could not write ecc file sector %lld:\n%s"),
Stop(_("could not write ecc file sector %" PRId64 ":\n%s"),
sec, strerror(errno));
}
}
@@ -938,15 +938,15 @@ skip:
PrintProgress(_("Ecc progress: 100.0%%\n"));
if(corrected > 0) PrintLog(_("Repaired sectors: %lld (%lld data, %lld ecc)\n"),
if(corrected > 0) PrintLog(_("Repaired sectors: %" PRId64 " (%" PRId64 " data, %" PRId64 " ecc)\n"),
corrected, data_corr, ecc_corr);
if(uncorrected > 0)
{ PrintLog(_("Unrepaired sectors: %lld\n"), uncorrected);
{ PrintLog(_("Unrepaired sectors: %" PRId64 "\n"), uncorrected);
#ifndef CLI
if(Closure->guiMode)
SwitchAndSetFootline(wl->fixNotebook, 1, wl->fixFootline,
_("Image sectors could not be fully restored "
"(%lld repaired; <span %s>%lld unrepaired</span>)"),
"(%" PRId64 " repaired; <span %s>%" PRId64 " unrepaired</span>)"),
corrected, Closure->redMarkup, uncorrected);
#endif
exitCode = 2;
@@ -974,9 +974,9 @@ skip:
#endif
Verbose("\nSummary of processed sectors:\n");
Verbose("%lld damaged sectors\n", damaged_sectors);
Verbose("%lld CRC errors\n", crc_errors);
Verbose("%lld of %lld ecc blocks damaged (%lld / %lld sectors)\n",
Verbose("%" PRId64 " damaged sectors\n", damaged_sectors);
Verbose("%" PRId64 " CRC errors\n", crc_errors);
Verbose("%" PRId64 " of %" PRId64 " ecc blocks damaged (%" PRId64 " / %" PRId64 " sectors)\n",
damaged_eccblocks, 2048*lay->sectorsPerLayer,
damaged_eccsecs, lay->sectorsPerLayer);
if(data_count != (ndata-1)*lay->sectorsPerLayer)

View File

@@ -413,7 +413,7 @@ int RS03RecognizeImage(Image *image)
if(Closure->debugMode && Closure->mediumSize > 170)
{ layer_size = Closure->mediumSize/GF_FIELDMAX;
Verbose("Warning: image size set to %lld for debugging!\n", Closure->mediumSize);
Verbose("Warning: image size set to %" PRId64 " for debugging!\n", Closure->mediumSize);
}
else
{ if(image_sectors < CDR_SIZE) layer_size = CDR_SIZE/GF_FIELDMAX;
@@ -428,7 +428,7 @@ int RS03RecognizeImage(Image *image)
else layer_size = (Closure->noBdrDefectManagement ? BDXL_QL_SIZE_NODM : BDXL_QL_SIZE)/GF_FIELDMAX;
}
Verbose(".. trying layer size %lld\n", layer_size);
Verbose(".. trying layer size %" PRId64 "\n", layer_size);
/*
* Try a quick scan for the CRC sectors in order
@@ -499,7 +499,7 @@ int RS03RecognizeImage(Image *image)
if(crc_state == 1) /* corrupted crc header, try this layer again later */
continue;
Verbose("** Success: sector %lld, rediscovered format with %d roots\n",
Verbose("** Success: sector %" PRId64 ", rediscovered format with %d roots\n",
sector, nroots);
image->eccHeader = g_malloc(sizeof(EccHeader));
ReconstructRS03Header(image->eccHeader, cb);

View File

@@ -457,7 +457,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
PrintLog(_("- erasure counts : avg = %.1f; worst = %d per ecc block.\n"),
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
PrintLog(_("- prognosis : %lld of %lld sectors recoverable (%d.%d%%)\n"),
PrintLog(_("- prognosis : %" PRId64 " of %" PRId64 " sectors recoverable (%d.%d%%)\n"),
recoverable, expected, percentage/10, percentage%10);
#ifndef CLI
@@ -471,7 +471,7 @@ static int prognosis(verify_closure *vc, gint64 missing, gint64 expected)
(double)damaged_sectors/(double)damaged_eccsecs,worst_ecc);
SetLabelText(GTK_LABEL(vc->wl->cmpImagePrognosisMsg),
_("<span %s>%lld of %lld sectors recoverable (%d.%d%%)</span>"),
_("<span %s>%" PRId64 " of %" PRId64 " sectors recoverable (%d.%d%%)</span>"),
recoverable < expected ? Closure->redMarkup : Closure->greenMarkup,
recoverable, expected, percentage/10, percentage%10);
}
@@ -617,10 +617,10 @@ static int check_syndromes(verify_closure *vc)
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(vc->wl->cmpEccSyndromes),
_("<span %s>%lld good, %lld bad; %d%% tested</span>"),
_("<span %s>%" PRId64 " good, %" PRId64 " bad; %d%% tested</span>"),
Closure->redMarkup, ecc_good, ecc_bad, percent);
#endif
PrintProgress(_("* Ecc block test : %lld good, %lld bad; %d%% tested")
PrintProgress(_("* Ecc block test : %" PRId64 " good, %" PRId64 " bad; %d%% tested")
, ecc_good, ecc_bad, percent);
}
}
@@ -642,10 +642,10 @@ static int check_syndromes(verify_closure *vc)
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(vc->wl->cmpEccSyndromes),
_("<span %s>%lld good, %lld bad; %lld bad sub blocks</span>"),
_("<span %s>%" PRId64 " good, %" PRId64 " bad; %" PRId64 " bad sub blocks</span>"),
Closure->redMarkup, ecc_good, ecc_bad, ecc_bad_sub);
#endif
PrintLog(_("* Ecc block test : %lld good, %lld bad; %lld bad sub blocks\n"),
PrintLog(_("* Ecc block test : %" PRId64 " good, %" PRId64 " bad; %" PRId64 " bad sub blocks\n"),
ecc_good, ecc_bad, ecc_bad_sub);
exitCode = EXIT_CODE_SYNDROME_ERROR;
@@ -769,9 +769,9 @@ void RS03Verify(Image *image)
{ char *msg;
if(expected_eccfile_sectors > eccfile_sectors)
msg = g_strdup_printf(_("Ecc file is %lld sectors shorter than expected."),
msg = g_strdup_printf(_("Ecc file is %" PRId64 " sectors shorter than expected."),
expected_eccfile_sectors - eccfile_sectors);
else msg = g_strdup_printf(_("Ecc file is %lld sectors longer than expected."),
else msg = g_strdup_printf(_("Ecc file is %" PRId64 " sectors longer than expected."),
eccfile_sectors - expected_eccfile_sectors);
#ifndef CLI
@@ -988,28 +988,28 @@ void RS03Verify(Image *image)
#ifndef CLI
if(Closure->guiMode)
{ if(image->inLast == 2048)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%lld in image; %lld in ecc file"),
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%" PRId64 " in image; %" PRId64 " in ecc file"),
image->sectorSize, eccfile_sectors);
else
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%lld sectors + %d bytes in image; %lld in ecc file"),
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%" PRId64 " sectors + %d bytes in image; %" PRId64 " in ecc file"),
image->sectorSize-1, image->inLast, eccfile_sectors);
}
#endif
if(image->inLast == 2048)
PrintLog(_("- sectors : %lld in image; "), image->sectorSize);
else PrintLog(_("- sectors : %lld sectors + %d bytes in image; "), image->sectorSize-1, image->inLast);
PrintLog(_("- sectors : %" PRId64 " in image; "), image->sectorSize);
else PrintLog(_("- sectors : %" PRId64 " sectors + %d bytes in image; "), image->sectorSize-1, image->inLast);
PrintLog(_("%lld in ecc file\n"), eccfile_sectors);
PrintLog(_("%" PRId64 " in ecc file\n"), eccfile_sectors);
}
else
{
#ifndef CLI
if(Closure->guiMode)
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%lld total / %lld data"),
SetLabelText(GTK_LABEL(wl->cmpImageSectors), _("%" PRId64 " total / %" PRId64 " data"),
image->sectorSize, lay->dataSectors);
#endif
PrintLog(_("- medium sectors : %lld total / %lld data\n"),
PrintLog(_("- medium sectors : %" PRId64 " total / %" PRId64 " data\n"),
image->sectorSize, lay->dataSectors);
}
}
@@ -1038,16 +1038,16 @@ void RS03Verify(Image *image)
}
if(expected_image_sectors > image->sectorSize)
img_advice = g_strdup_printf(_("<span %s>Image file is %lld sectors shorter than expected.</span>"),
img_advice = g_strdup_printf(_("<span %s>Image file is %" PRId64 " sectors shorter than expected.</span>"),
Closure->redMarkup, expected_image_sectors - image->sectorSize);
if(expected_image_sectors < image->sectorSize)
img_advice = g_strdup_printf(_("<span %s>Image file is %lld sectors longer than expected.</span>"),
img_advice = g_strdup_printf(_("<span %s>Image file is %" PRId64 " sectors longer than expected.</span>"),
Closure->redMarkup, image->sectorSize - expected_image_sectors);
}
#endif
if(lay->target == ECC_FILE)
PrintLog(_("* sectors : %s (%s expected); %lld sectors in ecc file\n"),
PrintLog(_("* sectors : %s (%s expected); %" PRId64 " sectors in ecc file\n"),
image_size, expected_size, eccfile_sectors);
else
PrintLog(_("* medium sectors : %s (%s expected)\n"),
@@ -1182,8 +1182,8 @@ void RS03Verify(Image *image)
ecc_msg = g_strdup(" ");
}
if(first_missing == last_missing)
PrintCLI(_("* missing sector : %lld%s\n"), first,ecc_msg);
else PrintCLI(_("* missing sectors : %lld - %lld%s\n"), first, last, ecc_msg);
PrintCLI(_("* missing sector : %" PRId64 "%s\n"), first,ecc_msg);
else PrintCLI(_("* missing sectors : %" PRId64 " - %" PRId64 "%s\n"), first, last, ecc_msg);
first_missing = -1;
g_free(ecc_msg);
}
@@ -1199,7 +1199,7 @@ void RS03Verify(Image *image)
if(GetBit(vc->crcBuf->valid,crc_idx)
&& crc != vc->crcBuf->crcbuf[crc_idx])
{ PrintCLI(_("* CRC error, sector: %lld\n"), s);
{ PrintCLI(_("* CRC error, sector: %" PRId64 "\n"), s);
data_crc_errors++;
new_crc_errors++;
defective = TRUE;
@@ -1244,15 +1244,15 @@ void RS03Verify(Image *image)
if(data_missing || data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection),
_("<span %s>%lld sectors missing; %lld CRC errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " CRC errors</span>"),
Closure->redMarkup, data_missing, data_crc_errors);
if(crc_missing || csc->signatureErrors)
SetLabelText(GTK_LABEL(wl->cmpCrcSection),
_("<span %s>%lld sectors missing; %lld signature errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " signature errors</span>"),
Closure->redMarkup, crc_missing, csc->signatureErrors);
if(ecc_missing)
SetLabelText(GTK_LABEL(wl->cmpEccSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
@@ -1287,15 +1287,15 @@ void RS03Verify(Image *image)
if(Closure->guiMode)
{ if(data_missing || data_crc_errors)
SetLabelText(GTK_LABEL(wl->cmpDataSection),
_("<span %s>%lld sectors missing; %lld CRC errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " CRC errors</span>"),
Closure->redMarkup, data_missing, data_crc_errors);
if(crc_missing || csc->signatureErrors)
SetLabelText(GTK_LABEL(wl->cmpCrcSection),
_("<span %s>%lld sectors missing; %lld signature errors</span>"),
_("<span %s>%" PRId64 " sectors missing; %" PRId64 " signature errors</span>"),
Closure->redMarkup, crc_missing, csc->signatureErrors);
if(ecc_missing)
SetLabelText(GTK_LABEL(wl->cmpEccSection),
_("<span %s>%lld sectors missing</span>"),
_("<span %s>%" PRId64 " sectors missing</span>"),
Closure->redMarkup, ecc_missing);
}
#endif
@@ -1312,26 +1312,26 @@ void RS03Verify(Image *image)
"- data md5sum : %s\n"),data_digest);
else
{ if(!data_crc_errors && !csc->signatureErrors)
PrintLog(_("* BAD image/file : %lld sectors missing\n"), total_missing);
PrintLog(_("* BAD image/file : %" PRId64 " sectors missing\n"), total_missing);
if(!total_missing)
PrintLog(_("* suspicious image : all sectors present, but %lld CRC errors\n"),
PrintLog(_("* suspicious image : all sectors present, but %" PRId64 " CRC errors\n"),
data_crc_errors);
if(total_missing && data_crc_errors)
PrintLog(_("* BAD image : %lld sectors missing, %lld CRC errors\n"),
PrintLog(_("* BAD image : %" PRId64 " sectors missing, %" PRId64 " CRC errors\n"),
total_missing, data_crc_errors);
PrintLog(_(" ... data section : %lld sectors missing; %lld CRC errors\n"),
PrintLog(_(" ... data section : %" PRId64 " sectors missing; %" PRId64 " CRC errors\n"),
data_missing, data_crc_errors);
if(!total_missing && !data_crc_errors && !csc->signatureErrors)
PrintLog(_(" ... data md5sum : %s\n"), data_digest);
if(csc->signatureErrors)
PrintLog(_(" ... crc section : %lld sectors missing; %lld signature errors\n"),
PrintLog(_(" ... crc section : %" PRId64 " sectors missing; %" PRId64 " signature errors\n"),
crc_missing, csc->signatureErrors);
else
PrintLog(_(" ... crc section : %lld sectors missing\n"), crc_missing);
PrintLog(_(" ... crc section : %" PRId64 " sectors missing\n"), crc_missing);
PrintLog(_(" ... ecc section : %lld sectors missing\n"), ecc_missing);
PrintLog(_(" ... ecc section : %" PRId64 " sectors missing\n"), ecc_missing);
}
#ifndef CLI

View File

@@ -171,8 +171,8 @@ void RS03SetFixMaxValues(RS03Widgets *wl, int data_bytes, int ecc_bytes, gint64
static gboolean results_idle_func(gpointer data)
{ RS03Widgets *wl = (RS03Widgets*)data;
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %lld"), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%lld</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixCorrected), _("Repaired: %" PRId64 ""), wl->corrected);
SetLabelText(GTK_LABEL(wl->fixUncorrected), _("Unrepairable: <span %s>%" PRId64 "</span>"),Closure->redMarkup, wl->uncorrected);
SetLabelText(GTK_LABEL(wl->fixProgress), _("Progress: %3d.%1d%%"), wl->percent/10, wl->percent%10);
return FALSE;

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

View File

@@ -827,7 +827,7 @@ void WriteIsoHeader(IsoHeader *ih, LargeFile *image)
{ int n = LargeWrite(image, zero, 2048);
if(n != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)i, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)i, strerror(errno));
}
/* Complete the primary volume descriptor */
@@ -885,7 +885,7 @@ void WriteIsoHeader(IsoHeader *ih, LargeFile *image)
/* Write the pvd */
if(LargeWrite(image, pvd, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)16, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)16, strerror(errno));
/* Create the supplementary volume descriptor */
@@ -942,7 +942,7 @@ void WriteIsoHeader(IsoHeader *ih, LargeFile *image)
/* Write the svd */
if(LargeWrite(image, svd, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)17, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)17, strerror(errno));
/*** Create and write the volume descriptor set terminator */
@@ -955,26 +955,26 @@ void WriteIsoHeader(IsoHeader *ih, LargeFile *image)
bp_set_byte(sector, 7, 1); /* Volume descriptor version 1 */
if(LargeWrite(image, sector, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)18, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)18, strerror(errno));
/*** Write the primary and supplementary path tables and root directories */
if(LargeWrite(image, ih->ppath->lpath, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)19, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)19, strerror(errno));
if(LargeWrite(image, ih->ppath->mpath, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)20, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)20, strerror(errno));
if(LargeWrite(image, ih->proot->dir, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)21, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)21, strerror(errno));
if(LargeWrite(image, ih->spath->lpath, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)22, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)22, strerror(errno));
if(LargeWrite(image, ih->spath->mpath, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)23, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)23, strerror(errno));
if(LargeWrite(image, ih->sroot->dir, 2048) != 2048)
Stop(_("Failed writing to sector %lld in image: %s"), (gint64)24, strerror(errno));
Stop(_("Failed writing to sector %" PRId64 " in image: %s"), (gint64)24, strerror(errno));
}