From 0f914bad679a4461e3628fa24dbea1d29c064f74 Mon Sep 17 00:00:00 2001 From: asterix Date: Thu, 29 Nov 2007 17:19:57 +0000 Subject: [PATCH] Use kfile_off_t instead int32_t. Fix comment. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1019 38d2e660-2303-0410-9eaa-f027e97ec537 --- kern/kfile.c | 7 +------ kern/kfile.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/kern/kfile.c b/kern/kfile.c index ba785101..92627493 100644 --- a/kern/kfile.c +++ b/kern/kfile.c @@ -53,7 +53,7 @@ * This is a generic implementation of seek function, you should redefine * it in your local module. */ -int32_t kfile_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence) +kfile_off_t kfile_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence) { uint32_t seek_pos; @@ -133,11 +133,6 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t _size) * on \p fd handler. If you want not overwrite exist data * you should pass an \p save_buf where test store exist data, * otherwise su must pass NULL. - * - * \note some device (like flash memeory) not allow write on - * existing data, and so this test use ASSERT macro to warn you if - * you are writing on same fd.seek_pos. - * */ bool kfile_test(uint8_t *test_buf, size_t _size , uint8_t *save_buf, size_t save_buf_size) { diff --git a/kern/kfile.h b/kern/kfile.h index 44832da3..3bb0d09f 100644 --- a/kern/kfile.h +++ b/kern/kfile.h @@ -62,7 +62,7 @@ typedef enum KSeekMode typedef size_t (*ReadFunc_t) (struct _KFile *fd, void *buf, size_t size); typedef size_t (*WriteFunc_t) (struct _KFile *fd, const void *buf, size_t size); -typedef int32_t (*SeekFunc_t) (struct _KFile *fd, kfile_off_t offset, KSeekMode whence); +typedef kfile_off_t (*SeekFunc_t) (struct _KFile *fd, kfile_off_t offset, KSeekMode whence); typedef bool (*OpenFunc_t) (struct _KFile *fd, const char *name, int mode); typedef bool (*CloseFunc_t) (struct _KFile *fd); @@ -87,7 +87,7 @@ typedef struct _KFile /* * Generic implementation of seek function. */ -int32_t kfile_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence); +kfile_off_t kfile_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence); /* * Kfile test function -- 2.25.1