Fixed cast warnings for thread wrapper

This commit is contained in:
Armin Novak
2018-10-24 13:17:04 +02:00
parent 2a4b47aaac
commit 46d6aa4e2b

View File

@@ -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)