Explorar o código

fix:network 库编译警告

Dozingfiretruck hai 7 meses
pai
achega
6a6d0dd80e

+ 5 - 5
components/network/adapter_lwip2/net_lwip2.c

@@ -964,10 +964,10 @@ static void platform_send_event(void *p, uint32_t id, uint32_t param1, uint32_t
 
 static void net_lwip2_check_network_ready(uint8_t adapter_index)
 {
-	luat_ip_addr_t addr = {0};
+	// luat_ip_addr_t addr = {0};
 	dns_client_t *dns_client = prvlwip.dns_client[adapter_index];
 	dhcp_client_info_t* dhcpc = prvlwip.dhcpc[adapter_index];
-	char ip_string[64] = {0};
+	// char ip_string[64] = {0};
 	if (prvlwip.lwip_netif[adapter_index] == NULL)
 		return;
 	uint8_t active_flag = !ip_addr_isany(&prvlwip.lwip_netif[adapter_index]->ip_addr)
@@ -986,8 +986,8 @@ static void net_lwip2_check_network_ready(uint8_t adapter_index)
 	else
 	{
 		NET_DBG("network ready %d", adapter_index);
-		uint32_t tmp = adapter_index;
-		luat_ip_addr_t addr = {0};
+		// uint32_t tmp = adapter_index;
+		// luat_ip_addr_t addr = {0};
 		uint8_t dns0_set = 0;
 		uint8_t dns1_set = 0;
 		// LLOGD("开始设置DNS服务器 %d static? %d %d %d %d", adapter_index, dns_client->is_static_dns[0], dns_client->is_static_dns[1], prvlwip.dhcpc[adapter_index] ? prvlwip.dhcpc[adapter_index]->dns_server[0] : 0, prvlwip.dhcpc[adapter_index] ? prvlwip.dhcpc[adapter_index]->dns_server[1] : 0);
@@ -1150,7 +1150,7 @@ static void net_lwip2_create_socket_now(uint8_t adapter_index, uint8_t socket_id
 
 static int net_lwip2_create_socket(uint8_t is_tcp, uint64_t *tag, void *param, uint8_t is_ipv6, void *user_data)
 {
-	uint8_t index = (uint32_t)user_data;
+	// uint8_t index = (uint32_t)user_data;
 	uint8_t adapter_index = (uint32_t)user_data;
 	if ((uint32_t)adapter_index >= NW_ADAPTER_INDEX_LWIP_NETIF_QTY) return 0;
 	int i, socket_id;

+ 1 - 1
components/network/httpsrv/src/luat_lib_httpsrv.c

@@ -63,7 +63,7 @@ end)
 -- 当前默认查找 /luadb/xxx 下的文件,暂不可配置
 */
 static int l_httpsrv_start(lua_State *L) {
-    luat_ip_addr_t local_ip, net_mask, gate_way, ipv6;
+    // luat_ip_addr_t local_ip, net_mask, gate_way, ipv6;
     char buff[64] = {0};
     int port = luaL_checkinteger(L, 1);
     if (!lua_isfunction(L, 2)) {

+ 4 - 4
components/network/netdrv/src/luat_netdrv_napt.c

@@ -366,7 +366,7 @@ __USER_FUNC_IN_RAM__ static void update_tcp_stat_inet(struct tcp_hdr *tcphdr, lu
 __USER_FUNC_IN_RAM__ int luat_netdrv_napt_tcp_wan2lan(napt_ctx_t* ctx, luat_netdrv_napt_tcpudp_t* mapping, luat_netdrv_napt_ctx_t *napt_ctx) {
     int ret = -1;
     uint16_t iphdr_len = (ctx->iphdr->_v_hl & 0x0F) * 4;
-    struct ip_hdr* ip_hdr = ctx->iphdr;
+    // struct ip_hdr* ip_hdr = ctx->iphdr;
     uint64_t tnow = luat_mcu_tick64_ms();
     uint32_t tsec = (uint32_t)(tnow / 1000);
     luat_netdrv_napt_tcpudp_t tmp = {0};
@@ -392,7 +392,7 @@ __USER_FUNC_IN_RAM__ int luat_netdrv_napt_tcp_wan2lan(napt_ctx_t* ctx, luat_netd
         napt_ctx->clean_tm = tsec;
         // LLOGD("完成映射关系清理 %ld %ld", tsec, napt_ctx->clean_tm);
     }
-    size_t c_all = 0;
+    // size_t c_all = 0;
     for (size_t i = 0; i < napt_ctx->item_last; i++) {
         it = &napt_ctx->items[i];
         // 远程ip(4 byte), 远程端口(2 byte), 本地映射端口(2 byte)
@@ -415,11 +415,11 @@ __USER_FUNC_IN_RAM__ int luat_netdrv_napt_tcp_lan2wan(napt_ctx_t* ctx, luat_netd
     int ret = -1;
     luat_netdrv_napt_tcpudp_t* it = NULL;
     uint16_t iphdr_len = (ctx->iphdr->_v_hl & 0x0F) * 4;
-    struct ip_hdr* ip_hdr = ctx->iphdr;
+    // struct ip_hdr* ip_hdr = ctx->iphdr;
     uint64_t tnow = luat_mcu_tick64_ms();
     uint32_t tsec = (uint32_t)(tnow / 1000);
     luat_netdrv_napt_tcpudp_t tmp = {0};
-    size_t tmpaddr = 0;
+    // size_t tmpaddr = 0;
     struct tcp_hdr *tcp_hdr = (struct tcp_hdr*)(((uint8_t*)ctx->iphdr) + iphdr_len);
     struct udp_hdr *udp_hdr = (struct udp_hdr*)(((uint8_t*)ctx->iphdr) + iphdr_len);
     size_t c_all = 0;

+ 2 - 2
components/network/netdrv/src/luat_netdrv_napt_tcp.c

@@ -31,7 +31,7 @@ __USER_FUNC_IN_RAM__ int luat_napt_tcp_handle(napt_ctx_t* ctx) {
     struct ip_hdr* ip_hdr = ctx->iphdr;
     struct tcp_hdr *tcp_hdr = (struct tcp_hdr*)(((uint8_t*)ctx->iphdr) + iphdr_len);
     luat_netdrv_t* gw = ctx->drv_gw;
-    luat_netdrv_napt_tcpudp_t* it = NULL;
+    // luat_netdrv_napt_tcpudp_t* it = NULL;
     luat_netdrv_napt_tcpudp_t* it_map = NULL;
     int ret = 0;
     if (gw == NULL || gw->netif == NULL) {
@@ -40,7 +40,7 @@ __USER_FUNC_IN_RAM__ int luat_napt_tcp_handle(napt_ctx_t* ctx) {
     if (tcp_buff == NULL) {
         tcp_buff = luat_heap_opt_zalloc(LUAT_HEAP_AUTO, 1600);
     }
-    uint64_t tnow = luat_mcu_tick64_ms();
+    // uint64_t tnow = luat_mcu_tick64_ms();
     luat_netdrv_napt_tcpudp_t mapping = {0};
     if (ctx->is_wnet) {
         // 这是从外网到内网的TCP包

+ 1 - 1
components/network/netdrv/src/luat_netdrv_napt_udp.c

@@ -35,7 +35,7 @@ __USER_FUNC_IN_RAM__ int luat_napt_udp_handle(napt_ctx_t *ctx)
     {
         udp_buff = luat_heap_opt_zalloc(LUAT_HEAP_AUTO, 1600);
     }
-    uint64_t tnow = luat_mcu_tick64_ms();
+    // uint64_t tnow = luat_mcu_tick64_ms();
     luat_netdrv_napt_tcpudp_t mapping = {0};
     if (ctx->is_wnet)
     {

+ 1 - 1
components/network/ulwip/binding/luat_lib_ulwip.c

@@ -91,7 +91,7 @@ int ulwip_netif_ip_event(ulwip_ctx_t* ctx) {
     int ready_now = !ip_addr_isany(&netif->ip_addr);
     ready_now &= netif_is_link_up(netif);
     ready_now &= netif_is_up(netif);
-    luat_ip_addr_t ip = {0};
+    // luat_ip_addr_t ip = {0};
 
     if (ctx->dhcp_client) {
         net_lwip2_set_dhcp_client(ctx->adapter_index, ctx->dhcp_client);