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:
Luca Bacci 2023-10-12 10:39:03 +02:00
parent 8264b13737
commit dfeb671c36

View File

@ -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),