From 7762408d5c40b869a49ed3d511873aa8e9a14c4e Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sat, 15 Nov 2014 10:02:40 +0100 Subject: [PATCH] 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. --- pff.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pff.c b/pff.c index d7477d7..83798aa 100644 --- a/pff.c +++ b/pff.c @@ -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;