#include "config.h"
#endif
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_ELF_H
-#include <elf.h>
-#endif
-
#include "image.h"
-
-#include "types.h"
-#include "replacements.h"
+#include "target.h"
#include "log.h"
-#include "fileio.h"
-#include "target.h"
/* convert ELF header field to host endianness */
#define field16(elf,field)\
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;
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;