Various fixes to kfile_posix module.
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 8 Jun 2009 08:12:51 +0000 (08:12 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 8 Jun 2009 08:12:51 +0000 (08:12 +0000)
- Add header guards
- Fix style
- Add assert in case of wrong parameter

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2706 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/emul/kfile_posix.c
bertos/emul/kfile_posix.h

index 3fce00bcf2b46b54bde179d7c4f18b8ce6fd6d25..593571d4bfb8494c45540f35684d69a6052fde6d 100644 (file)
@@ -63,9 +63,10 @@ static kfile_off_t kfile_posix_seek(struct KFile *_fd, kfile_off_t offset, KSeek
                        std_whence = SEEK_END;
                        break;
                case KSM_SEEK_SET:
-                       /* fall */
-               default:
                        std_whence = SEEK_SET;
+                       break;
+               default:
+                       ASSERT(0);
        }
 
        return fseek(fd->fp, offset, std_whence);
@@ -83,7 +84,7 @@ static int kfile_posix_flush(struct KFile *_fd)
        return fflush(fd->fp);
 }
 
-FILEkfile_posix_init(KFilePosix *file, const char *filename, const char *mode)
+FILE *kfile_posix_init(KFilePosix *file, const char *filename, const char *mode)
 {
        file->fd._type = KFT_KFILEPOSIX;
        file->fd.read = kfile_posix_read;
index b55c048db72f30e31dc200c45bcedc60225441e3..ba88ab78ad6c50c014eb8bf15e0d93b866ca264e 100644 (file)
@@ -36,6 +36,9 @@
  * \author Luca Ottaviano <lottaviano@develer.com>
  */
 
+#ifndef KFILE_POSIX_H
+#define KFILE_POSIX_H
+
 #include <kern/kfile.h>
 #include <stdio.h>
 
@@ -54,3 +57,5 @@ INLINE KFilePosix *KFILEPOSIX_CAST(KFile *fd)
 }
 
 FILE *kfile_posix_init(KFilePosix *file, const char *filename, const char *mode);
+
+#endif /* KFILE_POSIX_H */