mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Actually make the correct cast
The cast works best if you don't imply another conversion to a temporary. Just return the value directly from the syscall/pthreads call, while casting to a DWORD.
This commit is contained in:
@@ -918,11 +918,9 @@ HANDLE _GetCurrentThread(VOID)
|
||||
DWORD GetCurrentThreadId(VOID)
|
||||
{
|
||||
#if defined(__FreeBSD__)
|
||||
int tid = WINPR_CXX_COMPAT_CAST(DWORD, pthread_getthreadid_np());
|
||||
return tid;
|
||||
return WINPR_CXX_COMPAT_CAST(DWORD, pthread_getthreadid_np());
|
||||
#elif defined(__linux__)
|
||||
pid_t tid = WINPR_CXX_COMPAT_CAST(DWORD, syscall(SYS_gettid));
|
||||
return tid;
|
||||
return WINPR_CXX_COMPAT_CAST(DWORD, syscall(SYS_gettid));
|
||||
#else
|
||||
pthread_t tid = pthread_self();
|
||||
/* Since pthread_t can be 64-bits on some systems, take just the */
|
||||
|
||||
Reference in New Issue
Block a user