From: Pierre Ossman Date: Wed, 4 Jan 2023 15:32:54 +0000 (+0100) Subject: Fix incorrect types X-Git-Tag: v1.13.90~97^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1d1f16f4acadff7611e1a6e742f308ac61668b08;p=tigervnc.git Fix incorrect types These types caused an incorrect signed/unsigned behaviour, so let's make sure we use the appropriate type. --- 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) {}