From 8230bf0a2f39f0849b670d26067207c45edcca1a Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Wed, 6 Sep 2017 23:50:18 +0200 Subject: Remove assignment and declarations in if statements After discussing with @reduz and @akien-mga it was decided that we do not allow assignments or declarations in if statements. This PR removes the instances of this I could find by automated means. --- platform/windows/os_windows.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'platform/windows/os_windows.cpp') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index deb9c25576..5814d883cd 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -996,7 +996,16 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int video_mode.fullscreen = false; } else { - if (!(hWnd = CreateWindowExW(dwExStyle, L"Engine", L"", dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, (GetSystemMetrics(SM_CXSCREEN) - WindowRect.right) / 2, (GetSystemMetrics(SM_CYSCREEN) - WindowRect.bottom) / 2, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top, NULL, NULL, hInstance, NULL))) { + hWnd = CreateWindowExW( + dwExStyle, + L"Engine", L"", + dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + (GetSystemMetrics(SM_CXSCREEN) - WindowRect.right) / 2, + (GetSystemMetrics(SM_CYSCREEN) - WindowRect.bottom) / 2, + WindowRect.right - WindowRect.left, + WindowRect.bottom - WindowRect.top, + NULL, NULL, hInstance, NULL); + if (!hWnd) { MessageBoxW(NULL, L"Window Creation Error.", L"ERROR", MB_OK | MB_ICONEXCLAMATION); return; // Return FALSE } -- cgit v1.2.3