[glib: 3/8] Fix signedness warnings in glib/gwin32.c




commit 2f2e021a56caf7c69c77b707d264674f897eb572
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Fri May 14 13:51:49 2021 +0200

    Fix signedness warnings in glib/gwin32.c
    
    glib/gwin32.c: In function 'g_win32_check_windows_version':
    glib/gwin32.c:556:32: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 
'long unsigned int'} and 'gint' {aka 'const int'}
       if (osverinfo.dwMajorVersion > major)
                                    ^
    glib/gwin32.c:558:37: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 
'long unsigned int'} and 'gint' {aka 'const int'}
       else if (osverinfo.dwMajorVersion == major)
                                         ^~
    glib/gwin32.c:560:36: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 
'long unsigned int'} and 'gint' {aka 'const int'}
           if (osverinfo.dwMinorVersion > minor)
                                        ^
    glib/gwin32.c:562:41: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 
'long unsigned int'} and 'gint' {aka 'const int'}
           else if (osverinfo.dwMinorVersion == minor)
                                             ^~

 glib/gwin32.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/glib/gwin32.c b/glib/gwin32.c
index f4590916f..30c60575e 100644
--- a/glib/gwin32.c
+++ b/glib/gwin32.c
@@ -534,7 +534,7 @@ g_win32_check_windows_version (const gint major,
   HMODULE hmodule;
 #endif
   /* We Only Support Checking for XP or later */
-  g_return_val_if_fail (major >= 5 && (major <=6 || major == 10), FALSE);
+  g_return_val_if_fail (major >= 5 && (major <= 6 || major == 10), FALSE);
   g_return_val_if_fail ((major >= 5 && minor >= 1) || major >= 6, FALSE);
 
   /* Check for Service Pack Version >= 0 */
@@ -553,14 +553,14 @@ g_win32_check_windows_version (const gint major,
   RtlGetVersion (&osverinfo);
 
   /* check the OS and Service Pack Versions */
-  if (osverinfo.dwMajorVersion > major)
+  if (osverinfo.dwMajorVersion > (DWORD) major)
     is_ver_checked = TRUE;
-  else if (osverinfo.dwMajorVersion == major)
+  else if (osverinfo.dwMajorVersion == (DWORD) major)
     {
-      if (osverinfo.dwMinorVersion > minor)
+      if (osverinfo.dwMinorVersion > (DWORD) minor)
         is_ver_checked = TRUE;
-      else if (osverinfo.dwMinorVersion == minor)
-        if (osverinfo.wServicePackMajor >= spver)
+      else if (osverinfo.dwMinorVersion == (DWORD) minor)
+        if (osverinfo.wServicePackMajor >= (DWORD) spver)
           is_ver_checked = TRUE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]