Subject: Fix compilation errors in nxcomp (nx-libs) when macros TEST/DEBUG/... are defined (developer support)

From: Nito Martinez <[email-masked]>
Date: Fri, 08 May 2015 00:35:09 +0200

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

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++)

---

From: Mike Gabriel <[email-masked]>
Date: Fri, 08 May 2015 10:03:12 +0000

Hi Nito,

On  Fr 08 Mai 2015 00:35:09 CEST, Nito Martinez wrote:

> 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

We (people from X2Go and Arctica) changed the nx-libs development  
workflow a bit, recently:

Now, we normally file pull requests (even internally in our team,  
except for small fixes) against the nx-libs 3.6.x branch on Github.  
All greater code changes happen for nx-libs 3.6.x first and then get  
backported to 3.5.0.x later (or not at all). All major commits/change  
shall reveive a code review and approval of another dev on the team.

So, the initial bug tracking / pull request tracking for nx-libs has  
been relocated to Github. Bugs for nx-libs on the X2Go bug tracker are  
for marking PRs or commits worth of being backported to the 3.5.0.x  
branch (which is handled by the X2Go devs, mainly Mihai Moldovan at  
the time being).

Basic splitup of workload: Arctica Project context maintains nx-libs  
3.6.x, X2Go context maintains nx-libs 3.5.0.x.

Also, Mihai fixed several TEST/DEBUG/DUMP issues on both branches  
(3.5.0.x and 3.6.x). It may well be that the fixes you provide here  
already exist on 3.5.0.x/HEAD (haven't checked that)?

Thus, could you do these following steps:

   o rebase your patch against nx-libs 3.6.x branch
   o clone https://github.com/ArcticaProject/nx-libs
   o create a pr/<describe-what-your-code-does> branch on your account
   o file a PR against ArcticaProject/nx-libs 3.6.x branch
   o wait for Ionic or me to review

In the future, I'd be happy to welcome you as another potential pull  
request reviewer, so we can distribute the workload even better. Once  
I see your PR, I will grant you write/commit access to nx-libs on  
github.com/ArcticaProject.

Greets,
Mike
-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Mike Gabriel <[email-masked]>
Date: Mon, 29 Feb 2016 09:03:44 +0000

Control: tags -1 fixed-upstream
Control: fixed -1 3.5.99.0
Control: forwarded -1 https://github.com/ArcticaProject/nx-libs/pull/26
On  Fr 08 Mai 2015 12:03:12 CEST, Mike Gabriel wrote:

>> 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.
>>

This issue has been resolved on the 3.6.x branch of nx-libs [1] and a  
backport to 3.5.x is recommended, but not critical.

Mike

[1] https://github.com/ArcticaProject/nx-libs/pull/26
-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy:
https://mail.das-netzwerkteam.de/mailxchange/kronolith/fb.php?u=m.gabriel%40das-netzwerkteam.de