From trakatelis@uom.edu.gr  Tue Oct 28 06:15:59 2014
Received: (at 642) by bugs.x2go.org; 28 Oct 2014 05:16:00 +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=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID,
	URIBL_BLOCKED autolearn=ham version=3.3.2
Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id D2C2E5DB3B
	for <642@bugs.x2go.org>; Tue, 28 Oct 2014 06:15:58 +0100 (CET)
Received: by mail-wg0-f52.google.com with SMTP id y10so4608148wgg.11
        for <642@bugs.x2go.org>; Mon, 27 Oct 2014 22:15:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=uom.edu.gr; s=google;
        h=from:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-type:thread-index:content-language;
        bh=k8YM6tGD3hlRrUbUH7ya3dVkXwuzuhOKjLgiwDltYYU=;
        b=WAXw5c4d/kICvKiXJLjHxs43TzZDQ+xOMiA9UP0NqMaqAv2nHzipSwKZmGtAUaIbl0
         hHWIOC19JShtsBt8zM34z1PG7D73ez/Br1RaEv0OME6Qt4PBfOKIq0h1NRv3r4ioODQA
         MVFaxkKC+Av7ys5XpwSDuBY6W3rJByqdQOV+Y=
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:references:in-reply-to:subject:date
         :message-id:mime-version:content-type:thread-index:content-language;
        bh=k8YM6tGD3hlRrUbUH7ya3dVkXwuzuhOKjLgiwDltYYU=;
        b=IZqrLzu2cXv+UuZFeqCeGkBK1vyw0BV3D51uUqv0iEcRAXR2nIf/nQC6iyxrvYlE8y
         VRDC8PCBcF9QXbPWY8vDpDMQt41iLeCYLsSIsboCxsnIgyzg37C5JCAdTjWQ/sGfh1gr
         a2DU612Ab6itCDCKg+EsSO8rA60mv6XWf9L/EkuXt1jRb2E1vUcJzN3RH5F5BNw0pk3R
         81NZVjkvT1JJyHs3o0Ya0lt6pXe+1IrS5C34Fvuh30Rd2qfEh+c8hdWADlwGea2FYpoB
         qRv21YVDqi+AQKiAVutH/iQqIb9IkErtkJEQpEDtFjXkROmJh0xU23WTQ8p2f+mboSfN
         nh+A==
X-Gm-Message-State: ALoCoQmExwKVr/Wflt7/vgwPyqXQ7FRwnUbWlnpLewWQu7aie8B+7TDmSDiwjZnwc/yq1KVz7wbm
X-Received: by 10.180.85.68 with SMTP id f4mr24912505wiz.10.1414473358366;
        Mon, 27 Oct 2014 22:15:58 -0700 (PDT)
Received: from HomePC ([176.92.52.205])
        by mx.google.com with ESMTPSA id hk9sm448323wjb.46.2014.10.27.22.15.56
        for <multiple recipients>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Mon, 27 Oct 2014 22:15:57 -0700 (PDT)
From: "George Trakatelis" <trakatelis@uom.edu.gr>
To: <642@bugs.x2go.org>
Cc: "'Mike DePaulo'" <mikedep333@gmail.com>
References: <20141015203358.Horde.KocdhaNWJNwyU7IDPf0Pug5@mail.das-netzwerkteam.de> <543F84ED.6030207@phoca-gmbh.de> <CAMKht8ggkVX2zF8wf5AFrNqGODAB+10EcX9VW0SN4K_XCaaSpg@mail.gmail.com> <20141016143029.Horde.DtEVLqASiFwRgVFw5c35nw1@mail.das-netzwerkteam.de>
In-Reply-To: <20141016143029.Horde.DtEVLqASiFwRgVFw5c35nw1@mail.das-netzwerkteam.de>
Subject: RE: [X2Go-Dev] Bug#642: Changes in X2GoClient for Windows to enable it conform to Visual Studio's stricter type checking
Date: Tue, 28 Oct 2014 07:15:54 +0200
Message-ID: <000301cff26e$40b79090$c226b1b0$@edu.gr>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0004_01CFF27F.04406090"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac/pTb0EfPGmi37oQp2CkCYXZA8JywJEqGzQ
Content-Language: el

This is a multi-part message in MIME format.

------=_NextPart_000_0004_01CFF27F.04406090
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi Michael,

Now that release 4.0.3.0 of x2goclient is out,=20
I attach my proposed changes and comment on each one:

