Commit 04e1981b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Win32: fix warnings

parent 8e8ef5d3
...@@ -143,6 +143,8 @@ DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles, ...@@ -143,6 +143,8 @@ DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles,
static vlc_mutex_t super_mutex; static vlc_mutex_t super_mutex;
static vlc_cond_t super_variable; static vlc_cond_t super_variable;
BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID);
BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
{ {
(void) hinstDll; (void) hinstDll;
...@@ -326,14 +328,13 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex, ...@@ -326,14 +328,13 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
mtime_t total; mtime_t total;
switch (p_condvar->clock) switch (p_condvar->clock)
{ {
case CLOCK_MONOTONIC:
total = mdate();
break;
case CLOCK_REALTIME: /* FIXME? sub-second precision */ case CLOCK_REALTIME: /* FIXME? sub-second precision */
total = CLOCK_FREQ * time (NULL); total = CLOCK_FREQ * time (NULL);
break; break;
default: default:
assert (0); assert (p_condvar->clock == CLOCK_MONOTONIC);
total = mdate();
break;
} }
total = (deadline - total) / 1000; total = (deadline - total) / 1000;
if( total < 0 ) if( total < 0 )
...@@ -600,14 +601,16 @@ static int vlc_clone_attr (vlc_thread_t *p_handle, bool detached, ...@@ -600,14 +601,16 @@ static int vlc_clone_attr (vlc_thread_t *p_handle, bool detached,
* function instead of CreateThread, otherwise you'll end up with * function instead of CreateThread, otherwise you'll end up with
* memory leaks and the signal functions not working (see Microsoft * memory leaks and the signal functions not working (see Microsoft
* Knowledge Base, article 104641) */ * Knowledge Base, article 104641) */
hThread = (HANDLE)(uintptr_t) uintptr_t h;
_beginthreadex (NULL, 0, vlc_entry, th, CREATE_SUSPENDED, NULL);
if (hThread == NULL) h = _beginthreadex (NULL, 0, vlc_entry, th, CREATE_SUSPENDED, NULL);
if (h == 0)
{ {
int err = errno; int err = errno;
free (th); free (th);
return err; return err;
} }
hThread = (HANDLE)h;
#else #else
th->cancel_event = CreateEvent (NULL, FALSE, FALSE, NULL); th->cancel_event = CreateEvent (NULL, FALSE, FALSE, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment