uint8_t *data = (uint8_t *)buf;
- ASSERT(fd->fd.seek_pos + size <= (kfile_size_t)fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ ASSERT(fd->fd.seek_pos + size <= (kfile_off_t)fd->fd.size);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
LOG_INFO("Reading at pos[%lu]\n", fd->fd.seek_pos);
const uint8_t *data = (const uint8_t *) _buf;
ASSERT(fd->fd.seek_pos + size <= (kfile_off_t)fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
LOG_INFO("Writing at pos[%lu]\n", fd->fd.seek_pos);
Flash25 *fd = FLASH25_CAST(_fd);
- ASSERT(fd->fd.seek_pos + (kfile_size_t)size <= fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ ASSERT(fd->fd.seek_pos + (kfile_off_t)size <= fd->fd.size);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
//kprintf("Reading at addr[%lu], size[%d]\n", fd->seek_pos, size);
CS_ENABLE();
Flash25 *fd = FLASH25_CAST(_fd);
- ASSERT(fd->fd.seek_pos + (kfile_size_t)size <= fd->fd.size);
+ ASSERT(fd->fd.seek_pos + (kfile_off_t)size <= fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
while (size)
{
pgaddr_t addr_offset;
pgaddr_t read_len;
- size = MIN((kfile_size_t)size, fd->size - fd->seek_pos);
+ size = MIN((kfile_off_t)size, fd->size - fd->seek_pos);
while (size)
{
struct KFile;
typedef int32_t kfile_off_t; ///< KFile offset type, used by kfile_seek().
-typedef uint32_t kfile_size_t; ///< KFile size type, used in struct KFile.
/**
* Costants for repositioning read/write file offset.
DB(id_t _type); ///< Used to keep track, at runtime, of the class type.
/* NOTE: these must _NOT_ be size_t on 16bit CPUs! */
- kfile_off_t seek_pos;
- kfile_size_t size; // FIXME: should be kfile_off_t
+ kfile_off_t seek_pos;
+ kfile_off_t size;
} KFile;
/**