浏览代码

win32: fix 2 compiler warning nits in win32 port

Reported-by: Gisle Vanem <gisle.vanem@gmail.com>
Simon Goldschmidt 6 年之前
父节点
当前提交
5e52d1a4b1
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 1 1
      contrib/ports/win32/include/arch/cc.h
  2. 4 3
      contrib/ports/win32/sys_arch.c

+ 1 - 1
contrib/ports/win32/include/arch/cc.h

@@ -103,7 +103,7 @@ void lwip_win32_platform_diag(const char *format, ...);
 #endif
 
 extern unsigned int lwip_port_rand(void);
-#define LWIP_RAND() (lwip_port_rand())
+#define LWIP_RAND() ((uint32_t)lwip_port_rand())
 
 #define PPP_INCLUDE_SETTINGS_HEADER
 

+ 4 - 3
contrib/ports/win32/sys_arch.c

@@ -78,7 +78,7 @@ static DWORD netconn_sem_tls_index;
 
 static HCRYPTPROV hcrypt;
 
-u32_t
+unsigned int
 lwip_port_rand(void)
 {
   u32_t ret;
@@ -421,7 +421,7 @@ SetThreadName(DWORD dwThreadID, const char* threadName)
 }
 #endif /* _MSC_VER */
 
-static void
+static DWORD WINAPI
 sys_thread_function(void* arg)
 {
   struct threadlist* t = (struct threadlist*)arg;
@@ -432,6 +432,7 @@ sys_thread_function(void* arg)
 #if LWIP_NETCONN_SEM_PER_THREAD
   sys_arch_netconn_sem_free();
 #endif
+  return 0;
 }
 
 sys_thread_t
@@ -454,7 +455,7 @@ sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stacksi
     new_thread->next = lwip_win32_threads;
     lwip_win32_threads = new_thread;
 
-    h = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)sys_thread_function, new_thread, 0, &(new_thread->id));
+    h = CreateThread(0, 0, sys_thread_function, new_thread, 0, &(new_thread->id));
     LWIP_ASSERT("h != 0", h != 0);
     LWIP_ASSERT("h != -1", h != INVALID_HANDLE_VALUE);
     LWIP_UNUSED_ARG(h);