diff --git a/neo/sys/win32/win_local.h b/neo/sys/win32/win_local.h index 99885350..baa62f9d 100644 --- a/neo/sys/win32/win_local.h +++ b/neo/sys/win32/win_local.h @@ -97,7 +97,7 @@ LONG WINAPI MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void Conbuf_AppendText( const char *msg ); -typedef struct { +struct Win32Vars_t { HWND hWnd; HINSTANCE hInstance; @@ -168,7 +168,7 @@ typedef struct { int wglErrors; // SMP acceleration vars -} Win32Vars_t; +}; extern Win32Vars_t win32; diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index 6e7d7b72..ee0fcfb8 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -91,12 +91,15 @@ Sys_Createthread ================== */ void Sys_CreateThread( xthread_t function, void *parms, xthreadPriority priority, xthreadInfo &info, const char *name, xthreadInfo *threads[MAX_THREADS], int *thread_count ) { + DWORD id; HANDLE temp = CreateThread( NULL, // LPSECURITY_ATTRIBUTES lpsa, 0, // DWORD cbStack, - function, // LPTHREAD_START_ROUTINE lpStartAddr, + (LPTHREAD_START_ROUTINE)function, // LPTHREAD_START_ROUTINE lpStartAddr, parms, // LPVOID lpvThreadParm, 0, // DWORD fdwCreate, - &info.threadId); + &id); + + info.threadId = id; info.threadHandle = (intptr_t) temp; if (priority == THREAD_HIGHEST) { SetThreadPriority( (HANDLE)info.threadHandle, THREAD_PRIORITY_HIGHEST ); // we better sleep enough to do this @@ -677,7 +680,7 @@ Sys_DLL_GetProcAddress ===================== */ void *Sys_DLL_GetProcAddress( uintptr_t dllHandle, const char *procName ) { - return GetProcAddress( (HINSTANCE)dllHandle, procName ); + return (void *)GetProcAddress( (HINSTANCE)dllHandle, procName ); } /*