#include <cfg/debug.h>
#include <cfg/macros.h> /* MIN, MAX */
+#include <cfg/test.h>
#include <cpu/byteorder.h> /* cpu_to_xx */
#define LOG_LEVEL LOG_LVL_INFO
disk->free_page_start++;
}
}
- LOG_INFO("free_bytes:%d, free_page_start:%d\n", disk->free_bytes, disk->free_page_start);
+ LOG_INFO("free_bytes:%ld, free_page_start:%d\n", (long)disk->free_bytes, disk->free_page_start);
return true;
}
{
/* Invalid page, keep as free */
ASSERT(disk->page_array[curr_free_page] == PAGE_UNSET_SENTINEL);
- LOG_INFO("Page %d invalid, keeping as free\n", page);
+ //LOG_INFO("Page %d invalid, keeping as free\n", page);
disk->page_array[curr_free_page++] = page;
}
}
/* Fill unused space of first page with 0s */
uint8_t dummy = 0;
- pgaddr_t zero_bytes = MIN(fd->seek_pos - fd->size, disk->data_size - curr_hdr.fill);
+ pgaddr_t zero_bytes = MIN(fd->seek_pos - fd->size, (kfile_off_t)(disk->data_size - curr_hdr.fill));
while (zero_bytes--)
{
if (disk->bufferWrite(disk, curr_hdr.fill, &dummy, 1) != 1)
return total_read;
}
- size = MIN((kfile_off_t)size, MAX(fd->size - fd->seek_pos, 0));
+ size = MIN((kfile_off_t)size, MAX(fd->size - fd->seek_pos, (kfile_off_t)0));
while (size)
{
else if (hdr.fcs == fcs && hdr.inode < inode)
first = page + 1;
else
- *last = page - 1;
+ *last = page + 1;
}
LOG_INFO("Not found: last %d\n", *last);
return false;