diff --git a/include/hex2bin.h b/include/hex2bin.h index f976f607ee..a5b9eda35b 100644 --- a/include/hex2bin.h +++ b/include/hex2bin.h @@ -100,8 +100,8 @@ extern "C" struct lib_instream_s; struct lib_sostream_s; int hex2bin(FAR struct lib_instream_s *instream, - FAR struct lib_sostream_s *outstream, uint32_t baseaddr, - uint32_t endpaddr, enum hex2bin_swap_e swap); + FAR struct lib_sostream_s *outstream, unsigned long baseaddr, + unsigned long endpaddr, enum hex2bin_swap_e swap); /**************************************************************************** * Name: hex2mem @@ -127,7 +127,7 @@ int hex2bin(FAR struct lib_instream_s *instream, * ****************************************************************************/ -int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr, +int hex2mem(int fd, unsigned long baseaddr, unsigned long endpaddr, enum hex2bin_swap_e swap); /**************************************************************************** @@ -154,8 +154,8 @@ int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr, * ****************************************************************************/ -int fhex2mem(FAR FILE *instream, uint32_t baseaddr, uint32_t endpaddr, - enum hex2bin_swap_e swap); +int fhex2mem(FAR FILE *instream, unsigned long baseaddr, + unsigned long endpaddr, enum hex2bin_swap_e swap); #undef EXTERN #ifdef __cplusplus diff --git a/libs/libc/hex2bin/lib_fhex2mem.c b/libs/libc/hex2bin/lib_fhex2mem.c index 81713b96d1..c8191d485a 100644 --- a/libs/libc/hex2bin/lib_fhex2mem.c +++ b/libs/libc/hex2bin/lib_fhex2mem.c @@ -60,8 +60,8 @@ * ****************************************************************************/ -int fhex2mem(FAR FILE *instream, uint32_t baseaddr, uint32_t endpaddr, - enum hex2bin_swap_e swap) +int fhex2mem(FAR FILE *instream, unsigned long baseaddr, + unsigned long endpaddr, enum hex2bin_swap_e swap) { struct lib_stdinstream_s stdinstream; struct lib_memsostream_s memoutstream; @@ -81,7 +81,7 @@ int fhex2mem(FAR FILE *instream, uint32_t baseaddr, uint32_t endpaddr, /* And do the deed */ return hex2bin(&stdinstream.public, &memoutstream.public, - (uint32_t)baseaddr, (uint32_t)endpaddr, + (unsigned long)baseaddr, (unsigned long)endpaddr, (enum hex2bin_swap_e)swap); } diff --git a/libs/libc/hex2bin/lib_hex2bin.c b/libs/libc/hex2bin/lib_hex2bin.c index 9ddd7c722f..f9bd6bd2a0 100644 --- a/libs/libc/hex2bin/lib_hex2bin.c +++ b/libs/libc/hex2bin/lib_hex2bin.c @@ -378,18 +378,18 @@ static inline void writedata(FAR struct lib_sostream_s *outstream, ****************************************************************************/ int hex2bin(FAR struct lib_instream_s *instream, - FAR struct lib_sostream_s *outstream, uint32_t baseaddr, - uint32_t endpaddr, enum hex2bin_swap_e swap) + FAR struct lib_sostream_s *outstream, unsigned long baseaddr, + unsigned long endpaddr, enum hex2bin_swap_e swap) { FAR uint8_t *alloc; FAR uint8_t *line; FAR uint8_t *bin; int nbytes; int bytecount; - uint32_t address; - uint32_t endaddr; - uint32_t expected; - uint32_t extension; + unsigned long address; + unsigned long endaddr; + unsigned long expected; + unsigned long extension; uint16_t address16; uint8_t checksum; unsigned int lineno; @@ -546,7 +546,7 @@ int hex2bin(FAR struct lib_instream_s *instream, /* Get and verify the full 32-bit address */ - address = extension + (uint32_t)address16; + address = extension + (unsigned long)address16; endaddr = address + bytecount; if (address < baseaddr || (endpaddr != 0 && endaddr >= endpaddr)) @@ -621,7 +621,7 @@ int hex2bin(FAR struct lib_instream_s *instream, goto errout_with_einval; } - extension = (uint32_t)bin[DATA_BINNDX] << 12; + extension = (unsigned long)bin[DATA_BINNDX] << 12; break; case RECORD_START_SEGADDR: /* Start segment address record */ @@ -654,8 +654,8 @@ int hex2bin(FAR struct lib_instream_s *instream, goto errout_with_einval; } - extension = (uint32_t)bin[DATA_BINNDX] << 24 | - (uint32_t)bin[DATA_BINNDX + 1] << 16; + extension = (unsigned long)bin[DATA_BINNDX] << 24 | + (unsigned long)bin[DATA_BINNDX + 1] << 16; break; case RECORD_START_LINADDR: /* Start linear address record */ diff --git a/libs/libc/hex2bin/lib_hex2mem.c b/libs/libc/hex2bin/lib_hex2mem.c index 628ca5201e..5ca10b3494 100644 --- a/libs/libc/hex2bin/lib_hex2mem.c +++ b/libs/libc/hex2bin/lib_hex2mem.c @@ -60,7 +60,7 @@ * ****************************************************************************/ -int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr, +int hex2mem(int fd, unsigned long baseaddr, unsigned long endpaddr, enum hex2bin_swap_e swap) { struct lib_rawinstream_s rawinstream; @@ -81,7 +81,7 @@ int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr, /* And do the deed */ return hex2bin(&rawinstream.public, &memoutstream.public, - (uint32_t)baseaddr, (uint32_t)endpaddr, + (unsigned long)baseaddr, (unsigned long)endpaddr, (enum hex2bin_swap_e)swap); }