[Xcb] [RFC libxcb 2/5] Remove full_sequence from all generic structures

Daniel Martin consume.noise at gmail.com
Tue Jun 4 15:52:03 PDT 2013


Remove the full_sequence from xcb_generic_event_t, xcb_ge_event_t and
xcb_generic_error_t. But, save it with the event in the queue.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 src/xcb.h    | 3 ---
 src/xcb_in.c | 5 ++---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/xcb.h b/src/xcb.h
index 5419813..b804d9f 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -134,7 +134,6 @@ typedef struct {
     uint8_t  pad0;           /**< Padding */
     uint16_t sequence;       /**< Sequence number */
     uint32_t pad[7];         /**< Padding */
-    uint32_t full_sequence;  /**< full sequence */
 } xcb_generic_event_t;
 
 /**
@@ -151,7 +150,6 @@ typedef struct {
     uint16_t event_type;
     uint16_t pad1;
     uint32_t pad[5];         /**< Padding */
-    uint32_t full_sequence;  /**< full sequence */
 } xcb_ge_event_t;
 
 /**
@@ -168,7 +166,6 @@ typedef struct {
     uint8_t major_code;       /** < Major opcode of the failed request */
     uint8_t pad0;
     uint32_t pad[5];         /**< Padding */
-    uint32_t full_sequence;  /**< full sequence */
 } xcb_generic_error_t;
 
 /**
diff --git a/src/xcb_in.c b/src/xcb_in.c
index a9d7c51..207a2ac 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -58,6 +58,7 @@
 struct event_list {
     xcb_generic_event_t *event;
     struct event_list *next;
+    uint64_t full_sequence;
 };
 
 struct reply_list {
@@ -204,9 +205,6 @@ static int read_packet(xcb_connection_t *c)
         return 1;
     }
 
-    if(genrep.response_type != XCB_REPLY)
-        ((xcb_generic_event_t *) buf)->full_sequence = c->in.request_read;
-
     /* reply, or checked error */
     if( genrep.response_type == XCB_REPLY ||
        (genrep.response_type == XCB_ERROR && pend && (pend->flags & XCB_REQUEST_CHECKED)))
@@ -237,6 +235,7 @@ static int read_packet(xcb_connection_t *c)
     }
     event->event = buf;
     event->next = 0;
+    event->full_sequence = c->in.request_read;
     *c->in.events_tail = event;
     c->in.events_tail = &event->next;
     pthread_cond_signal(&c->in.event_cond);
-- 
1.8.3



More information about the Xcb mailing list