From 2d0bc916c5779e2f3dc9e4775e235e0c633817cc Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 30 Oct 2007 15:52:00 +0000 Subject: [PATCH] Add kfile_off_t typedef, and use it. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@970 38d2e660-2303-0410-9eaa-f027e97ec537 --- cpu/avr/drv/flash_avr.c | 2 +- drv/dataflash.c | 2 +- kern/kfile.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpu/avr/drv/flash_avr.c b/cpu/avr/drv/flash_avr.c index aa46b4d2..8a4c1509 100644 --- a/cpu/avr/drv/flash_avr.c +++ b/cpu/avr/drv/flash_avr.c @@ -210,7 +210,7 @@ static bool flash_avr_close(UNUSED_ARG(struct _KFile *,fd)) * Move \a fd file seek position of \a offset bytes * from current position. */ -static int32_t flash_avr_seek(struct _KFile *fd, int32_t offset, KSeekMode whence) +static int32_t flash_avr_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence) { uint32_t seek_pos; diff --git a/drv/dataflash.c b/drv/dataflash.c index eab31658..fb00c4c7 100644 --- a/drv/dataflash.c +++ b/drv/dataflash.c @@ -363,7 +363,7 @@ static bool dataflash_close(UNUSED_ARG(struct _KFile *,fd)) * Move \a fd file seek position of \a offset bytes * from current position. */ -static int32_t dataflash_seek(struct _KFile *fd, int32_t offset, KSeekMode whence) +static int32_t dataflash_seek(struct _KFile *fd, kfile_off_t offset, KSeekMode whence) { uint32_t seek_pos; diff --git a/kern/kfile.h b/kern/kfile.h index 7f4e208b..e9d4a5c8 100644 --- a/kern/kfile.h +++ b/kern/kfile.h @@ -45,6 +45,8 @@ /* fwd decl */ struct _KFile; +typedef int32_t kfile_off_t; + /** * Costants for repositioning read/write file offset. * These are needed because on some embedded platforms @@ -60,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, int32_t offset, KSeekMode whence); +typedef int32_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); -- 2.25.1