From 85c91a3b8e528a3016819f60f1303906b416692f Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Fri, 1 Oct 2004 19:45:51 +0000 Subject: 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 --- firmware/common/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/common/file.c b/firmware/common/file.c index c09a7fea6e..623e898257 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -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 */ sectors = count / SECTOR_SIZE; 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 ) { DEBUGF("Failed read/writing %d sectors\n",sectors); errno = EIO; @@ -526,7 +527,7 @@ static int readwrite(int fd, void* buf, int count, bool write) return nread ? nread : rc * 10 - 6; } } - memcpy( file->cache, buf + nread, count ); + memcpy( file->cache, (unsigned char*)buf + nread, count ); file->dirty = true; } else { @@ -538,7 +539,7 @@ static int readwrite(int fd, void* buf, int count, bool write) file->cacheoffset = -1; return nread ? nread : rc * 10 - 7; } - memcpy( buf + nread, file->cache, count ); + memcpy( (unsigned char*)buf + nread, file->cache, count ); } nread += count; -- cgit v1.2.3