[X2Go-Commits] [nx-libs] 04/06: Add 990_fix-DEBUG-and-TEST-builds.full.patch. Fix debug builds (e.g. when globally setting -DDEBUG and -DTEST at build time).

git-admin at x2go.org git-admin at x2go.org
Sat Jun 21 23:21:54 CEST 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository nx-libs.

commit abbe7e8401f3ffdc40c2ff4bf16fa9801fbd0610
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Jun 21 23:04:16 2014 +0200

    Add 990_fix-DEBUG-and-TEST-builds.full.patch. Fix debug builds (e.g. when globally setting -DDEBUG and -DTEST at build time).
---
 debian/changelog                                   |    2 +
 .../990_fix-DEBUG-and-TEST-builds.full.patch       |   69 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 72 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 02346d0..3edfbbe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ nx-libs (2:3.5.0.25-0x2go1) UNRELEASED; urgency=low
     Only print an error message if SessionPath *really* is not defined.
   * Improve 028_nx-X11_abstract-kernel-sockets.full.patch. Make it more
     Big Endian robust by assigning correct types for socklen_t objects.
+  * Add 990_fix-DEBUG-and-TEST-builds.full.patch. Fix debug builds (e.g.
+    when globally setting -DDEBUG and -DTEST at build time).
 
   [ Mike Gabriel ]
   * Add 606_nx-X11_build-on-aarch64.full.patch. Build on aarch64
diff --git a/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch b/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch
new file mode 100644
index 0000000..0fef1a9
--- /dev/null
+++ b/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch
@@ -0,0 +1,69 @@
+Author: Mihai Moldovan <ionic at ionic.de>
+Description: Several fixes for building debug versions of NX
+Abstract:
+ (1) In nx-X11/programs/Xserver/dix:
+ .
+ Fix several compile errors when specifying -DDEBUG globally. Previous GCC
+ versions were more liberal and the code thus compiled.
+ .
+ Also initialize/reset a count variable correctly.
+ .
+ .
+ (2) In nx-X11/programs/Xserver/hw/nxagent/Render.c:
+ .
+ Check for pSrc->pDrawable to exist instead of having nxagent segfault when
+ it does not.
+ .
+ This enables the possibility of compiling all nxagent modules in TEST mode.
+
+--- a/nx-X11/programs/Xserver/dix/dixfonts.c
++++ b/nx-X11/programs/Xserver/dix/dixfonts.c
+@@ -2203,7 +2203,7 @@
+ 	byte = 0;
+ 	for (l = 0; l <= (cip->metrics.rightSideBearing -
+ 			  cip->metrics.leftSideBearing); l++) {
+-	    if (maskTab[l & 7] & row[l >> 3])
++	    if (maskTab[l & 7] & (((int*)row)[l >> 3]))
+ 		putchar('X');
+ 	    else
+ 		putchar('.');
+--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
+@@ -1678,10 +1678,11 @@
+ 
+   #ifdef TEST
+ 
+-  fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n",
+-              (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
+-                  pSrc -> pDrawable -> width, pSrc -> pDrawable -> height);
+-
++  if (pSrc->pDrawable) {
++    fprintf(stderr, "nxagentTrapezoids: Source is a [%s] of geometry [%d,%d].\n",
++                (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
++                    pSrc -> pDrawable -> width, pSrc -> pDrawable -> height);
++  }
+   if (pSrc ->pDrawable != pDst -> pDrawable)
+   {
+     fprintf(stderr, "nxagentTrapezoids: Destination is a [%s] of geometry [%d,%d].\n",
+--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
+@@ -734,7 +734,7 @@
+ 
+ 		client->sequence++;
+ #ifdef DEBUG
+-		if (client->requestLogIndex == MAX_REQUEST_LOG)
++		if ((client->requestLogIndex >= MAX_REQUEST_LOG) || (client->requestLogIndex <= 0))
+ 		    client->requestLogIndex = 0;
+ 		client->requestLog[client->requestLogIndex] = MAJOROP;
+ 		client->requestLogIndex++;
+--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
+@@ -2351,7 +2351,7 @@
+ 	byte = 0;
+ 	for (l = 0; l <= (cip->metrics.rightSideBearing -
+ 			  cip->metrics.leftSideBearing); l++) {
+-	    if (maskTab[l & 7] & row[l >> 3])
++	    if (maskTab[l & 7] & (((int *)row)[l >> 3]))
+ 		putchar('X');
+ 	    else
+ 		putchar('.');
diff --git a/debian/patches/series b/debian/patches/series
index 5d28ae7..ad78912 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -61,6 +61,7 @@
 604_nx-X11_recent-freetype-API.full.patch
 605_nxcomp_Types.h-dont-use-STL-internals-on-libc++.full.patch
 606_nx-X11_build-on-aarch64.full.patch
+990_fix-DEBUG-and-TEST-builds.full.patch
 999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch
 016_nx-X11_install-location.debian.patch
 102_xserver-xext_set-securitypolicy-path.debian.patch

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list