forked from len0rd/rockbox
void* can't be offset, gcc should not allows this
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5147 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b0617f15c2
commit
85c91a3b8e
1 changed files with 4 additions and 3 deletions
|
|
@ -468,7 +468,8 @@ static int readwrite(int fd, void* buf, int count, bool write)
|
||||||
/* read/write whole sectors right into/from the supplied buffer */
|
/* read/write whole sectors right into/from the supplied buffer */
|
||||||
sectors = count / SECTOR_SIZE;
|
sectors = count / SECTOR_SIZE;
|
||||||
if ( sectors ) {
|
if ( sectors ) {
|
||||||
int rc = fat_readwrite(&(file->fatfile), sectors, buf+nread, write );
|
int rc = fat_readwrite(&(file->fatfile), sectors,
|
||||||
|
(unsigned char*)buf+nread, write );
|
||||||
if ( rc < 0 ) {
|
if ( rc < 0 ) {
|
||||||
DEBUGF("Failed read/writing %d sectors\n",sectors);
|
DEBUGF("Failed read/writing %d sectors\n",sectors);
|
||||||
errno = EIO;
|
errno = EIO;
|
||||||
|
|
@ -526,7 +527,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
|
||||||
return nread ? nread : rc * 10 - 6;
|
return nread ? nread : rc * 10 - 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy( file->cache, buf + nread, count );
|
memcpy( file->cache, (unsigned char*)buf + nread, count );
|
||||||
file->dirty = true;
|
file->dirty = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -538,7 +539,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
|
||||||
file->cacheoffset = -1;
|
file->cacheoffset = -1;
|
||||||
return nread ? nread : rc * 10 - 7;
|
return nread ? nread : rc * 10 - 7;
|
||||||
}
|
}
|
||||||
memcpy( buf + nread, file->cache, count );
|
memcpy( (unsigned char*)buf + nread, file->cache, count );
|
||||||
}
|
}
|
||||||
|
|
||||||
nread += count;
|
nread += count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue