aboutsummaryrefslogtreecommitdiffstats
path: root/src/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/win.c')
-rw-r--r--src/win.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/win.c b/src/win.c
index cb97cdd..0510536 100644
--- a/src/win.c
+++ b/src/win.c
@@ -385,11 +385,11 @@ puglDecodeUTF16(const wchar_t* buf, const int len)
{
const uint32_t c0 = buf[0];
const uint32_t c1 = buf[0];
- if (c0 >= 0xD800 && c0 < 0xDC00) {
+ if (c0 >= 0xD800u && c0 < 0xDC00u) {
if (len < 2) {
return 0xFFFD; // Surrogate, but length is only 1
- } else if (c1 >= 0xDC00 && c1 <= 0xDFFF) {
- return ((c0 & 0x03FF) << 10) + (c1 & 0x03FF) + 0x10000;
+ } else if (c1 >= 0xDC00u && c1 <= 0xDFFFu) {
+ return ((c0 & 0x03FFu) << 10u) + (c1 & 0x03FFu) + 0x10000u;
}
return 0xFFFD; // Unpaired surrogates
@@ -418,7 +418,7 @@ initKeyEvent(PuglEventKey* event,
const unsigned vcode = MapVirtualKey(vkey, MAPVK_VK_TO_VSC);
const unsigned kchar = MapVirtualKey(vkey, MAPVK_VK_TO_CHAR);
- const bool dead = kchar >> (sizeof(UINT) * 8 - 1) & 1;
+ const bool dead = kchar >> (sizeof(UINT) * 8u - 1u) & 1u;
const bool ext = lParam & 0x01000000;
event->type = press ? PUGL_KEY_PRESS : PUGL_KEY_RELEASE;
@@ -451,8 +451,8 @@ initKeyEvent(PuglEventKey* event,
static void
initCharEvent(PuglEvent* event, PuglView* view, WPARAM wParam, LPARAM lParam)
{
- const wchar_t utf16[2] = {wParam & 0xFFFF,
- (wchar_t)((wParam >> 16) & 0xFFFF)};
+ const wchar_t utf16[2] = {(wchar_t)(wParam & 0xFFFFu),
+ (wchar_t)((wParam >> 16u) & 0xFFFFu)};
initKeyEvent(&event->key, view, true, wParam, lParam);
event->type = PUGL_TEXT;