summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Zander <philip.zander@gmail.com>2020-10-17 21:24:56 +0200
committerPhilip Zander <philip.zander@gmail.com>2021-12-08 22:46:52 +0100
commit64eedbfaf4b7169d0a509f923fd030b9f6107e20 (patch)
treebc7625d621dc4950f50ef74aa6880b7662e94d0d
parent4a55c527d7a68a05d133d97eeec6bf3cfa3978bd (diff)
downloadgtk+-64eedbfaf4b7169d0a509f923fd030b9f6107e20.tar.gz
gdk/win32: Remove unneeded struct _GdkWin32KernelCPUFuncs
It only had a single member and was only used internally by one function.
-rw-r--r--gdk/win32/gdkdisplay-win32.c20
-rw-r--r--gdk/win32/gdkdisplay-win32.h7
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;