diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-06 23:28:38 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-06 23:28:38 +0000 |
commit | 5f45a3d1df6023da23b5438871e5e457777da75b (patch) | |
tree | 9fa0381c11d05d42b21c8f7a879b4969da47b7a9 /src/target | |
parent | 41638e0a09909340532ee1549fe020a703ca84f0 (diff) | |
download | openocd_libswd-5f45a3d1df6023da23b5438871e5e457777da75b.tar.gz openocd_libswd-5f45a3d1df6023da23b5438871e5e457777da75b.tar.bz2 openocd_libswd-5f45a3d1df6023da23b5438871e5e457777da75b.tar.xz openocd_libswd-5f45a3d1df6023da23b5438871e5e457777da75b.zip |
Fix pointer cast alignment warnings in target/image.c.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1624 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/image.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/target/image.c b/src/target/image.c index 2b6d0d11..8a166d68 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -217,7 +217,9 @@ static int image_ihex_buffer_complete(image_t *image) while (count-- > 0) { - sscanf(&lpszLine[bytes_read], "%2x", (u32*)&ihex->buffer[cooked_bytes]); + unsigned value; + sscanf(&lpszLine[bytes_read], "%2x", &value); + ihex->buffer[cooked_bytes] = (u8)value; cal_checksum += (u8)ihex->buffer[cooked_bytes]; bytes_read += 2; cooked_bytes += 1; @@ -594,7 +596,9 @@ static int image_mot_buffer_complete(image_t *image) while (count-- > 0) { - sscanf(&lpszLine[bytes_read], "%2x", (u32*)&mot->buffer[cooked_bytes]); + unsigned value; + sscanf(&lpszLine[bytes_read], "%2x", &value); + mot->buffer[cooked_bytes] = (u8)value; cal_checksum += (u8)mot->buffer[cooked_bytes]; bytes_read += 2; cooked_bytes += 1; |