1. conform-to-stricter-type-checking-mingw482.patch

Even mingw's debug build complains about this char *=20
not having been declared as ought to be (const char *)=20
and suggests using -fpermissive (not recommended).

2. conform-to-stricter-type-checking-VS2010.patch

a. A type-cast to match one of pow's declarations {float pow(float x, =
int y);}
b. In pure Windows there's no close() function to close a socket.=20
   So you have to use closesocket() instead.
c. Include winsock2.h just before windows.h (also recommended by mingw).

3. add-libraries-to-build-with-VS2010.patch

a. A new batch file to configure x2goclient for VS2010 build =
(config_win_vs.bat).=20
I have just substituted nmake for mingw32-make.=20
Please remember to also use 'nmake' or 'nmake debug' when building.
b. Added necessary win32 libraries.

George

> -----Original Message-----
> From: Mike Gabriel [mailto:mike.gabriel@das-netzwerkteam.de]
> Sent: Thursday, October 16, 2014 5:30 PM
> To: Michael DePaulo
> Cc: 642@bugs.x2go.org; Oleksandr Shneyder; o.schneyder@phoca-gmbh.de;
> George Trakatelis
> Subject: Re: [X2Go-Dev] Bug#642: Bug#642: Changes in X2GoClient for
> Windows to enable it conform to Visual Studio's stricter type checking
>=20
> Hi Mike#2
>=20
> On  Do 16 Okt 2014 16:16:16 CEST, Michael DePaulo wrote:
>=20
> > I can merge it this evening. But should we merge it right before we
> > release 4.0.3.0?
> >
>=20
> No, please wait till 4.0.3.0 is out.
>=20
> Mike
>=20
> --
>=20
> DAS-NETZWERKTEAM
> mike gabriel, herweg 7, 24357 fleckeby
> fon: +49 (1520) 1976 148
>=20
> GnuPG Key ID 0x25771B31
> mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
>=20
> freeBusy:
> https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-
> netzwerkteam.de.xfb

------=_NextPart_000_0004_01CFF27F.04406090
Content-Type: application/octet-stream;
	name="conform-to-stricter-type-checking-mingw482.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="conform-to-stricter-type-checking-mingw482.patch"

diff --git a/onmainwindow.cpp b/onmainwindow.cpp=0A=
index 9234a2e..bf58d4d 100644=0A=
--- a/onmainwindow.cpp=0A=
+++ b/onmainwindow.cpp=0A=
@@ -5096,7 +5096,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=

------=_NextPart_000_0004_01CFF27F.04406090
Content-Type: application/octet-stream;
	name="conform-to-stricter-type-checking-VS2010.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="conform-to-stricter-type-checking-VS2010.patch"

diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp=0A=
index c3f78d7..4fea35b 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((float)256,3-j);=0A=
                 i++;=0A=
             }=0A=
             QByteArray data;=0A=
@@ -1674,8 +1674,12 @@ 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=
+        WSACleanup();=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=

------=_NextPart_000_0004_01CFF27F.04406090
Content-Type: application/octet-stream;
	name="add-libraries-to-build-with-VS2010.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="add-libraries-to-build-with-VS2010.patch"

diff --git a/config_win_vs.bat b/config_win_vs.bat=0A=
new file mode 100644=0A=
index 0000000..49bda97=0A=
--- /dev/null=0A=
+++ b/config_win_vs.bat=0A=
@@ -0,0 +1,7 @@=0A=
+nmake distclean=0A=
+lrelease x2goclient.pro=0A=
+set X2GO_CLIENT_TARGET=3D=0A=
+qmake=0A=
+cd x2gohelper=0A=
+nmake clean=0A=
+cd ..=0A=
diff --git a/x2goclient.pro b/x2goclient.pro=0A=
index e6eee01..dcee200 100755=0A=
--- a/x2goclient.pro=0A=
+++ b/x2goclient.pro=0A=
@@ -119,6 +119,7 @@ SOURCES +=3D sharewidget.cpp \=0A=
            folderexplorer.cpp=0A=
 =0A=
 LIBS +=3D -lssh=0A=
+win32:LIBS +=3D -lAdvAPI32 -lshell32 -lUser32=0A=
 =0A=
 plugin {=0A=
 	TARGET =3D x2goplugin=0A=
@@ -133,7 +134,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_0004_01CFF27F.04406090--

