From eb684b9979230bdff3ede1bba7437f839e8cf0bf Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 4 Jan 2023 20:36:26 +0100 Subject: Add missing breaks to Windows key grab code These were not meant to fall through. Likely didn't have any adverse effects, but let's fix it anyway. --- vncviewer/win32.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vncviewer/win32.c') diff --git a/vncviewer/win32.c b/vncviewer/win32.c index c4a68b67..e51acca3 100644 --- a/vncviewer/win32.c +++ b/vncviewer/win32.c @@ -59,11 +59,13 @@ static int is_system_hotkey(int vkCode) { case VK_TAB: if (GetAsyncKeyState(VK_MENU) & 0x8000) return 1; + break; case VK_ESCAPE: if (GetAsyncKeyState(VK_MENU) & 0x8000) return 1; if (GetAsyncKeyState(VK_CONTROL) & 0x8000) return 1; + break; } return 0; } -- cgit v1.2.3 From 1d1f16f4acadff7611e1a6e742f308ac61668b08 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 4 Jan 2023 16:32:54 +0100 Subject: Fix incorrect types These types caused an incorrect signed/unsigned behaviour, so let's make sure we use the appropriate type. --- unix/vncserver/vncsession.c | 2 +- unix/x0vncserver/x0vncserver.cxx | 4 ++-- vncviewer/win32.c | 8 ++++---- win/rfb_win32/RegConfig.cxx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'vncviewer/win32.c') diff --git a/unix/vncserver/vncsession.c b/unix/vncserver/vncsession.c index 875a57e9..c7229221 100644 --- a/unix/vncserver/vncsession.c +++ b/unix/vncserver/vncsession.c @@ -349,7 +349,7 @@ static void redir_stdio(const char *homedir, const char *display) { int fd; - size_t hostlen; + long hostlen; char* hostname = NULL; char logfile[PATH_MAX]; diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index a612f8ac..c89cd853 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -78,7 +78,7 @@ StringParameter interface("interface", static const char* defaultDesktopName() { - size_t host_max = sysconf(_SC_HOST_NAME_MAX); + long host_max = sysconf(_SC_HOST_NAME_MAX); if (host_max < 0) return ""; @@ -90,7 +90,7 @@ static const char* defaultDesktopName() if (pwent == NULL) return ""; - size_t len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); + int len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); if (len < 0) return ""; diff --git a/vncviewer/win32.c b/vncviewer/win32.c index e51acca3..77366f96 100644 --- a/vncviewer/win32.c +++ b/vncviewer/win32.c @@ -142,7 +142,7 @@ void win32_disable_lowlevel_keyboard(HWND hwnd) } // Layout independent keys -static const int vkey_map[][3] = { +static const UINT vkey_map[][3] = { { VK_CANCEL, NoSymbol, XK_Break }, { VK_BACK, XK_BackSpace, NoSymbol }, { VK_TAB, XK_Tab, NoSymbol }, @@ -233,7 +233,7 @@ static const int vkey_map[][3] = { // Layout dependent keys, but without useful symbols // Japanese -static const int vkey_map_jp[][3] = { +static const UINT vkey_map_jp[][3] = { { VK_KANA, XK_Hiragana_Katakana, NoSymbol }, { VK_KANJI, XK_Kanji, NoSymbol }, { VK_OEM_ATTN, XK_Eisu_toggle, NoSymbol }, @@ -248,12 +248,12 @@ static const int vkey_map_jp[][3] = { }; // Korean -static const int vkey_map_ko[][3] = { +static const UINT vkey_map_ko[][3] = { { VK_HANGUL, XK_Hangul, NoSymbol }, { VK_HANJA, XK_Hangul_Hanja, NoSymbol }, }; -static int lookup_vkey_map(UINT vkey, int extended, const int map[][3], size_t size) +static int lookup_vkey_map(UINT vkey, int extended, const UINT map[][3], size_t size) { size_t i; diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx index 715f8097..e697e66b 100644 --- a/win/rfb_win32/RegConfig.cxx +++ b/win/rfb_win32/RegConfig.cxx @@ -108,7 +108,7 @@ bool RegConfigThread::start(const HKEY rootKey, const TCHAR* keyname) { } void RegConfigThread::worker() { - DWORD result = 0; + BOOL result = 0; MSG msg; thread_id = GetCurrentThreadId(); while ((result = eventMgr.getMessage(&msg, 0, 0, 0)) > 0) {} -- cgit v1.2.3