From unknown Mon Jun 15 14:30:47 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#642: Changes in X2GoClient for Windows to enable it conform to Visual Studio's stricter type checking
Reply-To: "George Trakatelis" <trakatelis@uom.edu.gr>, 642@bugs.x2go.org
Resent-From: "George Trakatelis" <trakatelis@uom.edu.gr>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Wed, 15 Oct 2014 14:50:01 +0000
Resent-Message-ID: <handler.642.B.141338435912766@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 642
X-X2Go-PR-Package: x2goclient
X-X2Go-PR-Keywords: 
Received: via spool by submit@bugs.x2go.org id=B.141338435912766
          (code B); Wed, 15 Oct 2014 14:50:01 +0000
Received: (at submit) by bugs.x2go.org; 15 Oct 2014 14:45:59 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: **
X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_50,T_DKIM_INVALID,
	URIBL_BLOCKED,URIBL_RHS_DOB autolearn=no version=3.3.2
Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 5FD7F3D5FB
	for <submit@bugs.x2go.org>; Wed, 15 Oct 2014 16:45:59 +0200 (CEST)
Received: by mail-wi0-f180.google.com with SMTP id em10so2126182wid.13
        for <submit@bugs.x2go.org>; Wed, 15 Oct 2014 07:45:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=uom.edu.gr; s=google;
        h=from:to:cc:subject:date:message-id:mime-version:content-type
         :thread-index:content-language;
        bh=VG27IqTc1pisT30lvvAZJJ3Vhs0PEnhRwdGV9ZrCLbY=;
        b=eNhfs4UnOy7C8JCf+Nx8rqnflENIRYZpveIrHHEkLQ9bFFfkKaozq5nXn+m4lutpOq
         tqPV21GkB2wv90p3KEVrhhzbMvHgV452lDHUj6ubZk9lpXb40xGeyp6Hk8jqwd7ZV5Db
         oOVZr+TFolJ8ddOZFD2ttjS1X0EiMrsVfAY2g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-type:thread-index:content-language;
        bh=VG27IqTc1pisT30lvvAZJJ3Vhs0PEnhRwdGV9ZrCLbY=;
        b=NGbm9lwDFdyyxrmZW7DRAqW3+az0J7rtC7YgtQaSBS3e0gYWV4Bu+SbZRyiANYxuts
         iZCm1IgzXeXKpM2e4qiKyjDY5gkr4nXz6iVHjL9ipXCX04GCWCtVl+Q26w8E/cQEW6Bd
         vexT1XkoT3fwO1ildbuRC49NxWF3jhJzY9DbsQiuafYfwxp/2/JQxYWpknrahLc9viB3
         sHxokAW27ylnuwnLCoBiodAlzcPOrjRwe4O0OqJ70OP1DMsmzkKRUoMgzQwJr1SBRkVr
         R1OvyN0MvWNz4fGOY1/yBKk7kyC3z9ADuGOSzsOjzRFaxtx9rDDizNfIm+5aoVp3GjuF
         no/A==
X-Gm-Message-State: ALoCoQmxs8oM58GfQz8Hrt+7edtZH8KYFJJaco0OleLLW4X5pAbLvdxfkMaH7h5YhodF7akEY5I8
X-Received: by 10.181.29.10 with SMTP id js10mr12523244wid.71.1413384358856;
        Wed, 15 Oct 2014 07:45:58 -0700 (PDT)
Received: from HomePC (46-4-59.adsl.cyta.gr. [46.103.4.59])
        by mx.google.com with ESMTPSA id ji10sm19648980wid.7.2014.10.15.07.45.57
        for <multiple recipients>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Wed, 15 Oct 2014 07:45:58 -0700 (PDT)
From: "George Trakatelis" <trakatelis@uom.edu.gr>
To: <submit@bugs.x2go.org>
Cc: "'Mike DePaulo'" <mikedep333@gmail.com>
Date: Wed, 15 Oct 2014 17:45:54 +0300
Message-ID: <000001cfe886$ba6f6d00$2f4e4700$@edu.gr>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0001_01CFE89F.DFBCA500"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac/ohrisvKSXF3TdSz+Rt+6ybkFPAQ==
Content-Language: el

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01CFE89F.DFBCA500
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Package: x2goclient
Version: 4.0.2.1
Severity: wishlist

Given the ease of use of Visual Studio's built-in debugger, 
the ability to compile X2GoClient in Visual Studio 2010 
would be highly appreciated by developers eager to contribute 
in the evolution of X2GoClient for Windows.

Using the attached patch (also added config_win_vs.bat) 
I have only managed to compile x2gofree (with VS2010 nmake) 
on the command line. Despite my changes in x2goclient.pro,
Qt4 Visual Studio Add-in cannot produce a working project file
(x2goclient.vcxproj). 
Any help to enable building x2gofree in Visual Studio 2010 is welcome.

PS. The change in ONMainWindow::slotRetResumeSess 
is also mandatory for GCC 4.8.2 (i686-4.8.2-release-posix-dwarf-rt_v3-rev3).

