winpr: fix build warnings
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 11 Nov 2014 16:21:34 +0000 (11:21 -0500)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 11 Nov 2014 16:21:34 +0000 (11:21 -0500)
libfreerdp/core/update.c
winpr/libwinpr/pool/pool.c
winpr/libwinpr/thread/thread.c

index 42bfd44..0adfbeb 100644 (file)
@@ -1518,7 +1518,7 @@ static void update_send_pointer_position(rdpContext* context, POINTER_POSITION_U
        Stream_Write_UINT16(s, pointerPosition->xPos); /* xPos (2 bytes) */
        Stream_Write_UINT16(s, pointerPosition->yPos); /* yPos (2 bytes) */
 
-       fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_PTR_POSITION, s);
+       fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_PTR_POSITION, s, FALSE);
        Stream_Release(s);
 }
 
index df5c170..0b097e8 100644 (file)
@@ -181,9 +181,6 @@ VOID CloseThreadpool(PTP_POOL ptpp)
        if (pCloseThreadpool)
                pCloseThreadpool(ptpp);
 #else
-       int index;
-       HANDLE thread;
-
        SetEvent(ptpp->TerminateEvent);
 
        ArrayList_Free(ptpp->Threads);
index b9107f7..461f576 100644 (file)
@@ -267,7 +267,7 @@ exit:
        if (thread->detached || !thread->started)
                cleanup_handle(thread);
 
-       pthread_exit(thread->dwExitCode);
+       pthread_exit((void*) (size_t) thread->dwExitCode);
        return rc;
 }
 
@@ -426,12 +426,13 @@ VOID ExitThread(DWORD dwExitCode)
 {
        pthread_t tid = pthread_self();
 
-       if (NULL == thread_list)
+       if (!thread_list)
        {
                WLog_ERR(TAG, "function called without existing thread list!");
 #if defined(WITH_DEBUG_THREADS)
                DumpThreadHandles();
 #endif
+               pthread_exit(0);
        }
        else if (!ListDictionary_Contains(thread_list, &tid))
        {
@@ -439,12 +440,15 @@ VOID ExitThread(DWORD dwExitCode)
 #if defined(WITH_DEBUG_THREADS)
                DumpThreadHandles();
 #endif
+               pthread_exit(0);
        }
        else
        {
-               WINPR_THREAD *thread;
+               WINPR_THREAD* thread;
+
                ListDictionary_Lock(thread_list);
                thread = ListDictionary_GetItemValue(thread_list, &tid);
+
                assert(thread);
                thread->exited = TRUE;
                thread->dwExitCode = dwExitCode;
@@ -457,7 +461,7 @@ VOID ExitThread(DWORD dwExitCode)
                if (thread->detached || !thread->started)
                        cleanup_handle(thread);
 
-               pthread_exit(thread->dwExitCode);
+               pthread_exit((void*) (size_t) thread->dwExitCode);
        }
 }