diff options
| author | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-02-27 20:44:26 +0000 |
|---|---|---|
| committer | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-02-27 20:44:26 +0000 |
| commit | a83214d16f58ce22f0b2b1ea43de857f8ecb7dde (patch) | |
| tree | 51892d6e94a2c3073acc0ff5b2b506ee738d1ea6 /firmware/drivers | |
| parent | 3d0ae46ac6b40307bd654c618708309470d47dc6 (diff) | |
| download | rockbox-a83214d16f58ce22f0b2b1ea43de857f8ecb7dde.zip rockbox-a83214d16f58ce22f0b2b1ea43de857f8ecb7dde.tar.gz rockbox-a83214d16f58ce22f0b2b1ea43de857f8ecb7dde.tar.bz2 rockbox-a83214d16f58ce22f0b2b1ea43de857f8ecb7dde.tar.xz | |
couple of fixes for 16 bits archs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6073 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/fat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 465adec..cf26654 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -1588,8 +1588,10 @@ static int parse_direntry(struct fat_direntry *de, const unsigned char *buf) de->wrtdate = BYTES2INT16(buf,FATDIR_WRTDATE); de->wrttime = BYTES2INT16(buf,FATDIR_WRTTIME); de->filesize = BYTES2INT32(buf,FATDIR_FILESIZE); - de->firstcluster = ((long)BYTES2INT16(buf,FATDIR_FSTCLUSLO)) | - ((long)BYTES2INT16(buf,FATDIR_FSTCLUSHI) << 16); + de->firstcluster = ((long)(unsigned)BYTES2INT16(buf,FATDIR_FSTCLUSLO)) | + ((long)(unsigned)BYTES2INT16(buf,FATDIR_FSTCLUSHI) << 16); + /* The double cast is to prevent a sign-extension to be done on CalmRISC16. + (the result of the shift is always considered signed) */ /* fix the name */ for (i=0; (i<8) && (buf[FATDIR_NAME+i] != ' '); i++) |