From fa124f37881e756abeca4188a33768c3fd539bfc Mon Sep 17 00:00:00 2001 From: chenwei Date: Wed, 23 Jun 2021 17:27:44 +0800 Subject: [PATCH] fix: romfs compile error 1, remove FAR 2, remove debug.h 3, add include vnode.h, fs.h, file.h close: #I3XGHA Signed-off-by: chenwei --- fs/romfs/fs_romfs.c | 1 - fs/romfs/fs_romfs.h | 44 +++++++++++++++++++++-------------------- fs/romfs/fs_romfsutil.c | 7 +++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 13c03c2..fae77ef 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -53,7 +53,6 @@ #include #include #include -#include #include "fs_romfs.h" diff --git a/fs/romfs/fs_romfs.h b/fs/romfs/fs_romfs.h index 6f8102a..67289b0 100644 --- a/fs/romfs/fs_romfs.h +++ b/fs/romfs/fs_romfs.h @@ -45,9 +45,11 @@ #include #include -#include - +#include "fs/dirent_fs.h" +#include "fs/fs.h" +#include "fs/file.h" #include "disk.h" +#include "vnode.h" /**************************************************************************** * Pre-processor Definitions @@ -157,7 +159,7 @@ struct romfs_mountpt_s struct romfs_file_s { - FAR struct romfs_file_s *rf_next; /* Retained in a singly linked list */ + struct romfs_file_s *rf_next; /* Retained in a singly linked list */ uint32_t rf_startoffset; /* Offset to the start of the file data */ uint32_t rf_size; /* Size of the file in bytes */ uint32_t rf_cachesector; /* Current sector in the rf_buffer */ @@ -206,25 +208,25 @@ extern "C" * Public Function Prototypes ****************************************************************************/ -void romfs_semtake(FAR struct romfs_mountpt_s *rm); -void romfs_semgive(FAR struct romfs_mountpt_s *rm); -int romfs_hwread(FAR struct romfs_mountpt_s *rm, FAR uint8_t *buffer, +void romfs_semtake(struct romfs_mountpt_s *rm); +void romfs_semgive(struct romfs_mountpt_s *rm); +int romfs_hwread(struct romfs_mountpt_s *rm, uint8_t *buffer, uint32_t sector, unsigned int nsectors); -int romfs_filecacheread(FAR struct romfs_mountpt_s *rm, - FAR struct romfs_file_s *rf, uint32_t sector); -int romfs_hwconfigure(FAR struct romfs_mountpt_s *rm); -int romfs_fsconfigure(FAR struct romfs_mountpt_s *rm); -int romfs_checkmount(FAR struct romfs_mountpt_s *rm); -int romfs_finddirentry(FAR struct romfs_mountpt_s *rm, - FAR struct romfs_dirinfo_s *dirinfo, - FAR const char *path); -int romfs_parsedirentry(FAR struct romfs_mountpt_s *rm, - uint32_t offset, FAR uint32_t *poffset, FAR uint32_t *pnext, - FAR uint32_t *pinfo, FAR uint32_t *psize); -int romfs_parsefilename(FAR struct romfs_mountpt_s *rm, uint32_t offset, - FAR char *pname); -int romfs_datastart(FAR struct romfs_mountpt_s *rm, uint32_t offset, - FAR uint32_t *start); +int romfs_filecacheread(struct romfs_mountpt_s *rm, + struct romfs_file_s *rf, uint32_t sector); +int romfs_hwconfigure(struct romfs_mountpt_s *rm); +int romfs_fsconfigure(struct romfs_mountpt_s *rm); +int romfs_checkmount(struct romfs_mountpt_s *rm); +int romfs_finddirentry(struct romfs_mountpt_s *rm, + struct romfs_dirinfo_s *dirinfo, + const char *path); +int romfs_parsedirentry(struct romfs_mountpt_s *rm, + uint32_t offset, uint32_t *poffset, uint32_t *pnext, + uint32_t *pinfo, uint32_t *psize); +int romfs_parsefilename(struct romfs_mountpt_s *rm, uint32_t offset, + char *pname); +int romfs_datastart(struct romfs_mountpt_s *rm, uint32_t offset, + uint32_t *start); int romfs_searchdir(struct romfs_mountpt_s *rm, const char *entryname, int entrylen, uint32_t firstoffset, struct romfs_dirinfo_s *dirinfo); diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index 3f61e6c..66fa1e2 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -48,7 +48,6 @@ #include #include #include -#include #ifdef LOSCFG_FS_ROMFS #include "fs_romfs.h" @@ -400,7 +399,7 @@ int romfs_fsconfigure(struct romfs_mountpt_s *rm) /* The root directory entry begins right after the header */ - name = (FAR const char *)&rm->rm_buffer[ROMFS_VHDR_VOLNAME]; + name = (const char *)&rm->rm_buffer[ROMFS_VHDR_VOLNAME]; rm->rm_rootoffset = ROMFS_ALIGNUP(ROMFS_VHDR_VOLNAME + strlen(name) + 1); /* and return success */ @@ -523,7 +522,7 @@ int romfs_parsefilename(struct romfs_mountpt_s *rm, uint32_t offset, { /* Yes.. then this chunk is less than 16 */ - chunklen = strlen((FAR char *)&rm->rm_buffer[ndx]); + chunklen = strlen((char *)&rm->rm_buffer[ndx]); done = true; } else @@ -612,4 +611,4 @@ int romfs_datastart(struct romfs_mountpt_s *rm, uint32_t offset, return -EINVAL; /* Won't get here */ } -#endif \ No newline at end of file +#endif -- GitLab