[X2Go-Commits] [nx-libs] 12/14: Several fixes for building debug versions of NX (990_fix-DEBUG-and-TEST-builds.full.patch).

git-admin at x2go.org git-admin at x2go.org
Fri Feb 13 13:59:14 CET 2015


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

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

commit 6e662473126d0668493732ece7e3c3bb1b0ea72c
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Feb 13 13:41:31 2015 +0100

    Several fixes for building debug versions of NX (990_fix-DEBUG-and-TEST-builds.full.patch).
    
      (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.
---
 .../990_fix-DEBUG-and-TEST-builds.full.patch       |   69 --------------------
 debian/patches/series                              |    1 -
 nx-X11/programs/Xserver/dix/dixfonts.c             |    2 +-
 nx-X11/programs/Xserver/hw/nxagent/Render.c        |    9 +--
 nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c  |    2 +-
 nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c  |    2 +-
 6 files changed, 8 insertions(+), 77 deletions(-)

diff --git a/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch b/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch
deleted file mode 100644
index 23c8508..0000000
--- a/debian/patches/990_fix-DEBUG-and-TEST-builds.full.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-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
-@@ -735,7 +735,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 0c9d343..76709c4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,4 @@
 #401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch
-990_fix-DEBUG-and-TEST-builds.full.patch
 991_fix-hr-typos.full+lite.patch
 991_fix-hr-typos.full.patch
 999_nxagent_unbrand-nxagent-brand-x2goagent.full.patch
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index b66fe23..193f555 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -2203,7 +2203,7 @@ dump_char_ascii(CharInfoPtr cip)
 	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/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 41a1ec0..c5fd063 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -1678,10 +1678,11 @@ FIXME: Is this useful or just a waste of bandwidth?
 
   #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",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
index f18c09f..3d9ee8c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
@@ -735,7 +735,7 @@ Reply   Total	Cached	Bits In			Bits Out		Bits/Reply	  Ratio
 
 		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++;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
index 3234c99..2b64269 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c
@@ -2351,7 +2351,7 @@ dump_char_ascii(CharInfoPtr cip)
 	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('.');

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