aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-04 16:32:54 +0100
committerPierre Ossman <ossman@cendio.se>2023-01-05 16:43:34 +0100
commit1d1f16f4acadff7611e1a6e742f308ac61668b08 (patch)
tree1985e28adb9a4324f94388c5250a207081503815
parent11b535fcc8b1c7f4c041883c7fed2ca8022db5d1 (diff)
downloadtigervnc-1d1f16f4acadff7611e1a6e742f308ac61668b08.tar.gz
tigervnc-1d1f16f4acadff7611e1a6e742f308ac61668b08.zip
Fix incorrect types
These types caused an incorrect signed/unsigned behaviour, so let's make sure we use the appropriate type.
-rw-r--r--unix/vncserver/vncsession.c2
-rw-r--r--unix/x0vncserver/x0vncserver.cxx4
-rw-r--r--vncviewer/win32.c8
-rw-r--r--win/rfb_win32/RegConfig.cxx2
4 files changed, 8 insertions, 8 deletions
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) {}