Fix warnings and cleanup code.
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 1 Sep 2009 13:20:57 +0000 (13:20 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 1 Sep 2009 13:20:57 +0000 (13:20 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2842 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/fs/fat.c

index 1cee1ae8a8ddc6dc061a6ffbc3e19f1df02339ab..77590c56dcfb43b1a1316ed6854beb131f3477a0 100644 (file)
@@ -72,14 +72,12 @@ static kfile_off_t fatfile_seek(struct KFile *_fd, kfile_off_t offset, KSeekMode
         * don't clip at end-of-file when in write mode
         */
        FatFile *fd = FATFILE_CAST(_fd);
-       DWORD lseek_offset;
+       DWORD lseek_offset = 0;
        switch (whence)
        {
        case KSM_SEEK_SET:
                if (offset > 0)
                        lseek_offset = (DWORD) offset;
-               else
-                       lseek_offset = 0;
                break;
        case KSM_SEEK_CUR:
                if (offset > 0)
@@ -88,8 +86,6 @@ static kfile_off_t fatfile_seek(struct KFile *_fd, kfile_off_t offset, KSeekMode
                {
                        if (fd->fat_file.fptr > (DWORD) (-offset))
                                lseek_offset = fd->fat_file.fptr - (DWORD)(-offset);
-                       else
-                               lseek_offset = 0;
                }
                break;
        case KSM_SEEK_END:
@@ -99,8 +95,6 @@ static kfile_off_t fatfile_seek(struct KFile *_fd, kfile_off_t offset, KSeekMode
                {
                        if (fd->fat_file.fsize > (DWORD) (-offset))
                                lseek_offset = fd->fat_file.fsize + (DWORD) offset;
-                       else
-                               lseek_offset = 0;
                }
                break;
        }