sector_t sector;
cluster_offset_t offset;
uint8_t *buf;
- cluster_t ret;
+ cluster_t ret = 0;
cluster_t old_value;
uint8_t fat;
DBG("current sector offset %d size %d\n",
file->offset, file->dirent->size);
- if (file->offset > file->dirent->size) {
+ if (file->offset > (offset_t) file->dirent->size) {
printf ("file offset %d larger than size %d\n",
file->offset, file->dirent->size);
return 0xffffffff;
DBG("\treset to start of file %08x\n", file->cluster);
}
- if (file->cluster_offset + bytes_per_cluster <= file->offset) {
+ if ((offset_t) (file->cluster_offset + bytes_per_cluster) <= file->offset) {
cluster_t cluster_distance;
cluster_offset = sector_offset / sectors_per_cluster;
if (!file->busy)
continue;
if (file->dirent == dirent) {
- if (file->cluster_offset >= dirent->size) {
+ if (file->cluster_offset >= (offset_t) dirent->size) {
file->cluster_offset = 0;
file->cluster = dirent->cluster;
}
DBG ("\tfirst cluster %08x have %d need %d\n", first_cluster, have_clusters, need_clusters);
if (have_clusters != need_clusters) {
- if (file->cluster && size > file->cluster_offset) {
+ if (file->cluster && (offset_t) size > file->cluster_offset) {
cluster_t offset_clusters = (file->cluster_offset + bytes_per_cluster) / bytes_per_cluster;
cluster_t extra_clusters = need_clusters - offset_clusters;
cluster_t next_cluster;
static void
_ao_fat_root_init(uint8_t *dent, char name[11], uint8_t attr)
{
+ (void) attr;
memset(dent, '\0', 0x20);
memmove(dent, name, 11);
goto done;
}
- if (file->offset + len > file->dirent->size)
+ if (file->offset + len > (offset_t) file->dirent->size)
len = file->dirent->size - file->offset;
if (len < 0)
goto done;
}
- if (file->offset + len > file->dirent->size) {
+ if (file->offset + len > (offset_t) file->dirent->size) {
ret = _ao_fat_set_size(file, file->offset + len);
if (ret < 0)
goto done;
int8_t
ao_fat_rename(char old[11], char new[11])
{
+ (void) old;
+ (void) new;
return -AO_FAT_EIO;
}
putchar('.');
for (; i < 11; i++)
putchar(dirent.name[i]);
- for (i = 0; i < NUM_FAT_ATTR; i++)
+ for (i = 0; i < (int) NUM_FAT_ATTR; i++)
putchar (dirent.attr & ao_fat_attr[i].bit ? ao_fat_attr[i].label : ' ');
printf (" @%08x %d\n", dirent.cluster, dirent.size);
}
printf ("readdir failed: %d\n", status);
}
-static uint8_t
+static void
ao_fat_parse_name(char name[11])
{
uint8_t c;
{
static char name[11];
int8_t fd;
- int cnt, i;
- static char buf[64];
char c;
int status;