diff options
| author | Bernard Xiong <[email protected]> | 2019-02-20 04:54:10 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-02-20 04:54:10 +0800 |
| commit | 745659c42b714c7b4c7b6de7acdbbcf26ba4fc5e (patch) | |
| tree | af662f13d4064fe9df4da8ab3202a453cd47dfe3 /components/dfs | |
| parent | 8ace8be30e014ed67887fcba893624400c8a1154 (diff) | |
| parent | c231565610fed352558c913ea0afd6faeca08824 (diff) | |
Merge pull request #2351 from armink/lts-v3.1.x
Sync from master (6a150c0963d4db931f71c5716c1811b672a19af3)
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/src/dfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 066c800568..6d52129b06 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -123,7 +123,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) int idx; /* find an empty fd entry */ - for (idx = startfd; idx < fdt->maxfd; idx++) + for (idx = startfd; idx < (int)fdt->maxfd; idx++) { if (fdt->fds[idx] == RT_NULL) break; @@ -155,7 +155,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) } /* allocate 'struct dfs_fd' */ - if (idx < fdt->maxfd &&fdt->fds[idx] == RT_NULL) + if (idx < (int)fdt->maxfd && fdt->fds[idx] == RT_NULL) { fdt->fds[idx] = rt_calloc(1, sizeof(struct dfs_fd)); if (fdt->fds[idx] == RT_NULL) @@ -223,7 +223,7 @@ struct dfs_fd *fd_get(int fd) fdt = dfs_fdtable_get(); fd = fd - DFS_FD_OFFSET; - if (fd < 0 || fd >= fdt->maxfd) + if (fd < 0 || fd >= (int)fdt->maxfd) return NULL; dfs_lock(); @@ -263,7 +263,7 @@ void fd_put(struct dfs_fd *fd) struct dfs_fdtable *fdt; fdt = dfs_fdtable_get(); - for (index = 0; index < fdt->maxfd; index ++) + for (index = 0; index < (int)fdt->maxfd; index ++) { if (fdt->fds[index] == fd) { @@ -531,7 +531,7 @@ int list_fd(void) rt_kprintf("fd type ref magic path\n"); rt_kprintf("-- ------ --- ----- ------\n"); - for (index = 0; index < fd_table->maxfd; index ++) + for (index = 0; index < (int)fd_table->maxfd; index ++) { struct dfs_fd *fd = fd_table->fds[index]; |
