summaryrefslogtreecommitdiff
path: root/components/dfs/filesystems
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-12-30 19:38:20 -0500
committerBernard Xiong <[email protected]>2022-01-09 00:23:18 +0800
commitf89a162ea3be6536c340c0010aab41cffe9bfac9 (patch)
tree38c0c03a5c5ba348d9b657ad8e7ecb6f938ddf23 /components/dfs/filesystems
parentbb1084556ff9395e6e5d908edfef9cab6f6fa4dc (diff)
[core] 使用rt_memcpy rt_memset代替memcpy memset
Diffstat (limited to 'components/dfs/filesystems')
-rw-r--r--components/dfs/filesystems/elmfat/dfs_elm.c6
-rw-r--r--components/dfs/filesystems/ramfs/dfs_ramfs.c6
-rw-r--r--components/dfs/filesystems/romfs/dfs_romfs.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c
index b7cdaf8522..eb57034061 100644
--- a/components/dfs/filesystems/elmfat/dfs_elm.c
+++ b/components/dfs/filesystems/elmfat/dfs_elm.c
@@ -265,7 +265,7 @@ int dfs_elm_mkfs(rt_device_t dev_id)
/* [IN] Format options */
/* [-] Working buffer */
/* [IN] Size of working buffer */
- memset(&opt, 0, sizeof(opt));
+ rt_memset(&opt, 0, sizeof(opt));
opt.fmt = FM_ANY|FM_SFD;
result = f_mkfs(logic_nbr, &opt, work, FF_MAX_SS);
rt_free(work); work = RT_NULL;
@@ -792,7 +792,7 @@ int dfs_elm_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
tmp >>= 6;
hour = tmp & 0x1F; /* bit[15:11] Hour(0..23) */
- memset(&tm_file, 0, sizeof(tm_file));
+ rt_memset(&tm_file, 0, sizeof(tm_file));
tm_file.tm_year = year - 1900; /* Years since 1900 */
tm_file.tm_mon = mon - 1; /* Months *since* january: 0-11 */
tm_file.tm_mday = day; /* Day of the month: 1-31 */
@@ -957,7 +957,7 @@ DWORD get_fattime(void)
/* converts calendar time time into local time. */
p_tm = gmtime(&now);
/* copy the statically located variable */
- memcpy(&tm_now, p_tm, sizeof(struct tm));
+ rt_memcpy(&tm_now, p_tm, sizeof(struct tm));
/* unlock scheduler. */
rt_exit_critical();
diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.c b/components/dfs/filesystems/ramfs/dfs_ramfs.c
index cc58590de2..781626633f 100644
--- a/components/dfs/filesystems/ramfs/dfs_ramfs.c
+++ b/components/dfs/filesystems/ramfs/dfs_ramfs.c
@@ -106,7 +106,7 @@ int dfs_ramfs_read(struct dfs_fd *file, void *buf, size_t count)
length = file->size - file->pos;
if (length > 0)
- memcpy(buf, &(dirent->data[file->pos]), length);
+ rt_memcpy(buf, &(dirent->data[file->pos]), length);
/* update file current position */
file->pos += length;
@@ -143,7 +143,7 @@ int dfs_ramfs_write(struct dfs_fd *fd, const void *buf, size_t count)
}
if (count > 0)
- memcpy(dirent->data + fd->pos, buf, count);
+ rt_memcpy(dirent->data + fd->pos, buf, count);
/* update file current position */
fd->pos += count;
@@ -442,7 +442,7 @@ struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size)
ramfs->memheap.parent.type = RT_Object_Class_MemHeap | RT_Object_Class_Static;
/* initialize root directory */
- memset(&(ramfs->root), 0x00, sizeof(ramfs->root));
+ rt_memset(&(ramfs->root), 0x00, sizeof(ramfs->root));
rt_list_init(&(ramfs->root.list));
ramfs->root.size = 0;
strcpy(ramfs->root.name, ".");
diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c
index 2e9b08cbf6..9e355471a8 100644
--- a/components/dfs/filesystems/romfs/dfs_romfs.c
+++ b/components/dfs/filesystems/romfs/dfs_romfs.c
@@ -147,7 +147,7 @@ int dfs_romfs_read(struct dfs_fd *file, void *buf, size_t count)
length = file->size - file->pos;
if (length > 0)
- memcpy(buf, &(dirent->data[file->pos]), length);
+ rt_memcpy(buf, &(dirent->data[file->pos]), length);
/* update file current position */
file->pos += length;