X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fdataflash.c;h=f70628fb18cf52a1e6e9dc2f4ae6e5b677abb5d8;hb=a2fc2366ad564f11e705703ed1f42b7dc499a47c;hp=c8af42650e32890e6a04a45d4285ab22f0b5c6ec;hpb=a625fd2523a0c960351f124baa7cd5c3c69c3272;p=bertos.git diff --git a/bertos/drv/dataflash.c b/bertos/drv/dataflash.c index c8af4265..f70628fb 100644 --- a/bertos/drv/dataflash.c +++ b/bertos/drv/dataflash.c @@ -351,7 +351,7 @@ static size_t dataflash_read(struct KFile *_fd, void *buf, size_t size) uint8_t *data = (uint8_t *)buf; - ASSERT(fd->fd.seek_pos + size <= fd->fd.size); + 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); LOG_INFO("Reading at pos[%lu]\n", fd->fd.seek_pos); @@ -402,7 +402,7 @@ static size_t dataflash_write(struct KFile *_fd, const void *_buf, size_t size) const uint8_t *data = (const uint8_t *) _buf; - ASSERT(fd->fd.seek_pos + size <= fd->fd.size); + 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); LOG_INFO("Writing at pos[%lu]\n", fd->fd.seek_pos);