freemyipod r369 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r368‎ | r369 | r370 >
Date:03:04, 21 December 2010
Author:theseven
Status:new
Tags:
Comment:
iLoader: Fix loading files from non-memmapped boot flashes. Why doesn't GCC at least warn here!?
Modified paths:
  • /apps/iloader/main.c (modified) (history)

Diff [purge]

Index: apps/iloader/main.c
@@ -165,7 +165,7 @@
166166 {
167167 if (bootflash_attributes("ildrcfg ") & 0x800)
168168 {
169 - if (bootflash_is_memmapped)
 169+ if (bootflash_is_memmapped())
170170 {
171171 if (!ucl_decompress(bootflash_getaddr("ildrcfg "), size, config, (uint32_t*)&size))
172172 goto configfound;
@@ -213,7 +213,7 @@
214214 if (size < 0) pc = errhandler;
215215 else if (bootflash_attributes(filename) & 0x800)
216216 {
217 - if (bootflash_is_memmapped)
 217+ if (bootflash_is_memmapped())
218218 {
219219 if (ucl_decompress(bootflash_getaddr(filename), size,
220220 (void*)config[pc + 1], (uint32_t*)&size))
@@ -220,9 +220,9 @@
221221 pc = errhandler;
222222 else pc += 3;
223223 }
224 - else if (bootflash_read(filename, (void*)(0x09e00000 - size), 0, size) == size)
 224+ else if (bootflash_read(filename, (void*)((0x09e00000 - size) & ~0xf), 0, size) == size)
225225 {
226 - if (ucl_decompress((void*)(0x09e00000 - size), size,
 226+ if (ucl_decompress((void*)((0x09e00000 - size) & ~0xf), size,
227227 (void*)config[pc + 1], (uint32_t*)&size))
228228 pc = errhandler;
229229 else pc += 3;