diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 14:44:53 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-16 15:47:09 -0800 |
commit | 51862bb98c26e9b3f03d46ae0f8ceb434f0743d0 (patch) | |
tree | 78cb65e732581369d51937ca7ba1de670313f016 /src/flash/ecos.c | |
parent | 69df712d1d06b2c698bed3de086b9f734de73b7e (diff) | |
download | openocd+libswd-51862bb98c26e9b3f03d46ae0f8ceb434f0743d0.tar.gz openocd+libswd-51862bb98c26e9b3f03d46ae0f8ceb434f0743d0.tar.bz2 openocd+libswd-51862bb98c26e9b3f03d46ae0f8ceb434f0743d0.tar.xz openocd+libswd-51862bb98c26e9b3f03d46ae0f8ceb434f0743d0.zip |
fileio: improve API types
Use size_t instead of uint32_t when specifying file sizes. Update all
consumers up through the layers to use size_t when required. These
changes should be safe, but the higher-levels will need to be updated
further to receive the intended benefits (i.e. large file support).
Add error checking for fileio_read and file_write. Previously, all
errors were being silently ignored, so this change might cause some
problems for some people in some cases. However, it gives us the chance
to handle any errors that do occur at higher-levels, rather than burying
our heads in the sand.
Diffstat (limited to 'src/flash/ecos.c')
-rw-r--r-- | src/flash/ecos.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flash/ecos.c b/src/flash/ecos.c index c12ed9d2..b2ffadff 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -152,8 +152,8 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command) static int loadDriver(struct ecosflash_flash_bank *info) { - uint32_t buf_cnt; - uint32_t image_size; + size_t buf_cnt; + size_t image_size; struct image image; image.base_address_set = 0; @@ -182,7 +182,8 @@ static int loadDriver(struct ecosflash_flash_bank *info) } target_write_buffer(target, image.sections[i].base_address, buf_cnt, buffer); image_size += buf_cnt; - LOG_DEBUG("%" PRIu32 " byte written at address 0x%8.8" PRIx32 "", buf_cnt, image.sections[i].base_address); + LOG_DEBUG("%zu bytes written at address 0x%8.8" PRIx32 "", + buf_cnt, image.sections[i].base_address); free(buffer); } |