Codechange: [Win32] Use return-early in RegisterWndClass()

This commit is contained in:
Patric Stout 2021-01-16 15:27:13 +01:00 committed by Michael Lutz
parent 7415964a4d
commit 689404a4a1
1 changed files with 17 additions and 17 deletions

View File

@ -975,24 +975,24 @@ static void RegisterWndClass()
{
static bool registered = false;
if (!registered) {
HINSTANCE hinst = GetModuleHandle(nullptr);
WNDCLASS wnd = {
CS_OWNDC,
WndProcGdi,
0,
0,
hinst,
LoadIcon(hinst, MAKEINTRESOURCE(100)),
LoadCursor(nullptr, IDC_ARROW),
0,
0,
_T("OTTD")
};
if (registered) return;
registered = true;
if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
}
HINSTANCE hinst = GetModuleHandle(nullptr);
WNDCLASS wnd = {
CS_OWNDC,
WndProcGdi,
0,
0,
hinst,
LoadIcon(hinst, MAKEINTRESOURCE(100)),
LoadCursor(nullptr, IDC_ARROW),
0,
0,
_T("OTTD")
};
registered = true;
if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
}
static bool AllocateDibSection(int w, int h, bool force)