diff options
| author | dongly <[email protected]> | 2022-08-03 00:09:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-02 12:09:49 -0400 |
| commit | 3363586cbbf507937a6be74397f4ffd5c6966fe5 (patch) | |
| tree | 8eaac87aa11b72c93a96b128d5a15134f097e95d /components/dfs/src/dfs.c | |
| parent | 7882e42c614c24a1750cba4a3e2936b6bf68f42f (diff) | |
Fix some compilation warning (#5744)
* Fix some compilation warning
* 补充修正一些数据类型的使用错误
Co-authored-by: Meco Man <[email protected]>
Diffstat (limited to 'components/dfs/src/dfs.c')
| -rw-r--r-- | components/dfs/src/dfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 23cac5c9e9..5c542fdc9b 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2021, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -132,7 +132,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) } /* allocate a larger FD container */ - if (idx == fdt->maxfd && fdt->maxfd < DFS_FD_MAX) + if (idx == (int)fdt->maxfd && fdt->maxfd < DFS_FD_MAX) { int cnt, index; struct dfs_fd **fds; @@ -145,7 +145,7 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd) if (fds == NULL) goto __exit; /* return fdt->maxfd */ /* clean the new allocated fds */ - for (index = fdt->maxfd; index < cnt; index ++) + for (index = (int)fdt->maxfd; index < cnt; index ++) { fds[index] = NULL; } @@ -186,7 +186,7 @@ int fd_new(void) idx = fd_alloc(fdt, 0); /* can't find an empty fd entry */ - if (idx == fdt->maxfd) + if (idx == (int)fdt->maxfd) { idx = -(1 + DFS_FD_OFFSET); LOG_E("DFS fd new is failed! Could not found an empty fd entry."); |
