[glib: 1/3] Fix cast from pointer to integer of different size warnings in glib/gthread-win32.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/3] Fix cast from pointer to integer of different size warnings in glib/gthread-win32.c
- Date: Wed, 21 Jul 2021 21:07:27 +0000 (UTC)
commit 28dcec03e1092c6a284c3bb437fe36d382f180df
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Sun May 9 23:23:31 2021 +0200
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);
^~~~~~~~~~~~~~~
glib/gthread-win32.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c
index 63e3cdd76..79e397820 100644
--- a/glib/gthread-win32.c
+++ b/glib/gthread-win32.c
@@ -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
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]