Fix cast from pointer to integer of different size warnings in glib/gthread-win32.c

glib/gthread-win32.c: In function 'g_private_get_impl':
glib/gthread-win32.c:310:16: warning: cast from pointer to integer of different size
   DWORD impl = (DWORD) key->p;
                ^
glib/gthread-win32.c:315:14: warning: cast from pointer to integer of different size
       impl = (DWORD) key->p;
              ^
glib/gthread-win32.c: In function 'SetThreadName':
glib/gthread-win32.c:596:60: warning: passing argument 4 of 'RaiseException' from incompatible pointer type
    RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info);
                                                            ^~~~~~~~~~~~~~~
This commit is contained in:
Emmanuel Fleury 2021-05-09 23:23:31 +02:00
parent 92540e76d7
commit 28dcec03e1

View File

@ -307,12 +307,12 @@ static CRITICAL_SECTION g_private_lock;
static DWORD
g_private_get_impl (GPrivate *key)
{
DWORD impl = (DWORD) key->p;
DWORD impl = (DWORD) GPOINTER_TO_UINT(key->p);
if G_UNLIKELY (impl == 0)
{
EnterCriticalSection (&g_private_lock);
impl = (DWORD) key->p;
impl = (UINT_PTR) key->p;
if (impl == 0)
{
GPrivateDestructor *destructor;
@ -603,7 +603,7 @@ SetThreadName (DWORD dwThreadID,
if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
return;
RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info);
RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (const ULONG_PTR *) &info);
#endif
}