diff options
author | Marc Schink <openocd-dev@marcschink.de> | 2015-10-02 17:35:15 +0200 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2015-11-03 22:14:07 +0000 |
commit | 24d9f0cfa0ee84e927d84957cab22c6571fa3185 (patch) | |
tree | 6b3b46834c4537b93852662d68d8b5c209fe54a5 /src/flash/nor/tcl.c | |
parent | 0578e4c4f4fbaec3e833fec0c118cee4698ce7c6 (diff) | |
download | riscv-openocd-24d9f0cfa0ee84e927d84957cab22c6571fa3185.zip riscv-openocd-24d9f0cfa0ee84e927d84957cab22c6571fa3185.tar.gz riscv-openocd-24d9f0cfa0ee84e927d84957cab22c6571fa3185.tar.bz2 |
helper/fileio: Use size_t for file size.
Change-Id: Ie116b44ba15e8ae41ca9ed4a354a82b2c4a92233
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/2997
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/flash/nor/tcl.c')
-rw-r--r-- | src/flash/nor/tcl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 709d0c1..8a30e1c 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -573,7 +573,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if (fileio_open(&fileio, CMD_ARGV[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK) return ERROR_OK; - int filesize; + size_t filesize; retval = fileio_size(&fileio, &filesize); if (retval != ERROR_OK) { fileio_close(&fileio); @@ -599,9 +599,9 @@ COMMAND_HANDLER(handle_flash_write_bank_command) buffer = NULL; if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { - command_print(CMD_CTX, "wrote %ld bytes from file %s to flash bank %u" + command_print(CMD_CTX, "wrote %zu bytes from file %s to flash bank %u" " at offset 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)", - (long)filesize, CMD_ARGV[1], p->bank_number, offset, + filesize, CMD_ARGV[1], p->bank_number, offset, duration_elapsed(&bench), duration_kbps(&bench, filesize)); } @@ -676,7 +676,7 @@ COMMAND_HANDLER(handle_flash_verify_bank_command) uint8_t *buffer_file, *buffer_flash; struct fileio fileio; size_t read_cnt; - int filesize; + size_t filesize; int differ; if (CMD_ARGC != 3) @@ -719,7 +719,7 @@ COMMAND_HANDLER(handle_flash_verify_bank_command) return retval; } - if (read_cnt != (size_t) filesize) { + if (read_cnt != filesize) { LOG_ERROR("Short read"); free(buffer_file); return ERROR_FAIL; |