summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-10-01 19:45:51 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-10-01 19:45:51 +0000
commit85c91a3b8e528a3016819f60f1303906b416692f (patch)
tree8947ac67a50d24f7ef17ec528f6233edaf790720
parentb0617f15c2db44152eb47852df8d5043305f425f (diff)
downloadrockbox-85c91a3b8e528a3016819f60f1303906b416692f.tar.gz
rockbox-85c91a3b8e528a3016819f60f1303906b416692f.zip
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
-rw-r--r--firmware/common/file.c7
1 files 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)
468 /* read/write whole sectors right into/from the supplied buffer */ 468 /* read/write whole sectors right into/from the supplied buffer */
469 sectors = count / SECTOR_SIZE; 469 sectors = count / SECTOR_SIZE;
470 if ( sectors ) { 470 if ( sectors ) {
471 int rc = fat_readwrite(&(file->fatfile), sectors, buf+nread, write ); 471 int rc = fat_readwrite(&(file->fatfile), sectors,
472 (unsigned char*)buf+nread, write );
472 if ( rc < 0 ) { 473 if ( rc < 0 ) {
473 DEBUGF("Failed read/writing %d sectors\n",sectors); 474 DEBUGF("Failed read/writing %d sectors\n",sectors);
474 errno = EIO; 475 errno = EIO;
@@ -526,7 +527,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
526 return nread ? nread : rc * 10 - 6; 527 return nread ? nread : rc * 10 - 6;
527 } 528 }
528 } 529 }
529 memcpy( file->cache, buf + nread, count ); 530 memcpy( file->cache, (unsigned char*)buf + nread, count );
530 file->dirty = true; 531 file->dirty = true;
531 } 532 }
532 else { 533 else {
@@ -538,7 +539,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
538 file->cacheoffset = -1; 539 file->cacheoffset = -1;
539 return nread ? nread : rc * 10 - 7; 540 return nread ? nread : rc * 10 - 7;
540 } 541 }
541 memcpy( buf + nread, file->cache, count ); 542 memcpy( (unsigned char*)buf + nread, file->cache, count );
542 } 543 }
543 544
544 nread += count; 545 nread += count;