[PATCH libX11 2/2] xcb_io: Add comment explaining a mixed type double assignment

Jonas Petersen jnsptrsn1 at gmail.com
Mon Oct 28 23:36:31 CET 2013


The assignment might be confusing at first. So I added a note.

Signed-off-by: Jonas Petersen <jnsptrsn1 at gmail.com>
---
 src/xcb_io.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xcb_io.c b/src/xcb_io.c
index f2978d0..acb1e3b 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -83,6 +83,10 @@ static void require_socket(Display *dpy)
 						 "did not own the socket",
 			                         xcb_xlib_seq_number_wrapped);
 		}
+		/* The following line will truncate the 64-bit 'sent'
+		 * to 32-bit when assigning it to 'dpy->request'. The
+		 * truncated value will then be assigned to the 64-bit
+		 * 'dpy->xcb->last_flushed' (which is intended). */
 		dpy->xcb->last_flushed = dpy->request = sent;
 		dpy->bufmax = dpy->xcb->real_bufmax;
 	}
-- 
1.7.10.4



More information about the xorg-devel mailing list