diff options
author | David Robillard <d@drobilla.net> | 2022-04-22 16:06:05 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-04-23 21:18:35 -0400 |
commit | efc9744aa464f01eeeccc1b354b0564d819fdeb3 (patch) | |
tree | 96cc91d83f21ebf5a9bbd31f9fae747292a94a36 /src/win.c | |
parent | c80ee9c1fccdf86b4c7c9d5a3b34ec024432e1a3 (diff) | |
download | pugl-efc9744aa464f01eeeccc1b354b0564d819fdeb3.tar.gz pugl-efc9744aa464f01eeeccc1b354b0564d819fdeb3.tar.bz2 pugl-efc9744aa464f01eeeccc1b354b0564d819fdeb3.zip |
Windows: Avoid else after return
Diffstat (limited to 'src/win.c')
-rw-r--r-- | src/win.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -376,7 +376,9 @@ puglDecodeUTF16(const wchar_t* buf, const int len) if (c0 >= 0xD800u && c0 < 0xDC00u) { if (len < 2) { return 0xFFFD; // Surrogate, but length is only 1 - } else if (c1 >= 0xDC00u && c1 <= 0xDFFFu) { + } + + if (c1 >= 0xDC00u && c1 <= 0xDFFFu) { return ((c0 & 0x03FFu) << 10u) + (c1 & 0x03FFu) + 0x10000u; } @@ -1094,7 +1096,9 @@ puglSetClipboard(PuglView* const view, PuglStatus st = puglSetInternalClipboard(view, type, data, len); if (st) { return st; - } else if (!OpenClipboard(impl->hwnd)) { + } + + if (!OpenClipboard(impl->hwnd)) { return PUGL_UNKNOWN_ERROR; } @@ -1238,7 +1242,9 @@ puglWinCreateWindow(PuglView* const view, NULL, NULL))) { return PUGL_REALIZE_FAILED; - } else if (!(*hdc = GetDC(*hwnd))) { + } + + if (!(*hdc = GetDC(*hwnd))) { DestroyWindow(*hwnd); *hwnd = NULL; return PUGL_REALIZE_FAILED; |