minor Xlib refactoring patch: preparing for XCB

Jamey Sharp jamey at minilop.net
Mon Feb 13 12:05:34 PST 2006


Hey folks,

I'm preparing a patch against X.org modular libX11 for XCB, which I hope
to have done later this week. But I'd like to get the attached patch
committed first: I believe it's a good idea anyway, and it'll make my
later patch easier to review.

Would somebody with X.org commit access review and commit this for me?

Thanks!

--Jamey
-------------- next part --------------
Index: ChangeLog
===================================================================
RCS file: /cvs/xorg/lib/X11/ChangeLog,v
retrieving revision 1.45
diff -u -r1.45 ChangeLog
--- ChangeLog	12 Feb 2006 18:19:17 -0000	1.45
+++ ChangeLog	13 Feb 2006 19:52:29 -0000
@@ -1,3 +1,10 @@
+2006-02-13  Jamey Sharp  <jamey at minilop.net>
+
+	* src/XlibInt.c:
+	Refactor _XFlush and _XSend code that sets dpy->synchandler to
+	_XSeqSyncFunction into a new function, _XSetSeqSyncFunction. It makes
+	the patch for XCB cleaner, but is arguably a good idea anyway.
+
 2006-02-12  Alan Coopersmith  <alan.coopersmith at sun.com>
 
 	* man/Makefile.am: 
Index: src/XlibInt.c
===================================================================
RCS file: /cvs/xorg/lib/X11/src/XlibInt.c,v
retrieving revision 1.7
diff -u -r1.7 XlibInt.c
--- src/XlibInt.c	9 Jun 2005 15:52:02 -0000	1.7
+++ src/XlibInt.c	13 Feb 2006 19:52:29 -0000
@@ -577,6 +577,18 @@
     return 0;
 }
 
+static
+void _XSetSeqSyncFunction(
+    register Display *dpy)
+{
+    if ((dpy->request - dpy->last_request_read) >= SEQLIMIT &&
+	!(dpy->flags & XlibDisplayPrivSync)) {
+	dpy->savedsynchandler = dpy->synchandler;
+	dpy->synchandler = _XSeqSyncFunction;
+	dpy->flags |= XlibDisplayPrivSync;
+    }
+}
+
 #ifdef XTHREADS
 static void _XFlushInt(
         register Display *dpy,
@@ -689,12 +701,7 @@
 	    }
 	}
 	dpy->last_req = (char *)&_dummy_request;
-	if ((dpy->request - dpy->last_request_read) >= SEQLIMIT &&
-	    !(dpy->flags & XlibDisplayPrivSync)) {
-	    dpy->savedsynchandler = dpy->synchandler;
-	    dpy->synchandler = _XSeqSyncFunction;
-	    dpy->flags |= XlibDisplayPrivSync;
-	}
+	_XSetSeqSyncFunction(dpy);
 	dpy->bufptr = dpy->buffer;
 #ifdef XTHREADS
 	dpy->flags &= ~XlibDisplayWriting;
@@ -1452,12 +1459,7 @@
 	    }
 	}
 	dpy->last_req = (char *) & _dummy_request;
-	if ((dpy->request - dpy->last_request_read) >= SEQLIMIT &&
-	    !(dpy->flags & XlibDisplayPrivSync)) {
-	    dpy->savedsynchandler = dpy->synchandler;
-	    dpy->synchandler = _XSeqSyncFunction;
-	    dpy->flags |= XlibDisplayPrivSync;
-	}
+	_XSetSeqSyncFunction(dpy);
 	dpy->bufptr = dpy->buffer;
 #ifdef XTHREADS
 	dpy->flags &= ~XlibDisplayWriting;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20060213/eab0a284/attachment.pgp>


More information about the xorg mailing list