diff options
| author | tyustli <[email protected]> | 2019-06-18 20:09:19 +0800 |
|---|---|---|
| committer | tyustli <[email protected]> | 2019-06-18 20:09:19 +0800 |
| commit | d8eb0cfc1e119b81290a460883f427a38d572617 (patch) | |
| tree | 9cf38a4283ea507e3349ecb8c449cb1da0fcc789 /components/dfs/src | |
| parent | 34059c40c42c53a541822834d8d9092c640f45b3 (diff) | |
fix kernel and framework no cast type error
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs.c | 6 | ||||
| -rw-r--r-- | components/dfs/src/dfs_file.c | 4 | ||||
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 4 | ||||
| -rw-r--r-- | components/dfs/src/poll.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 5bddb96930..32cbbf643b 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -141,7 +141,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) cnt = fdt->maxfd + 4; cnt = cnt > DFS_FD_MAX ? DFS_FD_MAX : cnt; - fds = rt_realloc(fdt->fds, cnt * sizeof(struct dfs_fd *)); + fds = (struct dfs_fd **)rt_realloc(fdt->fds, cnt * sizeof(struct dfs_fd *)); if (fds == NULL) goto __exit; /* return fdt->maxfd */ /* clean the new allocated fds */ @@ -157,7 +157,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) /* allocate 'struct dfs_fd' */ if (idx < (int)fdt->maxfd && fdt->fds[idx] == RT_NULL) { - fdt->fds[idx] = rt_calloc(1, sizeof(struct dfs_fd)); + fdt->fds[idx] = (struct dfs_fd *)rt_calloc(1, sizeof(struct dfs_fd)); if (fdt->fds[idx] == RT_NULL) idx = fdt->maxfd; } @@ -393,7 +393,7 @@ char *dfs_normalize_path(const char *directory, const char *filename) if (filename[0] != '/') /* it's a absolute path, use it directly */ { - fullpath = rt_malloc(strlen(directory) + strlen(filename) + 2); + fullpath = (char *)rt_malloc(strlen(directory) + strlen(filename) + 2); if (fullpath == NULL) return NULL; diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 65fd0c45e8..5f090a7f6b 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -600,7 +600,7 @@ static void copyfile(const char *src, const char *dst) rt_uint8_t *block_ptr; rt_int32_t read_bytes; - block_ptr = rt_malloc(BUF_SZ); + block_ptr = (rt_uint8_t *)rt_malloc(BUF_SZ); if (block_ptr == NULL) { rt_kprintf("out of memory\n"); @@ -715,7 +715,7 @@ static void copydir(const char *src, const char *dst) static const char *_get_path_lastname(const char *path) { char *ptr; - if ((ptr = strrchr(path, '/')) == NULL) + if ((ptr = (char *)strrchr(path, '/')) == NULL) return path; /* skip the '/' then return */ diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 6d643e2d4a..69fe56a84e 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -265,11 +265,11 @@ RTM_EXPORT(lseek); * * note: the old and new file name must be belong to a same file system. */ -int rename(const char *old, const char *new) +int rename(const char *old_file, const char *new_file) { int result; - result = dfs_file_rename(old, new); + result = dfs_file_rename(old_file, new_file); if (result < 0) { rt_set_errno(result); diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c index aee157eed5..473b1579d2 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/poll.c @@ -54,7 +54,7 @@ static void _poll_add(rt_wqueue_t *wq, rt_pollreq_t *req) struct rt_poll_table *pt; struct rt_poll_node *node; - node = rt_malloc(sizeof(struct rt_poll_node)); + node = (struct rt_poll_node *)rt_malloc(sizeof(struct rt_poll_node)); if (node == RT_NULL) return; |
