STM32 FLASH fixes: use size_t instead of uint16_t, make interface more generic. From Freddie Chopin

This commit is contained in:
Gregory Nutt 2014-08-28 09:11:20 -06:00
parent 7fca1ae30c
commit b123f8f6bf
2 changed files with 12 additions and 12 deletions

View File

@ -51,9 +51,9 @@
static void free_getprogmeminfo(struct mallinfo * mem) static void free_getprogmeminfo(struct mallinfo * mem)
{ {
uint16_t page = 0, stpage = 0xFFFF; size_t page = 0, stpage = 0xFFFF;
uint16_t pagesize = 0; size_t pagesize = 0;
int status; ssize_t status;
mem->arena = 0; mem->arena = 0;
mem->fordblks = 0; mem->fordblks = 0;

View File

@ -87,11 +87,11 @@ static const char *install_script_exec =
static int install_getstartpage(int startpage, int pagemargin, int desiredsize) static int install_getstartpage(int startpage, int pagemargin, int desiredsize)
{ {
uint16_t page = 0, stpage = 0xffff; size_t page = 0, stpage = 0xffff;
uint16_t pagesize = 0; size_t pagesize = 0;
int maxlen = -1; int maxlen = -1;
int maxlen_start = 0xffff; int maxlen_start = 0xffff;
int status; ssize_t status;
for (status=0, page=0; status >= 0; page++) for (status=0, page=0; status >= 0; page++)
{ {
@ -148,11 +148,11 @@ static int install_getstartpage(int startpage, int pagemargin, int desiredsize)
static int install_programflash(int startaddr, const char *source) static int install_programflash(int startaddr, const char *source)
{ {
int status; ssize_t status;
int count; size_t count;
int totalsize = 0; ssize_t totalsize = 0;
char *buf; char *buf;
FILE *fp; FILE *fp;
if ((buf = malloc(INSTALL_PROGRAMBLOCKSIZE)) == NULL) if ((buf = malloc(INSTALL_PROGRAMBLOCKSIZE)) == NULL)
{ {
@ -265,7 +265,7 @@ static int install_remove(const char *scriptname)
{ {
FILE *fp; FILE *fp;
int progsize, addr, freedsize; int progsize, addr, freedsize;
uint16_t page; ssize_t page;
int status = 0; int status = 0;
/* Parse script */ /* Parse script */