diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 14:22:21 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-16 15:47:09 -0800 |
commit | 69df712d1d06b2c698bed3de086b9f734de73b7e (patch) | |
tree | 9defb053b7bce774beb5ebac30bae757b0dd5ba8 | |
parent | 9763aef76a42fdaedcec9825fdf502f8cb7dd628 (diff) | |
download | openocd_libswd-69df712d1d06b2c698bed3de086b9f734de73b7e.tar.gz openocd_libswd-69df712d1d06b2c698bed3de086b9f734de73b7e.tar.bz2 openocd_libswd-69df712d1d06b2c698bed3de086b9f734de73b7e.tar.xz openocd_libswd-69df712d1d06b2c698bed3de086b9f734de73b7e.zip |
struct fileio: improve member types
Add const keyword to file url and cast to free().
Make size an ssize_t and chase all format strings that use it.
-rw-r--r-- | src/flash/flash.c | 2 | ||||
-rw-r--r-- | src/flash/mflash.c | 2 | ||||
-rw-r--r-- | src/flash/nand.c | 2 | ||||
-rw-r--r-- | src/helper/fileio.c | 2 | ||||
-rw-r--r-- | src/helper/fileio.h | 4 | ||||
-rw-r--r-- | src/target/target.c | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index bdee53b6..03d4547d 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -847,7 +847,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { - command_print(cmd_ctx, "wrote %lld byte from file %s to flash bank %u" + command_print(cmd_ctx, "wrote %zu byte from file %s to flash bank %u" " at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)", fileio.size, args[1], p->bank_number, offset, duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 49dc432f..4356f270 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -750,7 +750,7 @@ COMMAND_HANDLER(mg_write_cmd) if (duration_measure(&bench) == ERROR_OK) { - command_print(cmd_ctx, "wrote %lli byte from file %s " + command_print(cmd_ctx, "wrote %zu byte from file %s " "in %fs (%0.3f kB/s)", fileio.size, args[1], duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); } diff --git a/src/flash/nand.c b/src/flash/nand.c index fba8104a..9d997fad 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -1637,7 +1637,7 @@ COMMAND_HANDLER(handle_nand_dump_command) if (nand_fileio_finish(&s) == ERROR_OK) { - command_print(cmd_ctx, "dumped %lld byte in %fs (%0.3f kb/s)", + command_print(cmd_ctx, "dumped %zu bytes in %fs (%0.3f kb/s)", s.fileio.size, duration_elapsed(&s.bench), duration_kbps(&s.bench, s.fileio.size)); } diff --git a/src/helper/fileio.c b/src/helper/fileio.c index 71cae758..84d46bd5 100644 --- a/src/helper/fileio.c +++ b/src/helper/fileio.c @@ -137,7 +137,7 @@ int fileio_close(struct fileio *fileio) retval = fileio_close_local(fileio); - free(fileio->url); + free((void*)fileio->url); fileio->url = NULL; return retval; diff --git a/src/helper/fileio.h b/src/helper/fileio.h index 8cba926a..6ed6fe45 100644 --- a/src/helper/fileio.h +++ b/src/helper/fileio.h @@ -47,8 +47,8 @@ enum fileio_access }; struct fileio { - char *url; - long long size; + const char *url; + ssize_t size; enum fileio_type type; enum fileio_access access; FILE *file; diff --git a/src/target/target.c b/src/target/target.c index c24085f1..f141e933 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2543,7 +2543,7 @@ COMMAND_HANDLER(handle_dump_image_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { command_print(cmd_ctx, - "dumped %lld bytes in %fs (%0.3f kb/s)", fileio.size, + "dumped %zu bytes in %fs (%0.3f kb/s)", fileio.size, duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); } |