summaryrefslogtreecommitdiff
path: root/src/flash/lpc2900.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-13 14:44:53 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-16 15:47:09 -0800
commit51862bb98c26e9b3f03d46ae0f8ceb434f0743d0 (patch)
tree78cb65e732581369d51937ca7ba1de670313f016 /src/flash/lpc2900.c
parent69df712d1d06b2c698bed3de086b9f734de73b7e (diff)
downloadopenocd+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/lpc2900.c')
-rw-r--r--src/flash/lpc2900.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c
index b80079df..dc916689 100644
--- a/src/flash/lpc2900.c
+++ b/src/flash/lpc2900.c
@@ -631,7 +631,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
return ret;
}
- uint32_t nwritten;
+ size_t nwritten;
ret = fileio_write( &fileio, sizeof(customer),
(const uint8_t *)customer, &nwritten );
if( ret != ERROR_OK )
@@ -755,7 +755,7 @@ COMMAND_HANDLER(lpc2900_handle_write_custom_command)
/* Page 4 */
uint32_t offset = ISS_CUSTOMER_START1 % FLASH_PAGE_SIZE;
memset( page, 0xff, FLASH_PAGE_SIZE );
- uint32_t size_read;
+ size_t size_read;
retval = image_read_section( &image, 0, 0,
ISS_CUSTOMER_SIZE1, &page[offset], &size_read);
if( retval != ERROR_OK )