From 46d6aa4e2b58a75fc03c6e26dd9b178a2b287844 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 24 Oct 2018 13:17:04 +0200 Subject: [PATCH] Fixed cast warnings for thread wrapper --- winpr/libwinpr/thread/thread.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index fef495f..c65bba4 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -159,7 +159,23 @@ static HANDLE_OPS ops = ThreadIsHandled, ThreadCloseHandle, ThreadGetFd, - ThreadCleanupHandle + ThreadCleanupHandle, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL }; @@ -282,10 +298,9 @@ static BOOL thread_compare(const void* a, const void* b) * in thread function. */ static void* thread_launcher(void* arg) { - void* rc = NULL; + DWORD rc = 0; WINPR_THREAD* thread = (WINPR_THREAD*) arg; - typedef void* (*fkt_t)(void*); - fkt_t fkt; + LPTHREAD_START_ROUTINE fkt; if (!thread) { @@ -293,7 +308,7 @@ static void* thread_launcher(void* arg) goto exit; } - if (!(fkt = (fkt_t)thread->lpStartAddress)) + if (!(fkt = thread->lpStartAddress)) { WLog_ERR(TAG, "Thread function argument is %p", (void*)fkt); goto exit; @@ -322,7 +337,7 @@ exit: if (thread) { if (!thread->exited) - thread->dwExitCode = (DWORD)(size_t)rc; + thread->dwExitCode = rc; set_event(thread); @@ -330,7 +345,7 @@ exit: cleanup_handle(thread); } - return rc; + return NULL; } static BOOL winpr_StartThread(WINPR_THREAD* thread) -- 2.7.4