summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorTangyuxin <[email protected]>2022-06-08 01:21:50 +0800
committerGitHub <[email protected]>2022-06-08 01:21:50 +0800
commitf5c88add371d3f73b1441958638c2f2b033d42cb (patch)
tree7f11efdffcae24554d3a73715d08bc1201705a8b /components
parent2d62a95339c1a854d50132b0d58ac403597ec069 (diff)
Fix compiler warnings (#6023)
Diffstat (limited to 'components')
-rw-r--r--components/drivers/hwcrypto/hw_bignum.c6
-rw-r--r--components/libc/posix/io/poll/poll.c2
-rw-r--r--components/net/netdev/src/netdev.c3
-rw-r--r--components/net/sal/src/sal_socket.c3
4 files changed, 8 insertions, 6 deletions
diff --git a/components/drivers/hwcrypto/hw_bignum.c b/components/drivers/hwcrypto/hw_bignum.c
index bc729ebf36..1d756d737d 100644
--- a/components/drivers/hwcrypto/hw_bignum.c
+++ b/components/drivers/hwcrypto/hw_bignum.c
@@ -129,7 +129,7 @@ int rt_hwcrypto_bignum_export_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int
return 0;
}
rt_memset(buf, 0, len);
- cp_len = n->total > len ? len : n->total;
+ cp_len = (int)n->total > len ? len : (int)n->total;
for(i = cp_len, j = 0; i > 0; i--, j++)
{
buf[i - 1] = n->p[j];
@@ -156,7 +156,7 @@ int rt_hwcrypto_bignum_import_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int
{
return 0;
}
- if (n->total < len)
+ if ((int)n->total < len)
{
temp_p = rt_malloc(len);
if (temp_p == RT_NULL)
@@ -170,7 +170,7 @@ int rt_hwcrypto_bignum_import_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int
n->sign = 1;
rt_memset(n->p, 0, n->total);
- cp_len = n->total > len ? len : n->total;
+ cp_len = (int)n->total > len ? len : n->total;
for(i = cp_len, j = 0; i > 0; i--, j++)
{
diff --git a/components/libc/posix/io/poll/poll.c b/components/libc/posix/io/poll/poll.c
index ba2442c0d5..5067817449 100644
--- a/components/libc/posix/io/poll/poll.c
+++ b/components/libc/posix/io/poll/poll.c
@@ -154,7 +154,7 @@ static int poll_do(struct pollfd *fds, nfds_t nfds, struct rt_poll_table *pt, in
{
int num;
int istimeout = 0;
- int n;
+ nfds_t n;
struct pollfd *pf;
int ret = 0;
diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c
index 2a87e91cb0..1009ace8d6 100644
--- a/components/net/netdev/src/netdev.c
+++ b/components/net/netdev/src/netdev.c
@@ -1066,7 +1066,8 @@ int netdev_cmd_ping(char* target_name, char *netdev_name, rt_uint32_t times, rt_
struct netdev *netdev = RT_NULL;
struct netdev_ping_resp ping_resp;
- int index, ret = 0;
+ rt_uint32_t index;
+ int ret = 0;
if (size == 0)
{
diff --git a/components/net/sal/src/sal_socket.c b/components/net/sal/src/sal_socket.c
index 2ed8e69e79..7e00ebf9bf 100644
--- a/components/net/sal/src/sal_socket.c
+++ b/components/net/sal/src/sal_socket.c
@@ -376,7 +376,8 @@ static void sal_unlock(void)
*/
int sal_netdev_cleanup(struct netdev *netdev)
{
- int idx = 0, find_dev;
+ uint32_t idx = 0;
+ int find_dev;
do
{