1
0
Fork 0

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

pull/8588/head
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; static bool registered = false;
if (!registered) { if (registered) return;
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; HINSTANCE hinst = GetModuleHandle(nullptr);
if (!RegisterClass(&wnd)) usererror("RegisterClass failed"); 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) static bool AllocateDibSection(int w, int h, bool force)