From: Freddie Chopin Date: Mon, 28 Dec 2009 20:08:48 +0000 (+0100) Subject: MinGW build fixes X-Git-Tag: v0.4.0-rc2~180 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b1eeb92fe603c2a3d8d04f299aa1318d2ad4b36;p=openocd MinGW build fixes Print "ssize_t" as "%ld" (+ cast to long) not as "%zu". Official MinGW (gcc 3.4.5) doesn't understand "z" flag. Signed-off-by: Freddie Chopin Signed-off-by: David Brownell --- diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 5c8ca8c1..04f5c775 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -751,8 +751,8 @@ COMMAND_HANDLER(mg_write_cmd) if (duration_measure(&bench) == ERROR_OK) { - command_print(CMD_CTX, "wrote %zu byte from file %s " - "in %fs (%0.3f kB/s)", fileio.size, CMD_ARGV[1], + command_print(CMD_CTX, "wrote %ld bytes from file %s " + "in %fs (%0.3f kB/s)", (long)fileio.size, CMD_ARGV[1], duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); } diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index ad77d7ca..4f90c7b1 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -409,8 +409,8 @@ COMMAND_HANDLER(handle_nand_dump_command) if (nand_fileio_finish(&s) == ERROR_OK) { - command_print(CMD_CTX, "dumped %zu bytes in %fs (%0.3f kb/s)", - s.fileio.size, duration_elapsed(&s.bench), + command_print(CMD_CTX, "dumped %ld bytes in %fs (%0.3f kb/s)", + (long)s.fileio.size, duration_elapsed(&s.bench), duration_kbps(&s.bench, s.fileio.size)); } return ERROR_OK; diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 1097bdf8..ad2b8f11 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -625,9 +625,9 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { - command_print(CMD_CTX, "wrote %zu bytes from file %s to flash bank %u" + command_print(CMD_CTX, "wrote %ld bytes from file %s to flash bank %u" " at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)", - fileio.size, CMD_ARGV[1], p->bank_number, offset, + (long)fileio.size, CMD_ARGV[1], p->bank_number, offset, duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); } diff --git a/src/target/target.c b/src/target/target.c index ebddbba8..8cb53b36 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2488,7 +2488,7 @@ COMMAND_HANDLER(handle_dump_image_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { command_print(CMD_CTX, - "dumped %zu bytes in %fs (%0.3f kb/s)", fileio.size, + "dumped %ld bytes in %fs (%0.3f kb/s)", (long)fileio.size, duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); }