mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-01 17:02:18 +01:00
tests/win32: Initialize DWORD with the right constant
We were initializing a DWORD (unsigned 32 bit) with a constant
of bigger rank (G_MAXSIZE) on 64 bit systems.
Fixes the following warnings on CLang when compiling for x64:
../glib/glib/tests/win32.c:47:14: warning: implicit conversion from 'unsigned long long' to 'DWORD' (aka 'unsigned long') changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
DWORD bp = G_MAXSIZE;
~~ ^~~~~~~~~
glib/glibconfig.h:88:19: note: expanded from macro 'G_MAXSIZE'
#define G_MAXSIZE G_MAXUINT64
^~~~~~~~~~~
../glib/glib/gtypes.h:107:21: note: expanded from macro 'G_MAXUINT64'
#define G_MAXUINT64 G_GUINT64_CONSTANT(0xffffffffffffffff)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/glibconfig.h:69:52: note: expanded from macro 'G_GUINT64_CONSTANT'
#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL))
^~~~~~~~
<scratch space>:96:1: note: expanded from here
0xffffffffffffffffULL
^~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
@@ -44,7 +44,7 @@ test_subst_pid_and_event (void)
|
||||
char *debugger_big_utf8;
|
||||
gchar *output;
|
||||
guintptr be = (guintptr) 0xFFFFFFFF;
|
||||
DWORD bp = G_MAXSIZE;
|
||||
DWORD bp = MAXDWORD;
|
||||
|
||||
/* %f is not valid */
|
||||
g_assert_false (_g_win32_subst_pid_and_event_w (debugger_3, G_N_ELEMENTS (debugger_3),
|
||||
|
||||
Reference in New Issue
Block a user