From: lottaviano Date: Mon, 8 Jun 2009 08:12:51 +0000 (+0000) Subject: Various fixes to kfile_posix module. X-Git-Tag: 2.2.0~262 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=33ecbdb14c46beec78b84ae652b7956f3319397e;p=bertos.git Various fixes to kfile_posix module. - 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 --- diff --git a/bertos/emul/kfile_posix.c b/bertos/emul/kfile_posix.c index 3fce00bc..593571d4 100644 --- a/bertos/emul/kfile_posix.c +++ b/bertos/emul/kfile_posix.c @@ -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); } -FILE* kfile_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; diff --git a/bertos/emul/kfile_posix.h b/bertos/emul/kfile_posix.h index b55c048d..ba88ab78 100644 --- a/bertos/emul/kfile_posix.h +++ b/bertos/emul/kfile_posix.h @@ -36,6 +36,9 @@ * \author Luca Ottaviano */ +#ifndef KFILE_POSIX_H +#define KFILE_POSIX_H + #include #include @@ -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 */