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>
This commit is contained in:
committed by
Freddie Chopin
parent
0578e4c4f4
commit
24d9f0cfa0
@@ -1788,7 +1788,7 @@ COMMAND_HANDLER(handle_etm_load_command)
|
||||
if (fileio_open(&file, CMD_ARGV[0], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
int filesize;
|
||||
size_t filesize;
|
||||
int retval = fileio_size(&file, &filesize);
|
||||
if (retval != ERROR_OK) {
|
||||
fileio_close(&file);
|
||||
|
||||
@@ -130,7 +130,7 @@ static int image_ihex_buffer_complete_inner(struct image *image,
|
||||
/* we can't determine the number of sections that we'll have to create ahead of time,
|
||||
* so we locally hold them until parsing is finished */
|
||||
|
||||
int filesize;
|
||||
size_t filesize;
|
||||
int retval;
|
||||
retval = fileio_size(fileio, &filesize);
|
||||
if (retval != ERROR_OK)
|
||||
@@ -520,7 +520,7 @@ static int image_mot_buffer_complete_inner(struct image *image,
|
||||
* so we locally hold them until parsing is finished */
|
||||
|
||||
int retval;
|
||||
int filesize;
|
||||
size_t filesize;
|
||||
retval = fileio_size(fileio, &filesize);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
@@ -707,7 +707,7 @@ int image_open(struct image *image, const char *url, const char *type_string)
|
||||
retval = fileio_open(&image_binary->fileio, url, FILEIO_READ, FILEIO_BINARY);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
int filesize;
|
||||
size_t filesize;
|
||||
retval = fileio_size(&image_binary->fileio, &filesize);
|
||||
if (retval != ERROR_OK) {
|
||||
fileio_close(&image_binary->fileio);
|
||||
|
||||
@@ -3263,12 +3263,12 @@ COMMAND_HANDLER(handle_dump_image_command)
|
||||
free(buffer);
|
||||
|
||||
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) {
|
||||
int filesize;
|
||||
size_t filesize;
|
||||
retval = fileio_size(&fileio, &filesize);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
command_print(CMD_CTX,
|
||||
"dumped %ld bytes in %fs (%0.3f KiB/s)", (long)filesize,
|
||||
"dumped %zu bytes in %fs (%0.3f KiB/s)", filesize,
|
||||
duration_elapsed(&bench), duration_kbps(&bench, filesize));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user