SD card, pff.c: silence a warning.

Let the preprocessor decide wether this piece of code is compiled
at all. Previous behaviour was to compile it unconditionally and
rely on the optimizer to remove it after that. Trusting the
optimizer is fine, but only if the code is warning-free in all cases.
This commit is contained in:
Markus Hitter 2014-11-15 10:02:40 +01:00
parent 9de0c65460
commit 7762408d5c
1 changed files with 9 additions and 5 deletions

14
pff.c
View File

@ -433,14 +433,18 @@ CLUST get_clust (
BYTE* dir /* Pointer to directory entry */
)
{
FATFS *fs = FatFs;
CLUST clst = 0;
if (_FS_32ONLY || (_FS_FAT32 && fs->fs_type == FS_FAT32)) {
clst = LD_WORD(dir+DIR_FstClusHI);
clst <<= 16;
}
#if _FS_FAT32
#if ! _FS_32ONLY
if (FatFs->fs_type == FS_FAT32)
#endif
{
clst = LD_WORD(dir+DIR_FstClusHI);
clst <<= 16;
}
#endif
clst |= LD_WORD(dir+DIR_FstClusLO);
return clst;