mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 11:30:01 +08:00
Fix some compilation warning (#5744)
* Fix some compilation warning * 补充修正一些数据类型的使用错误 Co-authored-by: Meco Man <920369182@qq.com>
This commit is contained in:
@@ -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
|
||||
*
|
||||
@@ -28,9 +28,9 @@
|
||||
#include <rtdbg.h>
|
||||
|
||||
/* The list of network interface device */
|
||||
struct netdev *netdev_list;
|
||||
struct netdev *netdev_list = RT_NULL;
|
||||
/* The default network interface device */
|
||||
struct netdev *netdev_default;
|
||||
struct netdev *netdev_default = RT_NULL;
|
||||
|
||||
/**
|
||||
* This function will register network interface device and
|
||||
@@ -46,8 +46,8 @@ struct netdev *netdev_default;
|
||||
int netdev_register(struct netdev *netdev, const char *name, void *user_data)
|
||||
{
|
||||
rt_base_t level;
|
||||
uint16_t flags_mask;
|
||||
int index;
|
||||
rt_uint16_t flags_mask;
|
||||
rt_uint16_t index;
|
||||
|
||||
RT_ASSERT(netdev);
|
||||
RT_ASSERT(name);
|
||||
@@ -706,7 +706,7 @@ void netdev_low_level_set_gw(struct netdev *netdev, const ip_addr_t *gw)
|
||||
*/
|
||||
void netdev_low_level_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_t *dns_server)
|
||||
{
|
||||
int index;
|
||||
unsigned int index;
|
||||
|
||||
RT_ASSERT(dns_server);
|
||||
|
||||
@@ -1173,7 +1173,7 @@ MSH_CMD_EXPORT_ALIAS(netdev_ping, ping, ping network host);
|
||||
|
||||
static void netdev_list_dns(void)
|
||||
{
|
||||
int index = 0;
|
||||
unsigned int index = 0;
|
||||
struct netdev *netdev = RT_NULL;
|
||||
rt_slist_t *node = RT_NULL;
|
||||
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -158,7 +158,8 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
|
||||
#define SAL_INTERNET_MONTH_LEN 4
|
||||
#define SAL_INTERNET_DATE_LEN 16
|
||||
|
||||
int index, sockfd = -1, result = 0;
|
||||
unsigned int index;
|
||||
int sockfd = -1, result = 0;
|
||||
struct sockaddr_in server_addr;
|
||||
struct hostent *host;
|
||||
struct timeval timeout;
|
||||
@@ -168,7 +169,7 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
|
||||
|
||||
const char month[][SAL_INTERNET_MONTH_LEN] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
char date[SAL_INTERNET_DATE_LEN];
|
||||
int moth_num = 0;
|
||||
unsigned int moth_num = 0;
|
||||
|
||||
struct sal_proto_family *pf = (struct sal_proto_family *) netdev->sal_user_data;
|
||||
const struct sal_socket_ops *skt_ops;
|
||||
|
||||
Reference in New Issue
Block a user