From Nito@Qindel.ES  Fri May  8 00:43:18 2015
Received: (at submit) by bugs.x2go.org; 7 May 2015 22:43:21 +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=0.0 required=5.0 tests=BAYES_40,HTML_MESSAGE
	autolearn=ham version=3.3.2
Received: from thor.qindel.com (smtp.qindel.com [89.140.90.34])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 3DCBC5DA80
	for <submit@bugs.x2go.org>; Fri,  8 May 2015 00:43:18 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by thor.qindel.com (Postfix) with ESMTP id 9AF6F6020B
	for <submit@bugs.x2go.org>; Fri,  8 May 2015 00:35:10 +0200 (CEST)
Received: from thor.qindel.com ([127.0.0.1])
	by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10032)
	with ESMTP id hco9KOVYgj1I for <submit@bugs.x2go.org>;
	Fri,  8 May 2015 00:35:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by thor.qindel.com (Postfix) with ESMTP id 24A8D6020D
	for <submit@bugs.x2go.org>; Fri,  8 May 2015 00:35:10 +0200 (CEST)
X-Virus-Scanned: amavisd-new at thor.qindel.com
Received: from thor.qindel.com ([127.0.0.1])
	by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 3QukMzDm-Hvr for <submit@bugs.x2go.org>;
	Fri,  8 May 2015 00:35:09 +0200 (CEST)
Received: from [10.1.0.254] (qvd-254.int.qindel.com [172.26.11.254])
	by thor.qindel.com (Postfix) with ESMTPSA id E99E06020B
	for <submit@bugs.x2go.org>; Fri,  8 May 2015 00:35:09 +0200 (CEST)
Message-ID: <554BE89D.2030304@Qindel.ES>
Date: Fri, 08 May 2015 00:35:09 +0200
From: Nito Martinez <Nito@Qindel.ES>
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: submit@bugs.x2go.org
Subject: Fix compilation errors in nxcomp (nx-libs) when macros TEST/DEBUG/...
 are defined (developer support)
Content-Type: multipart/mixed;
 boundary="------------080608060800020002070205"

This is a multi-part message in MIME format.
--------------080608060800020002070205
Content-Type: multipart/alternative;
 boundary="------------090100070408080602080009"


--------------090100070408080602080009
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Package: nx-libs
Version: 3.5.0.28

Description:

The attached patch fixes some compilation errors when the following 
macros are enabled: (TEST/DEBUG/DUMP). See the lines:

#undef TEST
#undef DEBUG
...

and the conditinal ifdefs

#ifdef TEST
#ifdef DEBUG
...

which are normally not compiled.

During debugging and testing when these macros gets activated, there are 
some compilation errors, which need to be manually fixed each time the 
Macros are enabled. This patch tries to leverage that error.

The patch does not affect code outside of those ifdef, and only provides 
developer support.

Regards,

Nito


--------------090100070408080602080009
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Arial">Package: nx-libs<br>
      Version: 3.5.0.28<br>
      <br>
      Description:<br>
      <br>
      The attached patch fixes some compilation errors when the
      following macros are enabled: (TEST/DEBUG/DUMP). See the lines:<br>
      <br>
      #undef TEST<br>
      #undef DEBUG<br>
      ...<br>
      <br>
      and the conditinal ifdefs<br>
      <br>
      #ifdef TEST<br>
      #ifdef DEBUG<br>
      ...<br>
      <br>
      which are normally not compiled.<br>
      <br>
      During debugging and testing when these macros gets activated,
      there are some compilation errors, which need to be manually fixed
      each time the Macros are enabled. This patch tries to leverage
      that error.<br>
      <br>
      The patch does not affect code outside of those ifdef, and only
      provides developer support.<br>
      <br>
      Regards,<br>
      <br>
      Nito<br>
      <br>
    </font>
  </body>
</html>

--------------090100070408080602080009--

--------------080608060800020002070205
Content-Type: text/x-diff;
 name="macro_debugging.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="macro_debugging.patch"

diff --git a/nxcomp/Agent.h b/nxcomp/Agent.h
index fac5acd..1a59412 100644
--- a/nxcomp/Agent.h
+++ b/nxcomp/Agent.h
@@ -205,7 +205,7 @@ class Agent
   {
     #if defined(TEST) || defined(INFO)
     *logofs << "Agent: proxyCanRead() is "
-            << ((int) FD_ISSET(proxy -> getFd(), readSet)
+            << ((int) FD_ISSET(proxy -> getFd(), readSet))
             << ".\n" << logofs_flush;
     #endif
 
diff --git a/nxcomp/ClearArea.cpp b/nxcomp/ClearArea.cpp
index 7b693c7..81beb1e 100644
--- a/nxcomp/ClearArea.cpp
+++ b/nxcomp/ClearArea.cpp
@@ -92,7 +92,7 @@ void ClearAreaStore::dumpIdentity(const Message *message) const
 
   ClearAreaMessage *clearArea = (ClearAreaMessage *) message;
 
-  *logofs << name() << ": Identity exposures " << clearArea -> (unsigned int) exposures 
+  *logofs << name() << ": Identity exposures " << (unsigned int) clearArea -> exposures
           << ", window " << clearArea -> window  << ", x " << clearArea -> x
           << ", y " << clearArea -> y << ", width  " << clearArea -> width
           << ", height " << clearArea -> height << ", size " << clearArea -> size_
diff --git a/nxcomp/Proxy.cpp b/nxcomp/Proxy.cpp
index 7258fcf..b4b23a9 100644
--- a/nxcomp/Proxy.cpp
+++ b/nxcomp/Proxy.cpp
@@ -5169,7 +5169,7 @@ char *Proxy::handleSaveAllStores(const char *savePath) const
 
   *(cacheDumpName + DEFAULT_STRING_LENGTH - 1) = '\0';
 
-  mode_t fileMode = umask(0077);
+  fileMode = umask(0077);
 
   cacheDump = new ofstream(cacheDumpName, ios::out);
 
diff --git a/nxcomp/ServerChannel.cpp b/nxcomp/ServerChannel.cpp
index 52551e7..7f3ef07 100644
--- a/nxcomp/ServerChannel.cpp
+++ b/nxcomp/ServerChannel.cpp
@@ -5475,7 +5475,7 @@ int ServerChannel::handleColormap(unsigned char &opcode, unsigned char *&buffer,
     *logofs << "handleColormap: Dumping colormap entries:\n"
             << logofs_flush;
 
-    const unsigned char *p = unpackState_[resource] -> colormap -> data;
+    const unsigned int *p = unpackState_[resource] -> colormap -> data;
 
     for (unsigned int i = 0; i < unpackState_[resource] ->
              colormap -> entries; i++)

--------------080608060800020002070205--

