[gtk/gtk-3-24: 4/8] gdk/win32: Remove unneeded struct _GdkWin32KernelCPUFuncs




commit 64eedbfaf4b7169d0a509f923fd030b9f6107e20
Author: Philip Zander <philip zander gmail com>
Date:   Sat Oct 17 21:24:56 2020 +0200

    gdk/win32: Remove unneeded struct _GdkWin32KernelCPUFuncs
    
    It only had a single member and was only used internally by one
    function.

 gdk/win32/gdkdisplay-win32.c | 20 +++++++++++---------
 gdk/win32/gdkdisplay-win32.h |  7 -------
 2 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 246a6c9175..5671e2c254 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -1048,33 +1048,35 @@ _gdk_win32_check_processor (GdkWin32ProcessorCheckType check_type)
 
       if (kernel32 != NULL)
         {
-          GdkWin32KernelCPUFuncs cpu_funcs = {0};
+          typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
 
-          cpu_funcs.isWow64Process2 =
+          funcIsWow64Process2 isWow64Process2 =
             (funcIsWow64Process2) GetProcAddress (kernel32, "IsWow64Process2");
 
-          if (cpu_funcs.isWow64Process2 != NULL)
+          if (isWow64Process2 != NULL)
             {
               USHORT proc_cpu = 0;
               USHORT native_cpu = 0;
 
-              cpu_funcs.isWow64Process2 (GetCurrentProcess (),
-                                        &proc_cpu,
-                                        &native_cpu);
+              isWow64Process2 (GetCurrentProcess (), &proc_cpu, &native_cpu);
 
               if (native_cpu == IMAGE_FILE_MACHINE_ARM64)
                 is_arm64 = TRUE;
 
-              if (native_cpu != IMAGE_FILE_MACHINE_UNKNOWN)
+              if (proc_cpu != IMAGE_FILE_MACHINE_UNKNOWN)
                 is_wow64 = TRUE;
             }
           else
-            fallback_wow64_check = TRUE;
+            {
+              fallback_wow64_check = TRUE;
+            }
 
           FreeLibrary (kernel32);
         }
       else
-        fallback_wow64_check = TRUE;
+        {
+          fallback_wow64_check = TRUE;
+        }
 
       if (fallback_wow64_check)
         IsWow64Process (GetCurrentProcess (), &is_wow64);
diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h
index 806e4430e2..e0222e6860 100644
--- a/gdk/win32/gdkdisplay-win32.h
+++ b/gdk/win32/gdkdisplay-win32.h
@@ -66,13 +66,6 @@ typedef struct _GdkWin32User32DPIFuncs
   funcIsProcessDPIAware isDpiAwareFunc;
 } GdkWin32User32DPIFuncs;
 
-/* Detect running architecture */
-typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
-typedef struct _GdkWin32KernelCPUFuncs
-{
-  funcIsWow64Process2 isWow64Process2;
-} GdkWin32KernelCPUFuncs;
-
 struct _GdkWin32Display
 {
   GdkDisplay display;


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