Procházet zdrojové kódy

基于C99消除编译警告

Ryan-CW před 3 roky
rodič
revize
0acba2cfaa

+ 1 - 0
W5500Client/RyanW5500Socket.c

@@ -1483,6 +1483,7 @@ int wiz_getaddrinfo(const char *nodename, const char *servname, const struct add
     return 0;
 }
 
+
 void wiz_freeaddrinfo(struct addrinfo *ai)
 {
     struct addrinfo *next = NULL;

+ 1 - 3
W5500Client/RyanW5500Store.h

@@ -14,13 +14,11 @@ extern "C"
 #include <ctype.h>
 #include <errno.h>
 
+#include <netdb.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/errno.h>
 #include <sys/time.h>
 #include "sal.h"
-#include "sal_netdb.h"
-
 #include "netdev_ipaddr.h"
 #include "netdev.h"
 

+ 2 - 2
W5500Client/RyanW5500netDev.c

@@ -116,9 +116,9 @@ static int RyanW5500NetdevPing(struct netdev *netdev, const char *host, size_t d
  * @param netdev
  * @return int
  */
-static int RyanW5500NetdevNetstat(struct netdev *netdev)
+static void RyanW5500NetdevNetstat(struct netdev *netdev)
 {
-    return 0;
+    return ;
 }
 
 // netdev设备操作

+ 11 - 12
example/RyanW5500Test.c

@@ -12,12 +12,11 @@
 #include <rtdbg.h>
 #include "ulog.h"
 #include "RyanW5500.h"
-#include "sys/socket.h"
 #include "netdb.h"
-#include "sal_socket.h"
-#include "sal_netdb.h"
+
 #include "netdev_ipaddr.h"
 #include "netdev.h"
+#include "sys/socket.h"
 
 #ifdef PKG_USING_RYANW5500_EXAMPLE
 static const char *TAG = "RyanW5500Test";
@@ -795,15 +794,15 @@ static int RyanMqttMsh(int argc, char *argv[])
 // stm32用户需要更改此代码为自己w5500实际挂载的spi总线
 // 非stm32用户可以调用rt_spi_bus_attach_device,
 // 参考连接:https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/programming-manual/device/spi/spi?id=%e6%8c%82%e8%bd%bd-spi-%e8%ae%be%e5%a4%87
-static int RyanW5500SpiArrach(void)
-{
-    rt_err_t result = rt_hw_spi_device_attach("spi2", RYANW5500_SPI_DEVICE, GPIOE, GPIO_PIN_15);
-    if (RT_EOK != result)
-        rt_kprintf("RyanW5500 SPI init fail!!!!!");
-
-    return result;
-}
-INIT_DEVICE_EXPORT(RyanW5500SpiArrach); // spi总线挂载
+//static int RyanW5500SpiArrach(void)
+//{
+//    rt_err_t result = rt_hw_spi_device_attach("spi2", RYANW5500_SPI_DEVICE, GPIOE, GPIO_PIN_15);
+//    if (RT_EOK != result)
+//        rt_kprintf("RyanW5500 SPI init fail!!!!!");
+//
+//    return result;
+//}
+//INIT_DEVICE_EXPORT(RyanW5500SpiArrach); // spi总线挂载
 
 #if defined(RT_USING_MSH)
 MSH_CMD_EXPORT_ALIAS(RyanMqttMsh, w5500, RyanMqtt command);

+ 1 - 1
ioLibrary/DHCP/wizchip_dhcp.c

@@ -154,7 +154,7 @@ uint8_t OLD_allocated_ip[4] = {0}; // 以前的 IP 地址
 wizchipDhcpState_e dhcp_state = STATE_DHCP_INIT; // DHCP 状态
 platformTimer_t dhcp_lease_time = {0};           // dhcp租期定时器
 uint32_t DHCP_XID;                               // 任何数字
-uint8_t *HOST_NAME = DCHP_HOST_NAME;             // 主机名
+uint8_t *HOST_NAME = (uint8_t*)DCHP_HOST_NAME;             // 主机名
 RIP_MSG *pDHCPMSG;                               // DHCP 处理的缓冲区指针
 
 char NibbleToHex(uint8_t nibble)