-----------------------------------------------------------------
George Trakatelis 
Department of Applied Informatics, School of Information Sciences 
University of Macedonia, Greece
-----------------------------------------------------------------

------=_NextPart_000_0001_01CFE89F.DFBCA500
Content-Type: application/octet-stream;
	name="conform-to-stricter-type-checking.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="conform-to-stricter-type-checking.diff"

diff --git a/onmainwindow.cpp b/onmainwindow.cpp=0A=
index 7fe7501..f31ee80 100644=0A=
--- a/onmainwindow.cpp=0A=
+++ b/onmainwindow.cpp=0A=
@@ -5087,7 +5087,7 @@ void ONMainWindow::slotRetResumeSess ( bool result,=0A=
 #endif //Q_OS_WIN=0A=
         if ( sshSndTunnel )=0A=
         {=0A=
-            char* okSlot=3D0;=0A=
+            const char* okSlot=3D0;=0A=
 #ifdef Q_OS_WIN=0A=
             if ( sndSystem=3D=3DPULSE )=0A=
             {=0A=
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp=0A=
index c3f78d7..26d37dd 100755=0A=
--- a/sshmasterconnection.cpp=0A=
+++ b/sshmasterconnection.cpp=0A=
@@ -104,10 +104,10 @@ void SshMasterConnection::parseKnownHosts()=0A=
         for (int i=3D0; i<bytes.count();)=0A=
         {=0A=
             int size=3D0;=0A=
-            //first 4 bytes are for size of data fild (big-endian)=0A=
+            //first 4 bytes are for size of data field (big-endian)=0A=
             for (int j=3D0; j<4; ++j)=0A=
             {=0A=
-                size+=3D((uchar)(bytes[i])) * pow(256,3-j);=0A=
+                size+=3D((uchar)(bytes[i])) * pow((long double)256,3-j);=0A=
                 i++;=0A=
             }=0A=
             QByteArray data;=0A=
@@ -1674,8 +1674,11 @@ void SshMasterConnection::finalize ( int item )=0A=
     {=0A=
 #ifndef Q_OS_WIN=0A=
         shutdown(tcpSocket, SHUT_RDWR);=0A=
-#endif=0A=
         close ( tcpSocket );=0A=
+#else=0A=
+        shutdown(tcpSocket, SD_BOTH);=0A=
+        closesocket ( tcpSocket );=0A=
+#endif=0A=
     }=0A=
     SshProcess* proc=3DchannelConnections[item].creator;=0A=
     QString uuid=3DchannelConnections[item].uuid;=0A=
diff --git a/wapi.cpp b/wapi.cpp=0A=
index f167669..f0972d7 100644=0A=
--- a/wapi.cpp=0A=
+++ b/wapi.cpp=0A=
@@ -22,6 +22,7 @@=0A=
 #endif=0A=
 #include "x2goclientconfig.h"=0A=
 #ifdef Q_OS_WIN=0A=
+#include <winsock2.h>=0A=
 #include <windows.h>=0A=
 #include <sddl.h>=0A=
 #include "wapi.h"=0A=
diff --git a/x2goclient.pro b/x2goclient.pro=0A=
index 7bae04c..f41cc09 100755=0A=
--- a/x2goclient.pro=0A=
+++ b/x2goclient.pro=0A=
@@ -118,6 +118,11 @@ SOURCES +=3D sharewidget.cpp \=0A=
            folderbutton.cpp \=0A=
            folderexplorer.cpp=0A=
 =0A=
+#CAUTION: Substitute C:/Program Files/Microsoft SDK/Windows/v7.0A/Lib=0A=
+#with the folder that AdvAPI32.Lib, shell32.lib, and User32.Lib =
actually reside in=0A=
+message(Please make sure AdvAPI32.Lib, shell32.lib, and User32.Lib are =
accessible)=0A=
+win32:LIBS +=3D -L"C:/Program Files/Microsoft SDK/Windows/v7.0A/Lib" =
-ladvapi32 -lshell32 -luser32=0A=
+=0A=
 LIBS +=3D -lssh=0A=
 =0A=
 plugin {=0A=
@@ -133,7 +138,7 @@ else {=0A=
 =0A=
 !isEmpty(TRANSLATIONS) {=0A=
   isEmpty(QMAKE_LRELEASE) {=0A=
-    win32:QMAKE_LRELEASE =3D $$[QT_INSTALL_BINS]\lrelease.exe=0A=
+    win32:QMAKE_LRELEASE =3D $$[QT_INSTALL_BINS]/lrelease.exe=0A=
     else:QMAKE_LRELEASE =3D $$[QT_INSTALL_BINS]/lrelease=0A=
   }=0A=
 =0A=

------=_NextPart_000_0001_01CFE89F.DFBCA500
Content-Type: text/plain;
	name="config_win_vs.bat.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="config_win_vs.bat.txt"

nmake distclean=0A=
lrelease x2goclient.pro=0A=
set X2GO_CLIENT_TARGET=3D=0A=
qmake=0A=
cd x2gohelper=0A=
nmake clean=0A=
cd ..=0A=

------=_NextPart_000_0001_01CFE89F.DFBCA500--
